简体   繁体   English

java.lang.ClassFormatError:类文件javax / faces / FacesException中不是本机或抽象的方法中的缺少Code属性

[英]java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/FacesException

I am trying to run JSF project with tomcat and eclipse. 我试图用tomcat和eclipse运行JSF项目。

I have just implemented simple page with HelloWorld. 我刚刚用HelloWorld实现了简单的页面。 When I try to start server its throwing following error: 当我尝试启动服务器时,抛出以下错误:

SEVERE: Error configuring application listener of class org.apache.catalina.deploy.ApplicationListener@2fbb7466
java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/faces/FacesException
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:792)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2895)
    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2483)
    at java.lang.Class.getConstructor0(Class.java:2793)
    at java.lang.Class.newInstance(Class.java:345)
    at org.apache.catalina.core.DefaultInstanceManager.newInstance(DefaultInstanceManager.java:138)
    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4854)
    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5434)
    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
    at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
    at java.lang.Thread.run(Thread.java:724)

I have included following libraries in classpath: 我在类路径中包含以下库:

  • javae-api-6.0.jar javae-API-6.0.jar
  • javae-web-api-6.0.jar javae-Web的API-6.0.jar
  • javax-servlet-api-3.1.0.jar 使用javax,servlet的API-3.1.0.jar
  • jsf-api-2.1.jar JSF的API-2.1.jar
  • jsf-impl-1.2.jar JSF的IMPL-1.2.jar
  • jstl-1.2.jar JSTL-1.2.jar
  • primefaces-5.0.jar primefaces-5.0.jar

Please help me to solve this error. 请帮助我解决此错误。

After some analysis, I found that I have added libraries from wrong place. 经过分析,我发现我从错误的位置添加了库。 I have also removed extra libraries from build path. 我还从构建路径中删除了额外的库。

Following is the final list of dependency and it worked for me: 以下是最终的依赖关系列表,它对我有用:

<dependencies>
<dependency>
    <groupId>com.sun.faces</groupId>
    <artifactId>jsf-api</artifactId>
    <version>2.2.7</version>
</dependency>

<dependency>
    <groupId>com.sun.faces</groupId>
    <artifactId>jsf-impl</artifactId>
    <version>2.2.7</version>
</dependency>

<dependency>
    <groupId>org.primefaces</groupId>
    <artifactId>primefaces</artifactId>
    <version>5.0</version>
</dependency>

Thanks. 谢谢。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 java.lang.ClassFormatError:在类文件 javax/mail/MessagingException 中非本机或抽象的方法中缺少代码属性 - java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException java.lang.ClassFormatError:类文件javax / mail / internet / ParseException中不是本机或抽象的方法中的缺少Code属性 - java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/internet/ParseException java.lang.ClassFormatError:在类文件“类名”中非本机或抽象的方法中缺少代码属性 - java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file “name of class” ClassFormatError:在类文件 javax/mail/MessagingException 中非本机或抽象的方法中缺少代码属性 - ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException 在类文件javax / faces / webapp / FacesServlet中的非本机或抽象方法中的Absent Code属性 - Absent Code attribute in method that is not native or abstract in class file javax/faces/webapp/FacesServlet 线程“ main”中的异常java.lang.ClassFormatError:缺少代码属性 - Exception in thread “main” java.lang.ClassFormatError: Absent Code attribute java.lang.ClassFormatError:JVMCFRE074没有指定代码属性; class = javax / ejb / RemoveException,method = <init> ()V,pc = 0 - java.lang.ClassFormatError: JVMCFRE074 no Code attribute specified; class=javax/ejb/RemoveException, method=<init>()V, pc=0 Java EE 6中类文件javax / mail / MessagingException中不是本机或抽象的方法中的缺少Code属性 - Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException in Java EE 6 java.lang.ClassFormatError:类文件中无效的方法代码长度75567 - java.lang.ClassFormatError: Invalid method Code length 75567 in class file 方法中的Absent Code属性在类文件javax / servlet / ServletException中不是本机的或抽象的 - Absent Code attribute in method that is not native or abstract in class file javax/servlet/ServletException
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM