1

我正在从 grails 1.3.7 升级到 2.0.1,并且在 Intellij11 中看到错误。compile/run-app 从命令行正常工作并通过 Intellij 运行会产生以下错误。环境:Max OS X 10.6.8、Java 1.6.0_29、IntelliJ11、Grails 2.0.1

BUG! exception in phase 'semantic analysis' in source unit '/Users/swall/.grails/2.0.1/projects/canoe-ux/plugins/resources-1.1.6/src/groovy/org/grails/plugin/resource/ProcessingFilter.groovy' Problem loading class javax.servlet.ServletException
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:847)
    at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:548)
    at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:497)
    at org.jetbrains.groovy.compiler.rt.GroovyCompilerWrapper.compile(GroovyCompilerWrapper.java:43)
    at org.jetbrains.groovy.compiler.rt.GroovycRunner.main(GroovycRunner.java:146)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at com.intellij.rt.execution.CommandLineWrapper.main(CommandLineWrapper.java:75)
Caused by: java.lang.RuntimeException: Problem loading class javax.servlet.ServletException
    at org.jetbrains.groovy.compiler.rt.GroovycRunner$7$1.loadClass(GroovycRunner.java:478)
    at org.codehaus.groovy.control.ResolveVisitor.resolveToClass(ResolveVisitor.java:709)
    at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:275)
    at org.codehaus.groovy.control.ResolveVisitor.resolveFromModule(ResolveVisitor.java:648)
    at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:275)
    at org.codehaus.groovy.control.ResolveVisitor.resolve(ResolveVisitor.java:243)
    at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:227)
    at org.codehaus.groovy.control.ResolveVisitor.resolveOrFail(ResolveVisitor.java:239)
    at org.codehaus.groovy.control.ResolveVisitor.visitConstructorOrMethod(ResolveVisitor.java:167)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitMethod(ClassCodeVisitorSupport.java:123)
    at org.codehaus.groovy.ast.ClassNode.visitContents(ClassNode.java:1056)
    at org.codehaus.groovy.ast.ClassCodeVisitorSupport.visitClass(ClassCodeVisitorSupport.java:50)
    at org.codehaus.groovy.control.ResolveVisitor.visitClass(ResolveVisitor.java:1284)
    at org.codehaus.groovy.control.ResolveVisitor.startResolving(ResolveVisitor.java:148)
    at org.codehaus.groovy.control.CompilationUnit$9.call(CompilationUnit.java:605)
    at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:843)
    ... 9 more
Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/ServletException
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:283)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:58)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:197)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:295)
    at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:696)
    at groovy.lang.GroovyClassLoader.loadClass(GroovyClassLoader.java:564)
    at org.jetbrains.groovy.compiler.rt.GroovycRunner$7$1.loadClass(GroovycRunner.java:472)
    ... 24 more
4

1 回答 1

1

请从 Grails 库中删除 web-api.jar(或类似的 JavaEE)。您使用 IDEA 11 还是 11.0.x?我问是因为 11.0.x 应该自动执行此操作。

于 2012-03-16T19:16:31.403 回答