简体   繁体   中英

General error during conversion: java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/commons/ApplicationAttributes

I am getting the following exception while running grails. Recently i have upgraded grails from version 2.x to 3.3.6. Please let me know what i am missing. Thanks General error during conversion: java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/commons/ApplicationAttributes

java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/codehaus/groovy/grails/commons/ApplicationAttributes at org.codehaus.groovy.control.CompilationUnit.convertUncaughtExceptionToCompilationError(CompilationUnit.java:1123) at org.codehaus.groovy.control.CompilationUnit.applyToPrimaryClassNodes(CompilationUnit.java:1101) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:624) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:602) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:579) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:558) at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:174) at org.gradle.api.internal.tasks.compile.ApiGroovyCompiler.execute(ApiGroovyCompiler.java:56) at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerWorkerAdapter.execute(AbstractDaemonCompiler.java:7 3) at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerWorkerAdapter.execute(AbstractDaemonCompiler.java:64) at org.gradle.workers.internal.WorkerDaemonServer.execute(WorkerDaemonServer.java:29) at org.gradle.api.internal.tasks.compile.daemon.AbstractDaemonCompiler$CompilerDaemonServer.execute(AbstractDaemonCompiler.java:91) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:498)

This class was moved to grails.core.ApplicationContext , if it is in your code, so please update it to the new package. If it in the plugin seems that you need to update version or remove it(or you can upgrade it to grails 3 used docs)

This bug during the groovy compilation process ie

General error during instruction selection: java.lang.NoClassDefFoundError:

could happen due to 3-4 things

  1. A specific module that has the required dependency was not declared.
  2. The dependency was declared but could have been declared with "implementation" in the build.gradle file rather than "api".
  3. The dependency was declared but the compilation process may have gotten confused due to a mix of "compile" and "implementation" dependencies being simultaneously present on the compile classpath. It would be better to move all of them to the new gradle style and avoid 'compile' and 'testCompile' dependencies.
  4. The compilation process has gotten confused due to some classes (of another module) being compiled with one version of a jar and some other classes being compiled with a more recent version. The best way would be to do a proper clean build of all modules.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM