我正在将我的项目从 grails 3 迁移到 grails 4。在进行引导运行时,我遇到以下错误:不确定它是否是一些已弃用的导入或方法实例化
该错误还指出了包含此行的文件:
def restBuilder = new RestBuilder() // import grails.plugins.rest.client.RestBuilder
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.abc.AuditService]: Constructor threw exception;
nested exception is java.lang.NoClassDefFoundError: org/grails/core/cfg/DeprecatedGrailsConfig
at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:184)
at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1294)
... 77 common frames omitted
Caused by: java.lang.NoClassDefFoundError: org/grails/core/cfg/DeprecatedGrailsConfig
at org.grails.web.converters.configuration.ConvertersConfigurationInitializer.initJSONConfiguration(ConvertersConfigurationInitializer.java:82)
at org.grails.web.converters.configuration.ConvertersConfigurationInitializer.initialize(ConvertersConfigurationInitializer.java:64)
at grails.plugins.rest.client.RestBuilder.<init>(RestBuilder.groovy:58)
at grails.plugins.rest.client.RestBuilder.<init>(RestBuilder.groovy)
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.codehaus.groovy.reflection.CachedConstructor.invoke(CachedConstructor.java:80)
at org.codehaus.groovy.runtime.callsite.ConstructorSite$ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java:105)
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:59)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:237)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:241)
at org.abc.AuditService.<init>(AuditService.groovy:20)
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:172)
... 79 common frames omitted
Caused by: java.lang.ClassNotFoundException: org.grails.core.cfg.DeprecatedGrailsConfig
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:522)
... 98 common frames omitted