Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

235
Vistas
Embedded mongo (flapdoodle) does not start in Spring Boot 1.5

I'm trying to upgrade from Spring Boot 1.4 to 1.5.2. As far as I can tell I've followed the update guidelines.

There are actually two issues, the main one which is to do with embedded mongo:

EmbeddedServletContainerFactory now has to be explicitly created

In the test config class I've had to add this:

@Bean
public EmbeddedServletContainerFactory servletContainer() {
    TomcatEmbeddedServletContainerFactory factory = new TomcatEmbeddedServletContainerFactory();
    factory.setPort(port);
    factory.setSessionTimeout(50, TimeUnit.MINUTES);
    return factory;
}

I did not have to do this before. I had to include it because when I run a test it gives me this error:

Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

Embedded Mongo will not start

Now I get this error:

Caused by: org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'embeddedMongoServer' available

No idea where I should be adding this bean (and indeed why I should be adding it)

My current setup

I have multiple tests that extend BaseIT, which starts like this:

@RunWith(SpringRunner.class)
@DataMongoTest
@SpringBootTest(classes = {TestConfig.class, TestMongoConfig.class},, webEnvironment= SpringBootTest.WebEnvironment.DEFINED_PORT, value = "
{$server.port}")
@ActiveProfiles("test")
public abstract class BaseIT {...}

Mongo config class:

@Configuration
@EnableAutoConfiguration(exclude = { EmbeddedMongoAutoConfiguration.class })
@EnableMongoRepositories(basePackages = "...")
public class TestMongoConfig {
@Bean public MongoClient mongo(){...}
@Bean public MongodProcess mongodProcess(){...}
@Bean public MongodExecutable mongodExecutable(){...}
@Bean public IMongodConfig mongodConfig(){...}
@Bean public MongodStarter mongodStarter(){...}
}

Test config class:

@Configuration
@EnableAutoConfiguration(exclude = {EmbeddedMongoAutoConfiguration.class})
@ComponentScan(value = {...})
@EnableMongoRepositories(basePackages = {...)
@EnableWebMvc
public class TestConfig extends WebMvcConfigurerAdapter {...}
over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda