java.lang.ClassFormatError:在类文件中不是本机或抽象的方法中的Absent Code属性javax / servlet / ServletException

时间:2016-12-05 18:53:54

标签: java tomcat

我正在尝试在RedHat Linux上启动Tomcat服务器,我收到此错误:

由以下原因引起的完整堆栈:

java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.apache.catalina.startup.Bootstrap.load(Bootstrap.java:261)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.ClassFormatError: Absent Code attribute in method that is not native or abstract in class file javax/servlet/ServletException
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:412)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at java.lang.Class.getDeclaredMethods0(Native Method)
    at java.lang.Class.privateGetDeclaredMethods(Class.java:2625)
    at java.lang.Class.privateGetPublicMethods(Class.java:2743)
    at java.lang.Class.privateGetPublicMethods(Class.java:2753)
    at java.lang.Class.privateGetPublicMethods(Class.java:2753)
    at java.lang.Class.getMethods(Class.java:1480)
    at org.apache.tomcat.util.IntrospectionUtils.findMethods(IntrospectionUtils.java:841)
    at org.apache.tomcat.util.IntrospectionUtils.setProperty(IntrospectionUtils.java:271)
    at org.apache.tomcat.util.IntrospectionUtils.setProperty(IntrospectionUtils.java:262)
    at org.apache.tomcat.util.digester.SetPropertiesRule.begin(SetPropertiesRule.java:209)
    at org.apache.tomcat.util.digester.Rule.begin(Rule.java:153)
    at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1356)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1363)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2786)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:606)
    at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:510)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:848)
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:777)
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:648)
    at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1642)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:526)
    at org.apache.catalina.startup.Catalina.load(Catalina.java:560)
    ... 6 more

No Maven,没有JEE服务器,只有一个独立的Tomcat。 版本:

apache-tomcat-apis-0.1-1.el6.noarch
java-1.6.0-openjdk 1:1.6.0.35-1.13.7.1.el6_6
java-1.6.0-openjdk-devel 1:1.6.0.35-1.13.7.1.el6_6
java-1.7.0-openjdk 1:1.7.0.85-2.6.1.3.el6_6
java-1.7.0-openjdk-devel 1:1.7.0.85-2.6.1.3.el6_6
tomcat6 6.0.24-83.el6_6
tomcat6-el-2.1-api 6.0.24-83.el6_6
tomcat6-jsp-2.1-api 6.0.24-83.el6_6
tomcat6-lib 6.0.24-83.el6_6
tomcat6-servlet-2.5-api 6.0.24-83.el6_6
tomcat6-webapps 6.0.24-83.el6_6
Kernel=2.6.32-504.54.1.el6.x86_64

1 个答案:

答案 0 :(得分:0)

终于得到了答案。 Origin位于配置文件中,其中CLASSPATH应设置为空值而不是使用系统值。 依赖性是错误的。