我遇到了一個與我的項目有關的問題,經過一些測試後,我認爲它沒有與源相關。即使回到之前的工作版本,我仍然會在嘗試部署到Tomcat時發生錯誤。Tomcat在啓動時突然拋出一個ClassFormatError
錯誤是由java.lang.ClassFormatError
造成的org.springframework.beans.factory.BeanDefinitionStoreException
與消息截斷的類文件。
我已經開始通過從等式中刪除Eclipse來縮小問題的範圍,但即使使用maven命令行構建並直接部署到我的tomcat實例,我仍然會遇到同樣的問題。谷歌搜索錯誤提出了人們建議清除tomcat工作和臨時目錄,我沒有運氣。
我知道這不是很多信息,但假設問題不在我的代碼中,哪些更改爲我的系統可能會導致此問題突然顯現?
堆棧跟蹤
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from class path resource [beans.xml]; nested exception is java.lang.ClassFormatError: Truncated class file
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:174)
at org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:209)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.importBeanDefinitionResource(DefaultBeanDefinitionDocumentReader.java:239)
... 54 more
Caused by: java.lang.ClassFormatError: Truncated class file
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClassCond(ClassLoader.java:631)
at java.lang.ClassLoader.defineClass(ClassLoader.java:615)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:1847)
at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:890)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1354)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1233)
at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.loadClass(XBeanQNameHelper.java:102)
at org.apache.xbean.spring.context.v2c.XBeanQNameHelper.getBeanInfo(XBeanQNameHelper.java:72)
at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.getPropertyDescriptor(XBeanNamespaceHandler.java:581)
at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.addAttributeProperties(XBeanNamespaceHandler.java:333)
at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:225)
at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parseBeanFromExtensionElement(XBeanNamespaceHandler.java:276)
at org.apache.xbean.spring.context.v2c.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:156)
at org.apache.xbean.spring.context.v2.XBeanNamespaceHandler.parse(XBeanNamespaceHandler.java:49)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1419)
at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1409)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:184)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:140)
at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:111)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
... 59 more
你可以發佈堆棧跟蹤 – Sean 2012-02-19 05:27:59