de.flapdoodle.embed.mongo: Docker build failed when using Flapdoodle in springboot 3.1.1

Hi,

Currently, I’m stuck with an issue that the gradle build successfully in my local. However, all mongo related unit tests are failed when I do docker build.

Below is the error message when I do docker build: java.lang.IllegalStateException at DefaultCacheAwareContextLoaderDelegate.java:143 Caused by: org.springframework.beans.factory.BeanCreationException at AbstractAutowireCapableBeanFactory.java:1770 Caused by: java.lang.RuntimeException at TransitionWalker.java:186 Caused by: java.lang.RuntimeException at MongoServerStarter.java:129 Caused by: java.io.IOException at ProcessBuilder.java:1143 Caused by: java.io.IOException at ProcessImpl.java:-2

ENVs:

    testImplementation group: 'de.flapdoodle.embed', name: 'de.flapdoodle.embed.mongo.spring30x', version: '4.7.1'
Springboot:3.1.1
JDK:17
de.flapdoodle.mongodb.embedded.version=6.0.5

Any ideas about above issue? Thanks in advance.

About this issue

  • Original URL
  • State: closed
  • Created 10 months ago
  • Comments: 43 (20 by maintainers)

Most upvoted comments

This is the docker images list that I tried other than alpine @michaelmosmann @gregecho

  • eclipse-temurin:17.0.8.1_1-jdk-jammy ❌
  • eclipse-temurin:17.0.8.1_1-jdk-focal ✅
  • eclipse-temurin:17.0.8.1_1-jdk-centos7 ✅
  • amazoncorretto:17-al2023-jdk ❌
  • sapmachine:jdk-ubuntu-17 ❌
  • sapmachine:jdk-ubuntu-17.0.8 ❌

Hope it helps for anyone looking for alternative

meanwhile later we can fix for the alpine, because I prefer with alpine

@gregecho yes… so maybe switching away from alpine as an docker image is not the most complicated option anymore. Even with fixing the first issue (calling ./mongod does not give file-not-found anymore) does not lead to something working… the next issue are maybe some missing link libs…

@gregecho new release done … …mongo.spring30x:4.9.2 will be in maven central in some hours.

@gregecho not now… it could be some docker-linux-dist mongodb-version mismatch, some “could not write executable”-bug … i will add some checks, build a new release (inkl. …mongo.spring30x) and then i think we will get some better error messages.

@gregecho just use beside the …mongo.spring30x dependency this:

<dependency>
	<groupId>de.flapdoodle.embed</groupId>
	<artifactId>de.flapdoodle.embed.mongo</artifactId>
	<version>4.9.1</version>
</dependency>

… until i make a new release of …mongo.spring30x.