0

After a lot of struggle, I have installed Tomcat8 on my Ubuntu. However it results in the following error when I access

localhost:8080

HOW DO I FIX IT?

Type Exception Report

Message java.lang.ClassFormatError: Truncated class file

Description The server encountered an unexpected condition that prevented it from fulfilling the request.

Exception

javax.servlet.ServletException: java.lang.ClassFormatError: Truncated class file
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:339)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Root Cause

java.lang.ClassFormatError: Truncated class file
    java.lang.ClassLoader.defineClass1(Native Method)
    java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
    java.net.URLClassLoader.access$100(URLClassLoader.java:73)
    java.net.URLClassLoader$1.run(URLClassLoader.java:368)
    java.net.URLClassLoader$1.run(URLClassLoader.java:362)
    java.security.AccessController.doPrivileged(Native Method)
    java.net.URLClassLoader.findClass(URLClassLoader.java:361)
    org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:129)
    org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:60)
    org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:171)
    org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:380)
    org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:386)
    org.apache.jasper.servlet.JspServlet.service(JspServlet.java:330)
    javax.servlet.http.HttpServlet.service(HttpServlet.java:742)
    org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)

Note The full stack trace of the root cause is available in the server logs.
  • Did my answer help at all? Seemed related to your issue – JGlass Jan 25 '18 at 19:59
0

Since I'm too new here to comment and suggest that this is a possible duplicate of another question - you might take a look at this Question and it's answers - looks like a class file is possibly corrupted. Does Tomcat run fine if you dont try and navigate to your application, e.g. can you get to the admin web pages? Have a lok at this - hope it helps Tomcat suddenly throwing a ClassFormatError on startup

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.