0

I have a JSP page

<%@ 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>

when I try to start it I there is an error

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)

my permission exhibited in another project in which all the works

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>

in another project the exact same settings and all is normally displayed

IP696
  • 181
  • 1
  • 2
  • 11

1 Answers1

1

I believe this is explained in a different question by Bill Shannon:

The javax:javaee-api is only intended for compiling against, not for running against, including unit tests. If you need classes suitable for running against, you really need a full Java EE application server.

Also, note to everyone - THERE IS NO JEE!!! The correct name is "Java EE". Thanks.

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

Community
  • 1
  • 1
mkobit
  • 43,979
  • 12
  • 156
  • 150