flapdoodle-oss / de.flapdoodle.embed.mongo

...will provide a platform neutral way for running mongodb in unittests.
Apache License 2.0
907 stars 161 forks source link

Exception while initiating test ApplicationContex #509

Closed yokain closed 5 months ago

yokain commented 8 months ago

Hello,

Currently, I'm stuck with an issue that appears while initiating ApplicationContext for tests. App works fine with mongoDB image.

Could you assist me, please?

env: OpenJDK 21 spring boot 3.2.1

dependencies: testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo:4.11.0" testImplementation "de.flapdoodle.embed:de.flapdoodle.embed.mongo.spring30x:4.11.0"

application.yaml server: port: 8088 management: endpoints: web: exposure: include: "health,prometheus" spring: jackson: date-format: "com.supplyon.dos.common.util.RFC3339DateFormat" serialization: WRITE_DATES_AS_TIMESTAMPS: false data: mongodb: database: dosdb port: 27017 host: localhost de: flapdoodle: mongodb: embedded: version: 5.0.5

test class `@DataMongoTest() @ExtendWith(SpringExtension.class) @ActiveProfiles("test") public class EnvelopeControllerTest { @Autowired MongoTemplate mongoTemplate;

@Autowired
private EnvelopeRepository repository;

@Before
public void setup() {
   // mongoTemplate.save(new EnvelopeEntity("Test","done"), "envelopeEntity");
}

@Test
public void test() {

    //repository.save(new EnvelopeEntity("FirstName", "done"));

    // then
    assertThat(repository.findAll()).extracting("name").containsOnly("TestName");
}

}`

Error log:

Failed to load ApplicationContext for [MergedContextConfiguration@747476f1 testClass = com.supplyon.dos.core.web.v1.EnvelopeControllerTest, locations = [], classes = [com.supplyon.dos.Application], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceDescriptors = [], propertySourceProperties = ["org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.autoconfigure.OverrideAutoConfigurationContextCustomizerFactory$DisableAutoConfigurationContextCustomizer@3df1a1ac, org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory$DisableObservabilityContextCustomizer@1f, org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizer@34be3d80, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@ae29bc9b, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizer@506aabf6, [ImportsContextCustomizer@6238b10a key = [org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoReactiveDataAutoConfiguration, de.flapdoodle.embed.mongo.spring.autoconfigure.EmbeddedMongoAutoConfiguration, org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration, org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.mongo.MongoReactiveAutoConfiguration, org.springframework.boot.autoconfigure.ssl.SslAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoReactiveRepositoriesAutoConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7c663eaf, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@76fe6cdc, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.context.SpringBootTestAnnotation@408bebb0], contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] java.lang.IllegalStateException: Failed to load ApplicationContext for [MergedContextConfiguration@747476f1 testClass = com.supplyon.dos.core.web.v1.EnvelopeControllerTest, locations = [], classes = [com.supplyon.dos.Application], contextInitializerClasses = [], activeProfiles = ["test"], propertySourceDescriptors = [], propertySourceProperties = ["org.springframework.boot.test.autoconfigure.data.mongo.DataMongoTestContextBootstrapper=true"], contextCustomizers = [org.springframework.boot.test.autoconfigure.OverrideAutoConfigurationContextCustomizerFactory$DisableAutoConfigurationContextCustomizer@3df1a1ac, org.springframework.boot.test.autoconfigure.actuate.observability.ObservabilityContextCustomizerFactory$DisableObservabilityContextCustomizer@1f, org.springframework.boot.test.autoconfigure.filter.TypeExcludeFiltersContextCustomizer@34be3d80, org.springframework.boot.test.autoconfigure.properties.PropertyMappingContextCustomizer@ae29bc9b, org.springframework.boot.test.autoconfigure.web.servlet.WebDriverContextCustomizer@506aabf6, [ImportsContextCustomizer@6238b10a key = [org.springframework.boot.autoconfigure.transaction.TransactionAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoReactiveDataAutoConfiguration, de.flapdoodle.embed.mongo.spring.autoconfigure.EmbeddedMongoAutoConfiguration, org.springframework.boot.autoconfigure.cache.CacheAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoDataAutoConfiguration, org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration, org.springframework.boot.autoconfigure.mongo.MongoReactiveAutoConfiguration, org.springframework.boot.autoconfigure.ssl.SslAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoRepositoriesAutoConfiguration, org.springframework.boot.autoconfigure.data.mongo.MongoReactiveRepositoriesAutoConfiguration]], org.springframework.boot.test.context.filter.ExcludeFilterContextCustomizer@7c663eaf, org.springframework.boot.test.json.DuplicateJsonObjectContextCustomizerFactory$DuplicateJsonObjectContextCustomizer@76fe6cdc, org.springframework.boot.test.mock.mockito.MockitoContextCustomizer@0, org.springframework.boot.test.context.SpringBootTestAnnotation@408bebb0], contextLoader = org.springframework.boot.test.context.SpringBootContextLoader, parent = null] at org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:180) at org.springframework.test.context.support.DefaultTestContext.getApplicationContext(DefaultTestContext.java:130) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:141) at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:97) at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:260) at org.springframework.test.context.junit.jupiter.SpringExtension.postProcessTestInstance(SpringExtension.java:163) at java.base/java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:197) at java.base/java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:179) at java.base/java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1708) at java.base/java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:509) at java.base/java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:499) at java.base/java.util.stream.StreamSpliterators$WrappingSpliterator.forEachRemaining(StreamSpliterators.java:310) at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:735) at java.base/java.util.stream.Streams$ConcatSpliterator.forEachRemaining(Streams.java:734) at java.base/java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:762) at java.base/java.util.Optional.orElseGet(Optional.java:364) at java.base/java.util.ArrayList.forEach(ArrayList.java:1596) at java.base/java.util.ArrayList.forEach(ArrayList.java:1596) Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'syncClientServerWrapper' defined in class path resource [de/flapdoodle/embed/mongo/spring/autoconfigure/EmbeddedMongoAutoConfiguration$SyncClientServerWrapperConfig.class]: rollback after error on transition to State(RunningMongodProcess), successful reached: State(ExtractedFileSet)=ExtractedFileSet{baseDir=C:\Users\john_doe.embedmongo\fileSets\cdeed78400d07ae566c7f5c295eceefa033ac22388a9c0b831edb96fc8b16b89, executable=C:\Users\john_doe.embedmongo\fileSets\cdeed78400d07ae566c7f5c295eceefa033ac22388a9c0b831edb96fc8b16b89\mongod.exe, libraryFiles=[]}, State(Archive)=Archive(C:\Users\john_doe.embedmongo\archives\https-fastdl-mongodb-org\56cb3d10404e5b9df5358ac4ee83efcb\windowsmongodb-windows-x86-64-5-0-5-zip\e129093dcf26bcdfb0c59db4228d290afcc821c79d0c2b53dc1da74dc80a9356\archive.zip), State(DownloadCache)=de.flapdoodle.embed.process.store.LocalDownloadCache@79392584, State(Package)=Package{archiveType=ZIP, fileSet=FileSet{entries=[Entry{type=Executable, destination=mongod.exe, uncompiledMatchingPattern=UncompiledPattern{regex=.*mongod.exe, flags=2}}]}, url=https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-5.0.5.zip}, State(ExtractedFileSetStore)=de.flapdoodle.embed.process.store.ContentHashExtractedFileSetStore@cf82c58, State(ProcessArguments)=ProcessArguments([--dbpath, C:\Users\john_S~1\AppData\Local\Temp\temp--f3465109-a251-4db0-bf56-2d8eab14c127\mongod-database7806473714906553135, --noauth, --nojournal, --port, 27017, --bind_ip, 127.0.0.1, --syncdelay=0]), State(ProcessWorkingDir)=ProcessWorkingDir(C:\Users\john_S~1\AppData\Local\Temp\temp--f3465109-a251-4db0-bf56-2d8eab14c127\workingDir13467869224752296974), State(Distribution)=GenericFeatureAwareVersion{5.0.5}:Platform{operatingSystem=Windows, architecture=X86_64}, State(SupportConfig)=SupportConfig{name=mongod, supportUrl=https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo/issues, messageOnException=de.flapdoodle.embed.mongo.transitions.ProcessDefaults$$Lambda/0x000002c8104ca568@1407b93f}, State(Name)=Name(mongod), State(PersistentDir)=ImmutablePersistentDir(C:\Users\john_doe.embedmongo), State(DatabaseDir)=DatabaseDir(C:\Users\john_S~1\AppData\Local\Temp\temp--f3465109-a251-4db0-bf56-2d8eab14c127\mongod-database7806473714906553135), State(TempDir)=ImmutableTempDir(C:\Users\john_S~1\AppData\Local\Temp\temp--f3465109-a251-4db0-bf56-2d8eab14c127), State(DistributionBaseUrl)=DistributionBaseUrl(https://fastdl.mongodb.org), State(Platform)=Platform{operatingSystem=Windows, architecture=X86_64}, State(ProcessConfig)=ProcessConfig{daemonProcess=false, stopTimeoutInMillis=5000}, State(ProcessEnv)=ProcessEnv({}), State(ProcessOutput)=ProcessOutput{output=de.flapdoodle.embed.process.io.Slf4jStreamProcessor@5aff8207, error=de.flapdoodle.embed.process.io.Slf4jStreamProcessor@6a5a99d9, commands=de.flapdoodle.embed.process.io.NamedOutputStreamProcessor@278df226}, State(SystemEnv)=SystemEnv({USERDOMAIN_ROAMINGPROFILE=mycompany, NVM_SYMLINK=C:\Program Files\nodejs, PROCESSOR_LEVEL=6, JAVA8_HOME=C:\supplyon\tools\java\openjdk8, SESSIONNAME=Console, ALLUSERSPROFILE=C:\ProgramData, PROCESSOR_ARCHITECTURE=AMD64, PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules, SystemDrive=C:, USERNAME=john_doe, USERDNSDOMAIN=mycompany.com, ProgramFiles(x86)=C:\Program Files (x86), JAVA21_HOME=C:\dsin\jdk-21.0.1, PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW, DriverData=C:\Windows\System32\Drivers\DriverData, ProgramData=C:\ProgramData, ProgramW6432=C:\Program Files, __PSLockDownPolicy=0, HOMEPATH=\Users\john_doe, PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 12, GenuineIntel, ProgramFiles=C:\Program Files, PUBLIC=C:\Users\Public, windir=C:\Windows, ZES_ENABLE_SYSMAN=1, OneDriveCommercial=C:\Users\john_doe\OneDrive - mycompany, LOCALAPPDATA=C:\Users\john_doe\AppData\Local, ChocolateyLastPathUpdate=133123914547156264, DOCKER_HOST=tcp://[::1]:2375, JAVA17_HOME=C:\dsin\jdk-17, USERDOMAIN=mycompany, LOGONSERVER=\EPPLKRAW005A, JAVA_HOME=C:\dsin\jdk-21.0.1, OneDrive=C:\Users\john_doe\OneDrive - mycompany, APPDATA=C:\Users\john_doe\AppData\Roaming, GRADLE_USER_HOME=C:\supplyon\home.gradle, ChocolateyInstall=C:\ProgramData\chocolatey, IDEA_JDK_64=C:\supplyon\tools\java\openjdk8, CommonProgramFiles=C:\Program Files\Common Files, Path=C:\Python311\Scripts\;C:\Python311\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;%NVM_HOME%;%NVM_SYMLINK%;C:\dsin\JEnv-for-Windows;C:\dsin\jdk-21.0.1\bin;C:\supplyon\tools\gradle\bin;C:\Python311\Scripts\;C:\Python311\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Users\john_doe\AppData\Local\Microsoft\WindowsApps;C:\Users\john_doe\AppData\Local\Programs\Fiddler;C:\Users\john_doe\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\john_doe\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files (x86)\MongoDB Atlas CLI\;C:\dsin\mongosh-2.1.1-win32-x64\bin;, OS=Windows_NT, COMPUTERNAME=EPPLKRAW005A, NVM_HOME=C:\Users\john_doe\AppData\Roaming\nvm, PROCESSOR_REVISION=8e0c, CommonProgramW6432=C:\Program Files\Common Files, ComSpec=C:\Windows\system32\cmd.exe, UATDATA=C:\Windows\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77, SystemRoot=C:\Windows, TEMP=C:\Users\john_S~1\AppData\Local\Temp, HOMEDRIVE=C:, USERPROFILE=C:\Users\john_doe, TMP=C:\Users\john_S~1\AppData\Local\Temp, CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files, NUMBER_OF_PROCESSORS=8, IDEA_INITIAL_DIRECTORY=C:\Windows\system32}), State(ProgressListener)=de.flapdoodle.embed.process.io.progress.Slf4jProgressListener@eea69a9, State(Command)=MongoD, State(Version)=GenericFeatureAwareVersion{5.0.5}, State(Net)=Net{bindIp=127.0.0.1, port=27017, isIpv6=false}, State(MongodArguments)=MongodArguments{syncDelay=0, useDefaultSyncDelay=false, isVerbose=false, verbosityLevel=1, isQuiet=false, useNoPrealloc=true, useSmallFiles=true, useNoJournal=true, enableTextSearch=false, auth=false, master=false, isConfigServer=false, isShardServer=false, params={}, args={}}

at app//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1773)
at app//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:599)
at app//org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:521)
at app//org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:325)
at app//org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
at app//org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:323)
at app//org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:199)
at app//org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:975)
at app//org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:960)
at app//org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:625)
at app//org.springframework.boot.SpringApplication.refresh(SpringApplication.java:762)
at app//org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:464)
at app//org.springframework.boot.SpringApplication.run(SpringApplication.java:334)
at app//org.springframework.boot.test.context.SpringBootContextLoader.lambda$loadContext$3(SpringBootContextLoader.java:137)
at app//org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:58)
at app//org.springframework.util.function.ThrowingSupplier.get(ThrowingSupplier.java:46)
at app//org.springframework.boot.SpringApplication.withHook(SpringApplication.java:1458)
at app//org.springframework.boot.test.context.SpringBootContextLoader$ContextLoaderHook.run(SpringBootContextLoader.java:552)
at app//org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:137)
at app//org.springframework.boot.test.context.SpringBootContextLoader.loadContext(SpringBootContextLoader.java:108)
at app//org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:225)
at app//org.springframework.test.context.cache.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:152)
... 17 more

Caused by: java.lang.RuntimeException: rollback after error on transition to State(RunningMongodProcess), successful reached: State(ExtractedFileSet)=ExtractedFileSet{baseDir=C:\Users\john_doe.embedmongo\fileSets\cdeed78400d07ae566c7f5c295eceefa033ac22388a9c0b831edb96fc8b16b89, executable=C:\Users\john_doe.embedmongo\fileSets\cdeed78400d07ae566c7f5c295eceefa033ac22388a9c0b831edb96fc8b16b89\mongod.exe, libraryFiles=[]}, State(Archive)=Archive(C:\Users\john_doe.embedmongo\archives\https-fastdl-mongodb-org\56cb3d10404e5b9df5358ac4ee83efcb\windowsmongodb-windows-x86-64-5-0-5-zip\e129093dcf26bcdfb0c59db4228d290afcc821c79d0c2b53dc1da74dc80a9356\archive.zip), State(DownloadCache)=de.flapdoodle.embed.process.store.LocalDownloadCache@79392584, State(Package)=Package{archiveType=ZIP, fileSet=FileSet{entries=[Entry{type=Executable, destination=mongod.exe, uncompiledMatchingPattern=UncompiledPattern{regex=.*mongod.exe, flags=2}}]}, url=https://fastdl.mongodb.org/windows/mongodb-windows-x86_64-5.0.5.zip}, State(ExtractedFileSetStore)=de.flapdoodle.embed.process.store.ContentHashExtractedFileSetStore@cf82c58, State(ProcessArguments)=ProcessArguments([--dbpath, C:\Users\john_S~1\AppData\Local\Temp\temp--f3465109-a251-4db0-bf56-2d8eab14c127\mongod-database7806473714906553135, --noauth, --nojournal, --port, 27017, --bind_ip, 127.0.0.1, --syncdelay=0]), State(ProcessWorkingDir)=ProcessWorkingDir(C:\Users\john_S~1\AppData\Local\Temp\temp--f3465109-a251-4db0-bf56-2d8eab14c127\workingDir13467869224752296974), State(Distribution)=GenericFeatureAwareVersion{5.0.5}:Platform{operatingSystem=Windows, architecture=X86_64}, State(SupportConfig)=SupportConfig{name=mongod, supportUrl=https://github.com/flapdoodle-oss/de.flapdoodle.embed.mongo/issues, messageOnException=de.flapdoodle.embed.mongo.transitions.ProcessDefaults$$Lambda/0x000002c8104ca568@1407b93f}, State(Name)=Name(mongod), State(PersistentDir)=ImmutablePersistentDir(C:\Users\john_doe.embedmongo), State(DatabaseDir)=DatabaseDir(C:\Users\john_S~1\AppData\Local\Temp\temp--f3465109-a251-4db0-bf56-2d8eab14c127\mongod-database7806473714906553135), State(TempDir)=ImmutableTempDir(C:\Users\john_S~1\AppData\Local\Temp\temp--f3465109-a251-4db0-bf56-2d8eab14c127), State(DistributionBaseUrl)=DistributionBaseUrl(https://fastdl.mongodb.org), State(Platform)=Platform{operatingSystem=Windows, architecture=X86_64}, State(ProcessConfig)=ProcessConfig{daemonProcess=false, stopTimeoutInMillis=5000}, State(ProcessEnv)=ProcessEnv({}), State(ProcessOutput)=ProcessOutput{output=de.flapdoodle.embed.process.io.Slf4jStreamProcessor@5aff8207, error=de.flapdoodle.embed.process.io.Slf4jStreamProcessor@6a5a99d9, commands=de.flapdoodle.embed.process.io.NamedOutputStreamProcessor@278df226}, State(SystemEnv)=SystemEnv({USERDOMAIN_ROAMINGPROFILE=mycompany, NVM_SYMLINK=C:\Program Files\nodejs, PROCESSOR_LEVEL=6, JAVA8_HOME=C:\supplyon\tools\java\openjdk8, SESSIONNAME=Console, ALLUSERSPROFILE=C:\ProgramData, PROCESSOR_ARCHITECTURE=AMD64, PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules, SystemDrive=C:, USERNAME=john_doe, USERDNSDOMAIN=mycompany.com, ProgramFiles(x86)=C:\Program Files (x86), JAVA21_HOME=C:\dsin\jdk-21.0.1, PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC;.PY;.PYW, DriverData=C:\Windows\System32\Drivers\DriverData, ProgramData=C:\ProgramData, ProgramW6432=C:\Program Files, __PSLockDownPolicy=0, HOMEPATH=\Users\john_doe, PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 12, GenuineIntel, ProgramFiles=C:\Program Files, PUBLIC=C:\Users\Public, windir=C:\Windows, ZES_ENABLE_SYSMAN=1, OneDriveCommercial=C:\Users\john_doe\OneDrive - mycompany, LOCALAPPDATA=C:\Users\john_doe\AppData\Local, ChocolateyLastPathUpdate=133123914547156264, DOCKER_HOST=tcp://[::1]:2375, JAVA17_HOME=C:\dsin\jdk-17, USERDOMAIN=mycompany, LOGONSERVER=\EPPLKRAW005A, JAVA_HOME=C:\dsin\jdk-21.0.1, OneDrive=C:\Users\john_doe\OneDrive - mycompany, APPDATA=C:\Users\john_doe\AppData\Roaming, GRADLE_USER_HOME=C:\supplyon\home.gradle, ChocolateyInstall=C:\ProgramData\chocolatey, IDEA_JDK_64=C:\supplyon\tools\java\openjdk8, CommonProgramFiles=C:\Program Files\Common Files, Path=C:\Python311\Scripts\;C:\Python311\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\ProgramData\chocolatey\bin;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;%NVM_HOME%;%NVM_SYMLINK%;C:\dsin\JEnv-for-Windows;C:\dsin\jdk-21.0.1\bin;C:\supplyon\tools\gradle\bin;C:\Python311\Scripts\;C:\Python311\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Git\cmd;C:\Program Files\nodejs\;C:\ProgramData\chocolatey\bin;C:\Users\john_doe\AppData\Local\Microsoft\WindowsApps;C:\Users\john_doe\AppData\Local\Programs\Fiddler;C:\Users\john_doe\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\john_doe\AppData\Roaming\nvm;C:\Program Files\nodejs;C:\Program Files (x86)\MongoDB Atlas CLI\;C:\dsin\mongosh-2.1.1-win32-x64\bin;, OS=Windows_NT, COMPUTERNAME=EPPLKRAW005A, NVM_HOME=C:\Users\john_doe\AppData\Roaming\nvm, PROCESSOR_REVISION=8e0c, CommonProgramW6432=C:\Program Files\Common Files, ComSpec=C:\Windows\system32\cmd.exe, UATDATA=C:\Windows\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77, SystemRoot=C:\Windows, TEMP=C:\Users\john_S~1\AppData\Local\Temp, HOMEDRIVE=C:, USERPROFILE=C:\Users\john_doe, TMP=C:\Users\john_S~1\AppData\Local\Temp, CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files, NUMBER_OF_PROCESSORS=8, IDEA_INITIAL_DIRECTORY=C:\Windows\system32}), State(ProgressListener)=de.flapdoodle.embed.process.io.progress.Slf4jProgressListener@eea69a9, State(Command)=MongoD, State(Version)=GenericFeatureAwareVersion{5.0.5}, State(Net)=Net{bindIp=127.0.0.1, port=27017, isIpv6=false}, State(MongodArguments)=MongodArguments{syncDelay=0, useDefaultSyncDelay=false, isVerbose=false, verbosityLevel=1, isQuiet=false, useNoPrealloc=true, useSmallFiles=true, useNoJournal=true, enableTextSearch=false, auth=false, master=false, isConfigServer=false, isShardServer=false, params={}, args={}}

at de.flapdoodle.reverse.TransitionWalker.initState(TransitionWalker.java:190)
at de.flapdoodle.reverse.TransitionWalker.initState(TransitionWalker.java:69)
at de.flapdoodle.reverse.TransitionWalker.initState(TransitionWalker.java:65)
at de.flapdoodle.embed.mongo.spring.autoconfigure.MongodWrapper.start(MongodWrapper.java:45)
at java.base/java.lang.reflect.Method.invoke(Method.java:580)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1877)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1830)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1769)
... 38 more

Caused by: java.lang.RuntimeException: Could not start process:

Hmm.. no failure message.. ...the cause must be somewhere in the process output

{"t":{"$date":"2024-01-23T00:25:39.449+01:00"},"s":"I", "c":"CONTROL", "id":23285, "ctx":"-","msg":"Automatically disabling TLS 1.0, to force-enable TLS 1.0 specify --sslDisabledProtocols 'none'"} {"t":{"$date":"2024-01-23T00:25:39.450+01:00"},"s":"I", "c":"NETWORK", "id":4915701, "ctx":"-","msg":"Initialized wire specification","attr":{"spec":{"incomingExternalClient":{"minWireVersion":0,"maxWireVersion":13},"incomingInternalClient":{"minWireVersion":0,"maxWireVersion":13},"outgoing":{"minWireVersion":0,"maxWireVersion":13},"isInternalClient":true}}} {"t":{"$date":"2024-01-23T00:25:39.515+01:00"},"s":"W", "c":"ASIO", "id":22601, "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"} {"t":{"$date":"2024-01-23T00:25:39.516+01:00"},"s":"I", "c":"NETWORK", "id":4648602, "ctx":"main","msg":"Implicit TCP FastOpen in use."} {"t":{"$date":"2024-01-23T00:25:39.518+01:00"},"s":"W", "c":"ASIO", "id":22601, "ctx":"main","msg":"No TransportLayer configured during NetworkInterface startup"} {"t":{"$date":"2024-01-23T00:25:39.518+01:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationDonorService","ns":"config.tenantMigrationDonors"}} {"t":{"$date":"2024-01-23T00:25:39.518+01:00"},"s":"I", "c":"REPL", "id":5123008, "ctx":"main","msg":"Successfully registered PrimaryOnlyService","attr":{"service":"TenantMigrationRecipientService","ns":"config.tenantMigrationRecipients"}} {"t":{"$date":"2024-01-23T00:25:39.518+01:00"},"s":"I", "c":"CONTROL", "id":5945603, "ctx":"main","msg":"Multi threading initialized"} {"t":{"$date":"2024-01-23T00:25:39.519+01:00"},"s":"I", "c":"CONTROL", "id":4615611, "ctx":"initandlisten","msg":"MongoDB starting","attr":{"pid":19488,"port":27017,"dbPath":"C:/Users/john_S~1/AppData/Local/Temp/temp--f3465109-a251-4db0-bf56-2d8eab14c127/mongod-database7806473714906553135","architecture":"64-bit","host":"EPPLKRAW005A"}} {"t":{"$date":"2024-01-23T00:25:39.519+01:00"},"s":"I", "c":"CONTROL", "id":23398, "ctx":"initandlisten","msg":"Target operating system minimum version","attr":{"targetMinOS":"Windows 7/Windows Server 2008 R2"}} {"t":{"$date":"2024-01-23T00:25:39.519+01:00"},"s":"I", "c":"CONTROL", "id":23403, "ctx":"initandlisten","msg":"Build Info","attr":{"buildInfo":{"version":"5.0.5","gitVersion":"d65fd89df3fc039b5c55933c0f71d647a54510ae","modules":[],"allocator":"tcmalloc","environment":{"distmod":"windows","distarch":"x86_64","target_arch":"x86_64"}}}} {"t":{"$date":"2024-01-23T00:25:39.519+01:00"},"s":"I", "c":"CONTROL", "id":51765, "ctx":"initandlisten","msg":"Operating System","attr":{"os":{"name":"Microsoft Windows 10","version":"10.0 (build 19045)"}}} {"t":{"$date":"2024-01-23T00:25:39.519+01:00"},"s":"I", "c":"CONTROL", "id":21951, "ctx":"initandlisten","msg":"Options set by command line","attr":{"options":{"net":{"bindIp":"127.0.0.1","port":27017},"security":{"authorization":"disabled"},"storage":{"dbPath":"C:\Users\john_S~1\AppData\Local\Temp\temp--f3465109-a251-4db0-bf56-2d8eab14c127\mongod-database7806473714906553135","journal":{"enabled":false},"syncPeriodSecs":0}}}} {"t":{"$date":"2024-01-23T00:25:39.520+01:00"},"s":"E", "c":"CONTROL", "id":20568, "ctx":"initandlisten","msg":"Error setting up listener","attr":{"error":{"code":9001,"codeName":"SocketException","errmsg":"An attempt was made to access a socket in a way forbidden by its access permissions."}}} {"t":{"$date":"2024-01-23T00:25:39.520+01:00"},"s":"I", "c":"REPL", "id":4784900, "ctx":"initandlisten","msg":"Stepping down the ReplicationCoordinator for shutdown","attr":{"waitTimeMillis":15000}} {"t":{"$date":"2024-01-23T00:25:39.520+01:00"},"s":"I", "c":"COMMAND", "id":4784901, "ctx":"initandlisten","msg":"Shutting down the MirrorMaestro"} {"t":{"$date":"2024-01-23T00:25:39.520+01:00"},"s":"I", "c":"SHARDING", "id":4784902, "ctx":"initandlisten","msg":"Shutting down the WaitForMajorityService"} {"t":{"$date":"2024-01-23T00:25:39.520+01:00"},"s":"I", "c":"NETWORK", "id":4784905, "ctx":"initandlisten","msg":"Shutting down the global connection pool"} {"t":{"$date":"2024-01-23T00:25:39.520+01:00"},"s":"I", "c":"NETWORK", "id":4784918, "ctx":"initandlisten","msg":"Shutting down the ReplicaSetMonitor"} {"t":{"$date":"2024-01-23T00:25:39.520+01:00"},"s":"I", "c":"SHARDING", "id":4784921, "ctx":"initandlisten","msg":"Shutting down the MigrationUtilExecutor"} {"t":{"$date":"2024-01-23T00:25:39.520+01:00"},"s":"I", "c":"ASIO", "id":22582, "ctx":"MigrationUtil-TaskExecutor","msg":"Killing all outstanding egress activity."} {"t":{"$date":"2024-01-23T00:25:39.520+01:00"},"s":"I", "c":"COMMAND", "id":4784923, "ctx":"initandlisten","msg":"Shutting down the ServiceEntryPoint"} {"t":{"$date":"2024-01-23T00:25:39.521+01:00"},"s":"I", "c":"CONTROL", "id":4784925, "ctx":"initandlisten","msg":"Shutting down free monitoring"} {"t":{"$date":"2024-01-23T00:25:39.521+01:00"},"s":"I", "c":"CONTROL", "id":4784927, "ctx":"initandlisten","msg":"Shutting down the HealthLog"} {"t":{"$date":"2024-01-23T00:25:39.521+01:00"},"s":"I", "c":"CONTROL", "id":4784928, "ctx":"initandlisten","msg":"Shutting down the TTL monitor"} {"t":{"$date":"2024-01-23T00:25:39.521+01:00"},"s":"I", "c":"CONTROL", "id":4784929, "ctx":"initandlisten","msg":"Acquiring the global lock for shutdown"} {"t":{"$date":"2024-01-23T00:25:39.521+01:00"},"s":"I", "c":"-", "id":4784931, "ctx":"initandlisten","msg":"Dropping the scope cache for shutdown"} {"t":{"$date":"2024-01-23T00:25:39.521+01:00"},"s":"I", "c":"FTDC", "id":4784926, "ctx":"initandlisten","msg":"Shutting down full-time data capture"} {"t":{"$date":"2024-01-23T00:25:39.521+01:00"},"s":"I", "c":"CONTROL", "id":20565, "ctx":"initandlisten","msg":"Now exiting"} {"t":{"$date":"2024-01-23T00:25:39.521+01:00"},"s":"I", "c":"CONTROL", "id":23138, "ctx":"initandlisten","msg":"Shutting down","attr":{"exitCode":48}}

at de.flapdoodle.embed.mongo.transitions.RunningMongoProcess.lambda$null$1(RunningMongoProcess.java:179)
at de.flapdoodle.types.ThrowingSupplier.lambda$andFinally$1(ThrowingSupplier.java:47)
at de.flapdoodle.types.ThrowingSupplier.lambda$andFinally$1(ThrowingSupplier.java:47)
at de.flapdoodle.embed.mongo.transitions.RunningMongoProcess.lambda$factory$3(RunningMongoProcess.java:185)
at de.flapdoodle.embed.process.types.RunningProcess.start(RunningProcess.java:83)
at de.flapdoodle.embed.mongo.transitions.MongoServerStarter.result(MongoServerStarter.java:119)
at de.flapdoodle.reverse.TransitionWalker.resolve(TransitionWalker.java:58)
at de.flapdoodle.reverse.TransitionWalker.resolve(TransitionWalker.java:46)
at de.flapdoodle.reverse.TransitionWalker.initState(TransitionWalker.java:180)
... 45 more
michaelmosmann commented 8 months ago

@yokain

"Error setting up listener","attr":{"error":{"code":9001,"codeName":"SocketException","errmsg":"An attempt was made to access a socket in a way forbidden by its access permissions.

Do you have an other mongodb running on default port 27017?

yokain commented 8 months ago

No, but this port is busy. I changed port to 27019, now it works. Thank you! May I ask you to make this exception more transparent? for example, throw a custom exception if port is busy

michaelmosmann commented 8 months ago

@yokain For this i have to parse the mongodb error log stream .. but will do. I thought i had this case already build in.. hmm. I will leave this open until i changed this..

thanks for this use-case:)

michaelmosmann commented 5 months ago

will fix this in the next release