Please do a quick search on GitHub issues first, there might be already a duplicate issue for the one you are about to create. If the bug is trivial, just go ahead and create the issue. Otherwise, please take a few moments and fill in the following sections:
Bug description
When using a MongoDBAtlasLocalContainer with @ServiceConnection, a StackOverflowException is thrown.
It appears to be caused by
org.springframework.ai.testcontainers.service.connection.mongo.MongoDbAtlasLocalContainerConnectionDetailsFactory$MongoDbAtlasLocalContainerConnectionDetails.getSslBundle(MongoDbAtlasLocalContainerConnectionDetailsFactory.java:83)
with the repeated stackframes being:
at java.base/java.lang.reflect.Method.invoke(Method.java:565)
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:281)
at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:265)
at org.springframework.ai.testcontainers.service.connection.mongo.MongoDbAtlasLocalContainerConnectionDetailsFactory$MongoDbAtlasLocalContainerConnectionDetails.getSslBundle(MongoDbAtlasLocalContainerConnectionDetailsFactory.java:83)
Environment Spring AI - 1.0.1 Java - 21 Maven - 3.9.10 Atlas containers: - mongodb/mongodb-atlas-local:8.0.10 - mongodb/mongodb-atlas-local:latest
Steps to reproduce
1. Create project in Spring Initializer with:
- Testcontainers
- MonogoDB Atlas Vector Database
2. Run mvn test
Expected behavior
No StackOverflowException and for the container to be used.
Minimal Complete Reproducible example Minimal example
Comment From: quaff
@sobychacko Could you review GH-4149 since it's introduced by your commit ea3fd92280581aef12c0425f00159dd6db91b66c
Comment From: themadprofessor
GH-4149 introduces a new error:
Caused by: java.lang.IllegalAccessException: no private access for invokespecial: interface org.springframework.boot.autoconfigure.mongo.MongoConnectionDetails, from interface org.springframework.boot.autoconfigure.mongo.MongoConnectionDetails (unnamed module @fcd6521)
at java.base/java.lang.invoke.MemberName.makeAccessException(MemberName.java:889)
at java.base/java.lang.invoke.MethodHandles$Lookup.checkSpecialCaller(MethodHandles.java:3801)
at java.base/java.lang.invoke.MethodHandles$Lookup.unreflectSpecial(MethodHandles.java:3315)
at org.springframework.ai.testcontainers.service.connection.mongo.MongoDbAtlasLocalContainerConnectionDetailsFactory$MongoDbAtlasLocalContainerConnectionDetails.getSslBundle(MongoDbAtlasLocalContainerConnectionDetailsFactory.java:88)
Comment From: quaff
Sorry, It should be fixed by GH-4175 now.