org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [C:\Users\86181\Desktop\0390\0390\assmchaoshicangku\out\artifacts\assmchaoshic

错误信息:

- JSR-250 ‘javax.annotation.ManagedBean‘ found and supported for component scanning
    - Context initialization failed
    org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [E:\gold_work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\gold_public\WEB-INF\classes\com\golddashi\base\thirdpay\rongbao\configure\RBService.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn‘t supported yet: file [E:\gold_work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\gold_public\WEB-INF\classes\com\golddashi\base\thirdpay\rongbao\configure\RBService.class]; nested exception is java.lang.IllegalArgumentException
        at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:290)
        at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242)
        at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)
        at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
        at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1438)
        at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)
        at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:185)
        at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)
        at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
        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.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn‘t supported yet: file [E:\gold_work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\gold_public\WEB-INF\classes\com\golddashi\base\thirdpay\rongbao\configure\RBService.class]; nested exception is java.lang.IllegalArgumentException
        at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:56)
        at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
        at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
        at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:266)
        ... 32 more
    Caused by: java.lang.IllegalArgumentException
        at org.springframework.asm.ClassReader.<init>(Unknown Source)
        at org.springframework.asm.ClassReader.<init>(Unknown Source)
        at org.springframework.asm.ClassReader.<init>(Unknown Source)
        at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:53)
        ... 35 more
    十一月 01, 2016 7:55:49 下午 org.apache.catalina.core.StandardContext listenerStart
    严重: Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
    org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [E:\gold_work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\gold_public\WEB-INF\classes\com\golddashi\base\thirdpay\rongbao\configure\RBService.class]; nested exception is org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn‘t supported yet: file [E:\gold_work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\gold_public\WEB-INF\classes\com\golddashi\base\thirdpay\rongbao\configure\RBService.class]; nested exception is java.lang.IllegalArgumentException
        at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:290)
        at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242)
        at org.springframework.context.annotation.ComponentScanBeanDefinitionParser.parse(ComponentScanBeanDefinitionParser.java:84)
        at org.springframework.beans.factory.xml.NamespaceHandlerSupport.parse(NamespaceHandlerSupport.java:73)
        at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1438)
        at org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.parseCustomElement(BeanDefinitionParserDelegate.java:1428)
        at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.parseBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:185)
        at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.doRegisterBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:139)
        at org.springframework.beans.factory.xml.DefaultBeanDefinitionDocumentReader.registerBeanDefinitions(DefaultBeanDefinitionDocumentReader.java:108)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.registerBeanDefinitions(XmlBeanDefinitionReader.java:493)
        at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:390)
        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.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:180)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:125)
        at org.springframework.web.context.support.XmlWebApplicationContext.loadBeanDefinitions(XmlWebApplicationContext.java:94)
        at org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
        at org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:537)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:451)
        at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:389)
        at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:294)
        at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
        at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4994)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5492)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file - probably due to a new Java class file version that isn‘t supported yet: file [E:\gold_work\.metadata\.plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps\gold_public\WEB-INF\classes\com\golddashi\base\thirdpay\rongbao\configure\RBService.class]; nested exception is java.lang.IllegalArgumentException
        at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:56)
        at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
        at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:102)
        at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:266)
        ... 32 more
    Caused by: java.lang.IllegalArgumentException
        at org.springframework.asm.ClassReader.<init>(Unknown Source)
        at org.springframework.asm.ClassReader.<init>(Unknown Source)
        at org.springframework.asm.ClassReader.<init>(Unknown Source)
        at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:53)
        ... 35 more
     
    十一月 01, 2016 7:55:49 下午 org.apache.catalina.core.StandardContext startInternal
    严重: Error listenerStart
    十一月 01, 2016 7:55:49 下午 org.apache.catalina.core.StandardContext startInternal
    严重: Context [/gold_public] startup failed due to previous errors
    十一月 01, 2016 7:55:49 下午 org.apache.catalina.core.ApplicationContext log
    信息: Closing Spring root WebApplicationContext
    - Closing Root WebApplicationContext: startup date [Tue Nov 01 19:55:49 GMT+08:00 2016]; root of context hierarchy
    - Exception thrown from ApplicationListener handling ContextClosedEvent
    java.lang.IllegalStateException: ApplicationEventMulticaster not initialized - call ‘refresh‘ before multicasting events via the context: Root WebApplicationContext: startup date [Tue Nov 01 19:55:49 GMT+08:00 2016]; root of context hierarchy
        at org.springframework.context.support.AbstractApplicationContext.getApplicationEventMulticaster(AbstractApplicationContext.java:347)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:334)
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1049)
        at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
        at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:559)
        at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)
        at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5035)
        at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5687)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    - Exception thrown from LifecycleProcessor on context close
    java.lang.IllegalStateException: LifecycleProcessor not initialized - call ‘refresh‘ before invoking lifecycle methods via the context: Root WebApplicationContext: startup date [Tue Nov 01 19:55:49 GMT+08:00 2016]; root of context hierarchy
        at org.springframework.context.support.AbstractApplicationContext.getLifecycleProcessor(AbstractApplicationContext.java:360)
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1057)
        at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
        at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:559)
        at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)
        at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5035)
        at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5687)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)
    十一月 01, 2016 7:55:49 下午 org.apache.catalina.core.StandardContext listenerStop
    严重: Exception sending context destroyed event to listener instance of class org.springframework.web.context.ContextLoaderListener
    java.lang.IllegalStateException: BeanFactory not initialized or already closed - call ‘refresh‘ before accessing beans via the ApplicationContext
        at org.springframework.context.support.AbstractRefreshableApplicationContext.getBeanFactory(AbstractRefreshableApplicationContext.java:171)
        at org.springframework.context.support.AbstractApplicationContext.destroyBeans(AbstractApplicationContext.java:1090)
        at org.springframework.context.support.AbstractApplicationContext.doClose(AbstractApplicationContext.java:1064)
        at org.springframework.context.support.AbstractApplicationContext.close(AbstractApplicationContext.java:1010)
        at org.springframework.web.context.ContextLoader.closeWebApplicationContext(ContextLoader.java:559)
        at org.springframework.web.context.ContextLoaderListener.contextDestroyed(ContextLoaderListener.java:143)
        at org.apache.catalina.core.StandardContext.listenerStop(StandardContext.java:5035)
        at org.apache.catalina.core.StandardContext.stopInternal(StandardContext.java:5687)
        at org.apache.catalina.util.LifecycleBase.stop(LifecycleBase.java:232)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:160)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1575)
        at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1565)
        at java.util.concurrent.FutureTask.run(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
        at java.lang.Thread.run(Unknown Source)

将spring从3.1升级到3.2启动tomcat出现如上错误,

仔细检查过web.xml中关于spring配置引入,spring-mvc配置引入都没有问题,

以及spring配置文件读取方式,包括监听参数配置也是对的,

关于引入和监听web.xml配置如下:

<context-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>
                classpath:spring/applicationContext-spring-rmi-client.xml,
                classpath:spring/spring-context.xml
            </param-value>
        </context-param>
        <listener>
            <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
        </listener>
        <listener>
            <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class>
        </listener>

换回成3.1又没有问题,换成3.2又不行,查看编译环境用的是1.8,将1.8降为1.7,问题解决,服务启动正常,

也就是说spring 3.2不支持1.8编译环境,解决办法就是降为1.7编译环境

关于编译环境配置如图:

spring官网说了,要使用java8,只支持spring 4.X以上版本,而spring的使用最低java要求java5及以上,

如果出现例外,那就例外说了,比如一开始spring 3.1就可以在java8上编译。
把jdk8换成jdk7就没问题了

原文地址:https://www.cnblogs.com/qianzf/p/12652454.html

时间: 2024-08-09 07:38:02

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [C:\Users\86181\Desktop\0390\0390\assmchaoshicangku\out\artifacts\assmchaoshic的相关文章

org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/lonecloud/tomcat/apache-tomcat-7.0.70 2/webapps/myproject/WEB-INF/classes/cn/lone

解决这个报错的解决办法: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [/Users/lonecloud/tomcat/apache-tomcat-7.0.70 2/webapps/myproject/WEB-INF/classes/cn/lonecloud/dao/Impl/UserDaoImpl.class]; ne

springmvc遇到问题:org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class:

在运行搭建好的springmvc项目时,出现 org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: 出现这个问题是spring版本与java版本的问题. 需要将spring中的所有的jar包更换. 或者把项目中的java版本改成和jar包适合运行的版本 原文地址:https://www.cnblogs.com/huangcan1688/p/

【错误解决】BeanDefinitionStoreException: Failed to read candidate component class: file [mapper.class文件]; nested exception is java.lang.IllegalArgumentException

问题描述: "spring-mybatis整合,使用mapper代理开发,通过MapperScannerConfigurer进行mapper扫描"的练习中,出现异常: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [E:\项目\mybatis_spring\bin\cn\itheima\ssm\mapper\Us

SpringMVC 问题 org.springframework.beans.factory.BeanDefinitionStoreException

HTTP Status 500 – Internal Server Error Type Exception Report Message Servlet.init() for servlet [springmvc] threw exception Description The server encountered an unexpected condition that prevented it from fulfilling the request. Exception javax.ser

org.springframework.beans.factory.BeanDefinitionStoreException异常

1.下面是我遇到的异常信息: 2017-03-25 18:01:11,322 [localhost-startStop-1] [org.springframework.web.context.ContextLoader]-[ERROR] Context initialization failed org.springframework.beans.factory.BeanDefinitionStoreException: Invalid bean definition with name 'da

org.springframework.beans.factory.BeanDefinitionStoreException

1.错误描写叙述 usage: java org.apache.catalina.startup.Catalina [ -config {pathname} ] [ -nonaming ] { -help | start | stop } 2014-7-12 11:48:27 org.apache.catalina.core.AprLifecycleListener init 信息: Loaded APR based Apache Tomcat Native library 1.1.29 usi

SSH集成org.springframework.beans.factory.BeanDefinitionStoreException: IOException

系统环境:JDK8+Eclipse4.4+Tomcat7.x+Spring4.1.3+Hibernate4.3.7+Struts2.3.20,我的配置文件均存放在src目录下. 首先Spring默认配置文件是applicationContext.xml,如果不叫这个名,那就需要额外指定了,指定方式是在web.xml文件中加入: <param-name>contextConfigLocation</param-name>和<param-value>classpath:be

org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL

[报错] org.springframework.beans.factory.BeanDefinitionStoreException: Unexpected exception parsing XML document from URL [file:/F:/MyWorkspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/marbled-cat/WEB-INF/classes/spring-servlet.xm

Spring加载配置文件的几种方法(org.springframework.beans.factory.BeanDefinitionStoreException)

一:Spring中的几种容器都支持使用xml装配bean,包括:XmlBeanFactory ,ClassPathXmlApplicationContext ,FileSystemXmlApplicationContext ,XmlWebApplicationContext 加载这些容器的配置文件的xml有一下几种常见的方法: 1:引用资源用XmlBeanFactory(不能实现多个文件相互引用) Resource resource = new ClassPathResource("appcon