gpt4 book ai didi

java - 类中非 native 或抽象方法中缺少代码属性

转载 作者:行者123 更新时间:2023-12-01 12:31:59 25 4
gpt4 key购买 nike

我有一个 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>

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

最佳答案

我相信 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.

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

关于java - 类中非 native 或抽象方法中缺少代码属性,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25863000/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com