tomcat 启动:java.lang.ClassFormatError: Truncated class file
原创    xingfu2017    发表于:2018-03-22 15:41:45
  阅读 :68   收藏   编辑

tomcat启动出错,异常如下:

java.lang.ClassFormatError: Truncated class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:800)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
        at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1819)
        at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:872)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1327)
        at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
        at org.apache.catalina.startup.WebAnnotationSet.loadClassAnnotation(WebAnnotationSet.java:145)
        at org.apache.catalina.startup.WebAnnotationSet.loadApplicationListenerAnnotations(WebAnnotationSet.java:73)
        at org.apache.catalina.startup.WebAnnotationSet.loadApplicationAnnotations(WebAnnotationSet.java:56)
        at org.apache.catalina.startup.ContextConfig.applicationAnnotationsConfig(ContextConfig.java:297)
        at org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:1064)
        at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:261)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:117)
        at org.apache.catalina.core.StandardContext.start(StandardContext.java:4252)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:525)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:924)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:887)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:492)

class文件损坏,尝试重新编译下,清除下tomcat缓存,另外使用SecureCRT上传文件时:

记得 “upload files as ASCII” 不要勾选!

评论
条评论