方法中的Absent Code属性在类中不是本机的或抽象的

时间:2014-09-16 07:31:26

标签: java jsp

我有一个JSP页面

<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<html>
<body>
    <c:forTokens items="Zara,nuha,roshy" delims="," var="name">
    <c:out value="${name}"/><p>
    </c:forTokens>
</body>
</html>

当我尝试启动它时出现错误

HTTP Status 500 - java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/jsp/jstl/core/LoopTagSupport

exception

javax.servlet.ServletException: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/jsp/jstl/core/LoopTagSupport
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:358)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
    servlets.MyServlet.doProcess(MyServlet.java:51)
    servlets.MyServlet.doGet(MyServlet.java:26)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:618)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:725)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

我的许可在另一个项目中展示了所有作品

  

http://maven.apache.org/xsd/maven-4.0.0.xsd">       4.0.0

<groupId>JavaSiteEE</groupId>
<artifactId>JavaSiteEE</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>war</packaging> <dependencies>
<dependency>
    <groupId>javax.servlet</groupId>
    <artifactId>javax.servlet-api</artifactId>
    <version>3.1.0</version>
</dependency>

<dependency>
    <groupId>javaee</groupId>
    <artifactId>javaee-api</artifactId>
    <version>5</version>
</dependency>

<dependency>
    <groupId>mysql</groupId>
    <artifactId>mysql-connector-java</artifactId>
    <version>5.1.17</version>
    <type>jar</type>
    <scope>compile</scope>
</dependency>

<dependency>
    <groupId>jstl</groupId>
    <artifactId>jstl</artifactId>
    <version>1.2</version>
</dependency>

<dependency>
    <groupId>javax</groupId>
    <artifactId>javaee-web-api</artifactId>
    <version>6.0</version>
    <scope>provided</scope>
</dependency>
<dependency>
    <groupId>commons-io</groupId>
    <artifactId>commons-io</artifactId>
    <version>1.4</version>
</dependency>

<dependency>
    <groupId>com.sun.faces</groupId>
    <artifactId>jsf-api</artifactId>
    <version>2.1.13</version>
</dependency> </dependencies> <build>
<plugins>
<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-compiler-plugin</artifactId>
    <configuration>
        <source>1.7</source>
        <target>1.7</target>
    </configuration>
</plugin>

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-war-plugin</artifactId>
    <version>2.1.1</version>
    <configuration>
        <failOnMissingWebXml>false</failOnMissingWebXml>
    </configuration>
</plugin>
</plugins> </build> </project>
     

在另一个项目中,通常会显示完全相同的设置和所有设置

1 个答案:

答案 0 :(得分:1)

我相信Bill Shannon在另一个问题中对此进行了解释:

  

javax:javaee-api仅用于编译,而不是用于编译   反对,包括单元测试。如果你需要适合的课程   为了运行,你真的需要一个完整的Java EE应用程序   服务器

     

另外,请注意每个人 - 没有JEE !!!正确的名称是“Java   EE“。谢谢。

来源:ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/mail/MessagingException