You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I tried to upgrade my micronaut mongo example to 4.0 and use test-resouce instead of test containers.
Failed when running tests.
Actual Behaviour
Error instantiating bean of type [com.mongodb.MongoClientSettings]
Message: Could not resolve placeholder ${auto.test.resources.mongodb.uri}
Path Taken: new DefaultMongoRepositoryOperations(String serverName,BeanContext beanContext,DateTimeProvider dateTimeProvider,RuntimeEntityRegistry runtimeEntityRegistry,DataConversionService conversionService,AttributeConverterRegistry attributeConverterRegistry,MongoClient mongoClient,MongoCollectionNameProvider collectionNameProvider,ExecutorService executorService) --> new DefaultMongoRepositoryOperations(String serverName,BeanContext beanContext,DateTimeProvider dateTimeProvider,RuntimeEntityRegistry runtimeEntityRegistry,DataConversionService conversionService,AttributeConverterRegistry attributeConverterRegistry,[MongoClient mongoClient],MongoCollectionNameProvider collectionNameProvider,ExecutorService executorService) --> DefaultMongoClientFactory.mongoClient([MongoClientSettings settings]) --> DefaultMongoClientSettingsFactory.mongoClientSettings([DefaultMongoConfiguration mongoConfiguration])
io.micronaut.context.exceptions.BeanInstantiationException: Error instantiating bean of type [com.mongodb.MongoClientSettings]
Message: Could not resolve placeholder ${auto.test.resources.mongodb.uri}
Path Taken: new DefaultMongoRepositoryOperations(String serverName,BeanContext beanContext,DateTimeProvider dateTimeProvider,RuntimeEntityRegistry runtimeEntityRegistry,DataConversionService conversionService,AttributeConverterRegistry attributeConverterRegistry,MongoClient mongoClient,MongoCollectionNameProvider collectionNameProvider,ExecutorService executorService) --> new DefaultMongoRepositoryOperations(String serverName,BeanContext beanContext,DateTimeProvider dateTimeProvider,RuntimeEntityRegistry runtimeEntityRegistry,DataConversionService conversionService,AttributeConverterRegistry attributeConverterRegistry,[MongoClient mongoClient],MongoCollectionNameProvider collectionNameProvider,ExecutorService executorService) --> DefaultMongoClientFactory.mongoClient([MongoClientSettings settings]) --> DefaultMongoClientSettingsFactory.mongoClientSettings([DefaultMongoConfiguration mongoConfiguration])
at app//io.micronaut.context.DefaultBeanContext.resolveByBeanFactory(DefaultBeanContext.java:2322)
at app//io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2277)
at app//io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2289)
at app//io.micronaut.context.DefaultBeanContext.createRegistration(DefaultBeanContext.java:3056)
at app//io.micronaut.context.SingletonScope.getOrCreate(SingletonScope.java:81)
at app//io.micronaut.context.DefaultBeanContext.findOrCreateSingletonBeanRegistration(DefaultBeanContext.java:2958)
at app//io.micronaut.context.DefaultBeanContext.resolveBeanRegistration(DefaultBeanContext.java:2919)
at app//io.micronaut.context.DefaultBeanContext.resolveBeanRegistration(DefaultBeanContext.java:2730)
at app//io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:1693)
at app//io.micronaut.context.AbstractBeanResolutionContext.getBean(AbstractBeanResolutionContext.java:89)
at app//io.micronaut.context.AbstractInitializableBeanDefinition.resolveBean(AbstractInitializableBeanDefinition.java:2164)
at app//io.micronaut.context.AbstractInitializableBeanDefinition.getBeanForConstructorArgument(AbstractInitializableBeanDefinition.java:1326)
at app//io.micronaut.context.DefaultBeanContext.resolveByBeanFactory(DefaultBeanContext.java:2307)
at app//io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2277)
at app//io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2289)
at app//io.micronaut.context.DefaultBeanContext.createRegistration(DefaultBeanContext.java:3056)
at app//io.micronaut.context.SingletonScope.getOrCreate(SingletonScope.java:81)
at app//io.micronaut.context.DefaultBeanContext.findOrCreateSingletonBeanRegistration(DefaultBeanContext.java:2958)
at app//io.micronaut.context.DefaultBeanContext.resolveBeanRegistration(DefaultBeanContext.java:2919)
at app//io.micronaut.context.DefaultBeanContext.resolveBeanRegistration(DefaultBeanContext.java:2730)
at app//io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:1693)
at app//io.micronaut.context.AbstractBeanResolutionContext.getBean(AbstractBeanResolutionContext.java:89)
at app//io.micronaut.context.AbstractInitializableBeanDefinition.resolveBean(AbstractInitializableBeanDefinition.java:2164)
at app//io.micronaut.context.AbstractInitializableBeanDefinition.getBeanForConstructorArgument(AbstractInitializableBeanDefinition.java:1326)
at app//io.micronaut.context.DefaultBeanContext.resolveByBeanFactory(DefaultBeanContext.java:2307)
at app//io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2277)
at app//io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2289)
at app//io.micronaut.context.DefaultBeanContext.createRegistration(DefaultBeanContext.java:3056)
at app//io.micronaut.context.SingletonScope.getOrCreate(SingletonScope.java:81)
at app//io.micronaut.context.DefaultBeanContext.findOrCreateSingletonBeanRegistration(DefaultBeanContext.java:2958)
at app//io.micronaut.context.DefaultBeanContext.resolveBeanRegistration(DefaultBeanContext.java:2919)
at app//io.micronaut.context.DefaultBeanContext.resolveBeanRegistration(DefaultBeanContext.java:2730)
at app//io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:1693)
at app//io.micronaut.context.AbstractBeanResolutionContext.getBean(AbstractBeanResolutionContext.java:89)
at app//io.micronaut.context.AbstractInitializableBeanDefinition.resolveBean(AbstractInitializableBeanDefinition.java:2164)
at app//io.micronaut.context.AbstractInitializableBeanDefinition.getBeanForConstructorArgument(AbstractInitializableBeanDefinition.java:1326)
at app//io.micronaut.context.AbstractInitializableBeanDefinition.instantiate(AbstractInitializableBeanDefinition.java:772)
at app//io.micronaut.context.BeanDefinitionDelegate.instantiate(BeanDefinitionDelegate.java:156)
at app//io.micronaut.context.DefaultBeanContext.resolveByBeanFactory(DefaultBeanContext.java:2307)
at app//io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2277)
at app//io.micronaut.context.DefaultBeanContext.doCreateBean(DefaultBeanContext.java:2289)
at app//io.micronaut.context.DefaultBeanContext.createRegistration(DefaultBeanContext.java:3056)
at app//io.micronaut.context.SingletonScope.getOrCreate(SingletonScope.java:81)
at app//io.micronaut.context.DefaultBeanContext.findOrCreateSingletonBeanRegistration(DefaultBeanContext.java:2958)
at app//io.micronaut.context.DefaultBeanContext.resolveBeanRegistration(DefaultBeanContext.java:2919)
at app//io.micronaut.context.DefaultBeanContext.resolveBeanRegistration(DefaultBeanContext.java:2730)
at app//io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:1693)
at app//io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:840)
at app//io.micronaut.context.DefaultBeanContext.getBean(DefaultBeanContext.java:832)
at app//io.micronaut.data.runtime.operations.DefaultRepositoryOperationsRegistry.provide(DefaultRepositoryOperationsRegistry.java:53)
at app//io.micronaut.data.runtime.intercept.DataInterceptorResolver.findInterceptor(DataInterceptorResolver.java:113)
at app//io.micronaut.data.runtime.intercept.DataInterceptorResolver.lambda$resolve$2(DataInterceptorResolver.java:94)
at [email protected]/java.util.concurrent.ConcurrentHashMap.computeIfAbsent(ConcurrentHashMap.java:1708)
at app//io.micronaut.data.runtime.intercept.DataInterceptorResolver.resolve(DataInterceptorResolver.java:73)
at app//io.micronaut.data.runtime.intercept.DataIntroductionAdvice.intercept(DataIntroductionAdvice.java:80)
at app//io.micronaut.aop.chain.MethodInterceptorChain.proceed(MethodInterceptorChain.java:137)
at app//com.example.CustomerRepositorySpec.setup(CustomerRepositorySpec.groovy:41)
Caused by: io.micronaut.context.exceptions.ConfigurationException: Could not resolve placeholder ${auto.test.resources.mongodb.uri}
at app//io.micronaut.context.env.DefaultPropertyPlaceholderResolver$PlaceholderSegment.getValue(DefaultPropertyPlaceholderResolver.java:310)
at app//io.micronaut.context.env.DefaultPropertyPlaceholderResolver.resolveRequiredPlaceholdersObject(DefaultPropertyPlaceholderResolver.java:111)
at app//io.micronaut.context.env.PropertySourcePropertyResolver.resolvePlaceHoldersIfNecessary(PropertySourcePropertyResolver.java:799)
at app//io.micronaut.context.env.PropertySourcePropertyResolver.getProperty(PropertySourcePropertyResolver.java:393)
at app//io.micronaut.context.DefaultApplicationContext.getProperty(DefaultApplicationContext.java:219)
at app//io.micronaut.context.AbstractInitializableBeanDefinition.resolvePropertyValue(AbstractInitializableBeanDefinition.java:2107)
at app//io.micronaut.context.AbstractInitializableBeanDefinition.getPropertyValueForSetter(AbstractInitializableBeanDefinition.java:1074)
at app//io.micronaut.context.DefaultBeanContext.resolveByBeanFactory(DefaultBeanContext.java:2307)
... 56 more
I just checked your branch, re-applied the test resources plugin which was commented out, removed the test containers dependencies, and removed the hardcoded URL in the application.yml property and it seems to work properly. I have a test failing which seems unrelated to test-resources:
Expected Behavior
I tried to upgrade my micronaut mongo example to 4.0 and use test-resouce instead of test containers.
Failed when running tests.
Actual Behaviour
Steps To Reproduce
No response
Environment Information
Windows 10 Pro, Java 17
Example Application
https://github.com/hantsy/micronaut-sandbox/tree/master/data-mongodb-groovy
Version
4.0.0-M3
The text was updated successfully, but these errors were encountered: