现在的位置: 首页 > 综合 > 正文

常见异常续一

2018年01月23日 ⁄ 综合 ⁄ 共 2993字 ⁄ 字号 评论关闭

异常:org.springframework.beans.factory.parsing.BeanDefinitionParsingException: Configuration problem: Failed to  import bean definitions from relative location [applicationContext-cxf.xml]
Offending resource: URL

; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL ; nested exception is org.springframework.beans.FatalBeanException: Invalid NamespaceHandler class [org.apache.cxf.jaxws.spring.NamespaceHandler] for namespace [http://cxf.apache.org/jaxws]: problem with handler class file or dependent class; nested exception is java.lang.NoClassDefFoundError: javax/xml/stream/XMLStreamWriter
 at org.springframework.beans.factory.parsing.FailFastProblemReporter.error(FailFastProblemReporter.java:68)
 at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:85)
 at org.springframework.beans.factory.parsing.ReaderContext.error(ReaderContext.java:76)
解决方法:出现该错误是jdk的编译环境出现问题,有2中解决办法
1.window——>preferences------>myeclipse------>servers----->Tomcat----->tomcat6.x----->jdk添加com.sun.java.jdk.win32.x86_1.6.0.013即可,注意:该方法与你安装的编译环境有关系。(myeclipse8.0)
2.添加3个jar包,分别是:geronimo-jaxws_2.1_spec-1.0.jar,ojdbc14.jar,jaxb-api-2.1.jar(Myeclipse6.0)

异常:信息: Initializing Spring root WebApplicationContext
16:11:31,713 ERROR ContextLoader:204 - Context initialization failed
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.security.providers.dao.DaoAuthenticationProvider': Cannot resolve reference to bean 'DaoAuthenticationService' while setting bean property 'userDetailsService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DaoAuthenticationService' defined in file [D:/software_tool/tomcat/apache-tomcat-6.0.16/apache-tomcat-6.0.16/webapps/IssueWeb/WEB-INF/classes/spring/applicationContext-security.xml]: Instantiation of bean failed; nested exception is java.lang.UnsupportedClassVersionError: Bad version number in .class file
Caused by:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'DaoAuthenticationService' defined in file [D:/software_tool/tomcat/apache-tomcat-6.0.16/apache-tomcat-6.0.16/webapps/IssueWeb/WEB-INF/classes/spring/applicationContext-security.xml]: Instantiation of bean failed; nested exception is java.lang.UnsupportedClassVersionError: Bad version number in .class file
Caused by:
java.lang.UnsupportedClassVersionError: Bad version number in .class file
 at java.lang.ClassLoader.defineClass1(Native Method)
 at java.lang.ClassLoader.defineClass(Unknown Source)
 at java.security.SecureClassLoader.defineClass(Unknown Source)

解决办法:出现该错是编译环境有问题。把jdk换成jdk1.6.0_04就可以了,顺便把编译环境换成6.0或者1.6(window--->preferences---->java---->compoler---compiler compliance levdl:6.0或者1.6)

抱歉!评论已关闭.