본문 바로가기
자바(Java)/Java errors

java.lang.ClassFormatError: Truncated class file

by SSaMKJ 2013. 6. 26.

java.lang.ClassFormatError: Truncated class file


jsp파일을 호출하는데, 저런 에러가 났다.


class가 깨졌다는 소리같은데, 원인을 파악해보니


jsp파일이 java 파일로 변환되고, java 파일이 class 파일로 컴파일이 되어야 했는데, class 파일이 만들어질 때 어떠한 에러가 나서 크기가 0kb가 되었던 것이다.


해당 class 파일을 지우고 다시 시작하니 에러가 없이 잘 되었다.



2013-06-26 10:23:47 DEBUG [org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1172)]     - Rendering view [org.springframework.web.servlet.view.JstlView: name '/--삭제--/'; URL [/WEB-INF/jsp//--삭제--/.jsp]] in DispatcherServlet with name 'dispatcher'

2013-06-26 10:23:47 ERROR [org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:691)]     - 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:620)

at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)

at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)

at java.net.URLClassLoader.access$100(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:131)

at org.apache.jasper.servlet.JasperLoader.loadClass(JasperLoader.java:63)

at org.apache.jasper.JspCompilationContext.load(JspCompilationContext.java:597)

at org.apache.jasper.servlet.JspServletWrapper.getServlet(JspServletWrapper.java:143)

at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:323)

at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:308)

at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:259)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

at org.apache.catalina.core.ApplicationDispatcher.invoke(ApplicationDispatcher.java:659)

at org.apache.catalina.core.ApplicationDispatcher.processRequest(ApplicationDispatcher.java:457)

at org.apache.catalina.core.ApplicationDispatcher.doForward(ApplicationDispatcher.java:395)

at org.apache.catalina.core.ApplicationDispatcher.forward(ApplicationDispatcher.java:311)

at org.springframework.web.servlet.view.InternalResourceView.renderMergedOutputModel(InternalResourceView.java:240)

at org.springframework.web.servlet.view.AbstractView.render(AbstractView.java:258)

at org.springframework.web.servlet.DispatcherServlet.render(DispatcherServlet.java:1174)

at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:901)

at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)

/--삭제--/

at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)

at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:647)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:729)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:269)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)

at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:215)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:188)

at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)

at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:172)

at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:117)

at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:108)

at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:174)

at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:881)

at org.apache.coyote.http11.Http11BaseProtocol$Http11ConnectionHandler.processConnection(Http11BaseProtocol.java:674)

at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:541)

at org.apache.tomcat.util.net.LeaderFollowerWorkerThread.runIt(LeaderFollowerWorkerThread.java:81)

at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:689)

at java.lang.Thread.run(Thread.java:595)


댓글