编译GWT时出错

时间:2012-02-20 18:08:55

标签: eclipse gwt classformaterror

对我的GWT项目进行一些更改(添加protected-resources)后,我再也无法启动了它。

在尝试使用GWT开发人员插件时,它提供了500。一旦我在另一个项目中遇到类似的错误(类中的LineNumberTable中的无效pc),我解决了将我的Eclipse 3.6 IDE的构建路径顺序中的GWT 2.x设置为顶层库的问题。

20-feb-2012 19:00:33 org.apache.catalina.core.StandardWrapperValve invoke

SEVERE: Servlet.service() for servlet jsp threw exception

java.lang.ClassFormatError: Invalid pc in LineNumberTable in class file org/eclipse/jdt/internal/compiler/lookup/TypeBinding
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    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:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
    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:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at org.eclipse.jdt.internal.compiler.Compiler.<init>(Compiler.java:260)
    at org.eclipse.jdt.internal.compiler.Compiler.<init>(Compiler.java:153)
    at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:349)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:327)
    at org.apache.jasper.compiler.Compiler.compile(Compiler.java:314)
    at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:589)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:317)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:313)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:260)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:558)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
    at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:859)
    at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:579)
    at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1555)
    at java.lang.Thread.run(Thread.java:662)

编辑:classpath

<classpath>
    <classpathentry exported="true" kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER/GWT"/>
    <classpathentry kind="src" path="src"/>
    <classpathentry kind="src" output="test-classes" path="test"/>
    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
    <classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v6.0"/>
    <classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.module.container"/>
    <classpathentry kind="lib" path="C:/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201201120043-rel-r36/gwt-2.4.0/validation-api-1.0.0.GA-sources.jar"/>
    <classpathentry kind="lib" path="C:/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201201120043-rel-r36/gwt-2.4.0/validation-api-1.0.0.GA.jar" sourcepath="C:/eclipse/plugins/com.google.gwt.eclipse.sdkbundle_2.4.0.v201201120043-rel-r36/gwt-2.4.0/validation-api-1.0.0.GA-sources.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/sqljdbc4.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/NeptunoMetascada.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/slf4j-api-1.6.4.jar"/>
    <classpathentry kind="lib" path="WebContent/WEB-INF/lib/slf4j-jdk14-1.6.4.jar"/>
    <classpathentry kind="output" path="WebContent/WEB-INF/classes"/>
</classpath>

1 个答案:

答案 0 :(得分:0)

我不确定这是否会对您的问题有所帮助,但有些事情对我来说很可疑。

首先,我将删除单独的validation-api条目,因为它们无论如何都是GWT容器的一部分。

其次,GWT容器被标记为正在导出,这不是必需的。您需要的只是WEB-INF / lib中的gwt-servlet.jar,它不需要像Web应用程序库中那样单独的类路径条目。

第三,看起来好像缺少了网络应用程序库容器,你明确列出了几个jar:

<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>

如前所述,我不太确定这是否有助于解决您的实际问题 - 对我来说这看起来很奇怪。