• java.lang.ClassFormatError: Truncated class file


    今天更新了一些程序,打包部署都主机上就报错了:

    java.lang.ClassFormatError: Truncated class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
        at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
        at org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:618)
        at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.yc.base.filter.LoginFilter.doFilter(LoginFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        at java.lang.Thread.run(Thread.java:619)
    2013-4-21 0:44:48 org.apache.catalina.core.StandardWrapperValve invoke
    严重: Servlet.service() for servlet jsp threw exception
    java.lang.ClassFormatError: Truncated class file
        at java.lang.ClassLoader.defineClass1(Native Method)
        at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
        at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
        at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
        at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
        at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:134)
        at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:66)
        at org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:618)
        at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:144)
        at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:329)
        at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:342)
        at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:267)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at com.yc.base.filter.LoginFilter.doFilter(LoginFilter.java:52)
        at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
        at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
        at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
        at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
        at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
        at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
        at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
        at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
        at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
        at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
        at java.lang.Thread.run(Thread.java:619)

    从未见过的错误,百度查询后,分析是class文件已损坏,重新打包上传,依然报错。

    继续分析日志,发现自己在程序中写的log日志,有打印信息,表示数据库已经开始访问,程序已经启动,后台进程也启动了,这样应该不是上传jar包的问题。

    tomcat服务器有工作缓存,猜测可能是存有的缓存造成的问题。

    于是请主机维护人员清理了work下的缓存文件,程序OK了。

  • 相关阅读:
    登陆中发现css页面不见了,变成了光秃秃的输入框问题
    servlet基础一
    解决问题:Error:(5, 59) java: 程序包javax.servlet.http不存在
    静态方法的引用
    登录功能之添加验证码(包含切换验证码)
    生成图片验证码(VerifyCode)
    idea编辑器中批量完成注释及批量取消注释
    jdbc连接测试
    利用IO流复制图片
    js 判空
  • 原文地址:https://www.cnblogs.com/yangchengInfo/p/3033518.html
Copyright © 2020-2023  润新知