maven启动tomcat报错

时间:2022-05-07 15:56:43
2016-10-26 14:46:14 org.apache.catalina.startup.Embedded start
信息: Starting tomcat server
2016-10-26 14:46:14 org.apache.catalina.core.StandardEngine start
信息: Starting Servlet Engine: Apache Tomcat/6.0.29
2016-10-26 14:46:14 org.apache.tomcat.util.modeler.Registry registerComponent
严重: Null component localEngine:type=JspMonitor,name=jsp,WebModule=//localhost/HNUST,J2EEApplication=none,J2EEServer=none
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.194 s
[INFO] Finished at: 2016-10-26T14:46:14+08:00
[INFO] Final Memory: 8M/127M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:run (default-cli) on project HNUST: Execution default-cli of goal org.codehaus.mojo:tomcat-maven-plugin:1.1:run failed: An API incompatibility was encountered while executing org.codehaus.mojo:tomcat-maven-plugin:1.1:run: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/http/HttpServlet
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.codehaus.mojo:tomcat-maven-plugin:1.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/E:/dev_software/repository/org/codehaus/mojo/tomcat-maven-plugin/1.1/tomcat-maven-plugin-1.1.jar
[ERROR] urls[1] = file:/E:/dev_software/repository/org/apache/maven/maven-archiver/2.2/maven-archiver-2.2.jar
[ERROR] urls[2] = file:/E:/dev_software/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
[ERROR] urls[3] = file:/E:/dev_software/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
[ERROR] urls[4] = file:/E:/dev_software/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar
[ERROR] urls[5] = file:/E:/dev_software/repository/org/apache/tomcat/catalina/6.0.29/catalina-6.0.29.jar
[ERROR] urls[6] = file:/E:/dev_software/repository/org/apache/tomcat/juli/6.0.29/juli-6.0.29.jar
[ERROR] urls[7] = file:/E:/dev_software/repository/org/apache/tomcat/annotations-api/6.0.29/annotations-api-6.0.29.jar
[ERROR] urls[8] = file:/E:/dev_software/repository/org/apache/tomcat/catalina-ha/6.0.29/catalina-ha-6.0.29.jar
[ERROR] urls[9] = file:/E:/dev_software/repository/org/apache/tomcat/tribes/6.0.29/tribes-6.0.29.jar
[ERROR] urls[10] = file:/E:/dev_software/repository/org/apache/tomcat/el-api/6.0.29/el-api-6.0.29.jar
[ERROR] urls[11] = file:/E:/dev_software/repository/org/apache/tomcat/jasper/6.0.29/jasper-6.0.29.jar
[ERROR] urls[12] = file:/E:/dev_software/repository/org/apache/tomcat/jasper-el/6.0.29/jasper-el-6.0.29.jar
[ERROR] urls[13] = file:/E:/dev_software/repository/org/apache/tomcat/jasper-jdt/6.0.29/jasper-jdt-6.0.29.jar
[ERROR] urls[14] = file:/E:/dev_software/repository/org/apache/tomcat/jsp-api/6.0.29/jsp-api-6.0.29.jar
[ERROR] urls[15] = file:/E:/dev_software/repository/org/apache/tomcat/servlet-api/6.0.29/servlet-api-6.0.29.jar
[ERROR] urls[16] = file:/E:/dev_software/repository/org/apache/tomcat/coyote/6.0.29/coyote-6.0.29.jar
[ERROR] urls[17] = file:/E:/dev_software/repository/org/apache/tomcat/dbcp/6.0.29/dbcp-6.0.29.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:tomcat-maven-plugin:1.1:run (default-cli) on project HNUST: Execution default-cli of goal org.codehaus.mojo:tomcat-maven-plugin:1.1:run failed: An API incompatibility was encountered while executing org.codehaus.mojo:tomcat-maven-plugin:1.1:run: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/http/HttpServlet
-----------------------------------------------------
realm =    plugin>org.codehaus.mojo:tomcat-maven-plugin:1.1
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/E:/dev_software/repository/org/codehaus/mojo/tomcat-maven-plugin/1.1/tomcat-maven-plugin-1.1.jar
urls[1] = file:/E:/dev_software/repository/org/apache/maven/maven-archiver/2.2/maven-archiver-2.2.jar
urls[2] = file:/E:/dev_software/repository/org/codehaus/plexus/plexus-archiver/1.0-alpha-7/plexus-archiver-1.0-alpha-7.jar
urls[3] = file:/E:/dev_software/repository/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar
urls[4] = file:/E:/dev_software/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar
urls[5] = file:/E:/dev_software/repository/org/apache/tomcat/catalina/6.0.29/catalina-6.0.29.jar
urls[6] = file:/E:/dev_software/repository/org/apache/tomcat/juli/6.0.29/juli-6.0.29.jar
urls[7] = file:/E:/dev_software/repository/org/apache/tomcat/annotations-api/6.0.29/annotations-api-6.0.29.jar
urls[8] = file:/E:/dev_software/repository/org/apache/tomcat/catalina-ha/6.0.29/catalina-ha-6.0.29.jar
urls[9] = file:/E:/dev_software/repository/org/apache/tomcat/tribes/6.0.29/tribes-6.0.29.jar
urls[10] = file:/E:/dev_software/repository/org/apache/tomcat/el-api/6.0.29/el-api-6.0.29.jar
urls[11] = file:/E:/dev_software/repository/org/apache/tomcat/jasper/6.0.29/jasper-6.0.29.jar
urls[12] = file:/E:/dev_software/repository/org/apache/tomcat/jasper-el/6.0.29/jasper-el-6.0.29.jar
urls[13] = file:/E:/dev_software/repository/org/apache/tomcat/jasper-jdt/6.0.29/jasper-jdt-6.0.29.jar
urls[14] = file:/E:/dev_software/repository/org/apache/tomcat/jsp-api/6.0.29/jsp-api-6.0.29.jar
urls[15] = file:/E:/dev_software/repository/org/apache/tomcat/servlet-api/6.0.29/servlet-api-6.0.29.jar
urls[16] = file:/E:/dev_software/repository/org/apache/tomcat/coyote/6.0.29/coyote-6.0.29.jar
urls[17] = file:/E:/dev_software/repository/org/apache/tomcat/dbcp/6.0.29/dbcp-6.0.29.jar
Number of foreign imports: 1
import: Entry[import  from realm ClassRealm[maven.api, parent: null]]


-----------------------------------------------------


at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:224)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
at org.codehaus.classworlds.Launcher.main(Launcher.java:46)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-cli of goal org.codehaus.mojo:tomcat-maven-plugin:1.1:run failed: An API incompatibility was encountered while executing org.codehaus.mojo:tomcat-maven-plugin:1.1:run: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/http/HttpServlet

-----------------------------------------------------

求大神解答一下,找了好久的资料都没有解决问题

网上很多人说是jdk版本的问题,说myeclipse的jdk版本和tomcat的jdk版本不一致,我都试过了,都没有问题啊,启动maven就报错

jdk版本:JDK 1.6.0_13

tomcat6

maven版本:apache-maven-3.2.1