grails / gorm-mongodb

GORM for MongoDB
Apache License 2.0
69 stars 31 forks source link

Grails 4.1.0 - "IllegalArgumentException: keyVaultNamespace can not be null" thrown on startup #521

Open ilPittiz opened 2 years ago

ilPittiz commented 2 years ago

Upgrading from Grails 4.0.x to 4.1.0, without changing GORM version (7.0.2), an IllegalArgumentException thrown at boot time. The exception is non-blocking, and the web-app starts successfully.

Here's the stacktrace:

java.lang.reflect.InvocationTargetException: null
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.grails.datastore.mapping.config.ConfigurationBuilder.buildRecurse(ConfigurationBuilder.groovy:202)
    at org.grails.datastore.mapping.config.ConfigurationBuilder.buildRecurse(ConfigurationBuilder.groovy:227)
    at org.grails.datastore.mapping.config.ConfigurationBuilder.buildInternal(ConfigurationBuilder.groovy:111)
    at org.grails.datastore.mapping.config.ConfigurationBuilder.build(ConfigurationBuilder.groovy:92)
    at org.grails.datastore.mapping.mongo.connections.MongoConnectionSourceFactory.buildSettings(MongoConnectionSourceFactory.groovy:54)
    at org.grails.datastore.mapping.mongo.connections.MongoConnectionSourceFactory.buildSettings(MongoConnectionSourceFactory.groovy)
    at org.grails.datastore.mapping.core.connections.AbstractConnectionSourceFactory.create(AbstractConnectionSourceFactory.java:63)
    at org.grails.datastore.mapping.core.connections.AbstractConnectionSourceFactory.create(AbstractConnectionSourceFactory.java:52)
    at org.grails.datastore.mapping.core.connections.ConnectionSourcesInitializer.create(ConnectionSourcesInitializer.groovy:24)
    at org.grails.datastore.mapping.mongo.MongoDatastore.<init>(MongoDatastore.java:359)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
    at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:207)
    at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:117)
    [...]
    at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:207)
    at org.springframework.context.support.PostProcessorRegistrationDelegate.registerBeanPostProcessors(PostProcessorRegistrationDelegate.java:229)
    at org.springframework.context.support.AbstractApplicationContext.registerBeanPostProcessors(AbstractApplicationContext.java:723)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:536)
    at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:141)
    at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747)
    at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:405)
    at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:99)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:485)
    at grails.boot.GrailsApp.run(GrailsApp.groovy:472)
    at grails.boot.GrailsApp$run.call(Unknown Source)
    at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:115)
    at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:135)
    at com.usablenet.utest.backend.Application.main(Application.groovy:37)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.base/java.lang.reflect.Method.invoke(Method.java:566)
    at org.springframework.boot.devtools.restart.RestartLauncher.run(RestartLauncher.java:49)
Caused by: java.lang.IllegalArgumentException: keyVaultNamespace can not be null
    at com.mongodb.assertions.Assertions.notNull(Assertions.java:37)
    at com.mongodb.AutoEncryptionSettings.<init>(AutoEncryptionSettings.java:300)
    at com.mongodb.AutoEncryptionSettings.<init>(AutoEncryptionSettings.java:62)
    at com.mongodb.AutoEncryptionSettings$Builder.build(AutoEncryptionSettings.java:162)
    ... 76 common frames omitted

Sample application

https://github.com/ilPittiz/GORM_MongoDB_keyVaultNamespace

Environment

chka commented 2 years ago

Same here, MacOS 10.15.7