Failed to read candidate component class
2016-09-04 13:53
369 查看
异常原因:使用了jdk1.7.0_51
解决思路:
1.先在Java Compiler中将Compile compliance level设置成1.72.将jdk的版本从jdk1.7.0_51升级1.7.0._79以上就可以能正常运行
注意:当我把jdk升级到1.8以上的同时将Compile compliance level设置成1.7还是会报相同的错误
总结:最后找到了其它的资料,个人比较认可的分析原因:
spring3.*不能使用jdk8.0 要保证你的eclipse使用的是1.7,tomcat使用的是1.7
参考原址:http://www.oschina.net/question/2246244_237147?sort=time
九月 04, 2016 12:14:42 下午 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 [D:\apache\apache-tomcat-9.0.0.M9\webapps\springmvc_mybatis0903\WEB-INF\classes\cn\itcast\ssm\mapper\ItemsMapper.class]; nested exception is java.lang.IllegalArgumentException
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:281)
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.doScan(ClassPathBeanDefinitionScanner.java:242)
at org.mybatis.spring.mapper.ClassPathMapperScanner.doScan(ClassPathMapperScanner.java:155)
at org.springframework.context.annotation.ClassPathBeanDefinitionScanner.scan(ClassPathBeanDefinitionScanner.java:220)
at org.mybatis.spring.mapper.MapperScannerConfigurer.postProcessBeanDefinitionRegistry(MapperScannerConfigurer.java:315)
at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:630)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:461)
at org.springframework.web.context.ContextLoader.configureAndRefreshWebApplicationContext(ContextLoader.java:383)
at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:283)
at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:112)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4715)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5177)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:152)
at org.apache.catalina.core.ContainerBaseStartChild.call(ContainerBase.java:1403)atorg.apache.catalina.core.ContainerBaseStartChild.call(ContainerBase.java:1393)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.IllegalArgumentException
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.asm.ClassReader.(Unknown Source)
at org.springframework.core.type.classreading.SimpleMetadataReader.(SimpleMetadataReader.java:52)
at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
at org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider.findCandidateComponents(ClassPathScanningCandidateComponentProvider.java:257)
… 18 more
九月 04, 2016 12:14:42 下午 org.apache.catalina.core.ApplicationContext log
信息: Log4jServletContextListener ensuring that Log4j starts up properly.
九月 04, 2016 12:14:42 下午 org.apache.catalina.core.StandardContext startInternal
严重: One or more listeners failed to start. Full details will be found in the appropriate container log file
九月 04, 2016 12:14:42 下午 org.apache.catalina.util.SessionIdGeneratorBase createSecureRandom
信息: Creation of SecureRandom instance for session ID generation using [SHA1PRNG] took [245] milliseconds.
九月 04, 2016 12:14:42 下午 org.apache.catalina.core.StandardContext startInternal
严重: Context [/springmvc_mybatis0903] startup failed due to previous errors
九月 04, 2016 12:14:42 下午 org.apache.catalina.core.ApplicationContext log
信息: Log4jServletContextListener ensuring that Log4j shuts down properly.
九月 04, 2016 12:14:42 下午 org.apache.catalina.core.ApplicationContext log
信息: Removing LoggerContext for [springmvc_mybatis0903].
九月 04, 2016 12:14:43 下午 org.apache.catalina.core.ApplicationContext log
信息: Closing Spring root WebApplicationContext
九月 04, 2016 12:14:43 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\apache\apache-tomcat-9.0.0.M9\webapps\docs
九月 04, 2016 12:14:43 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\apache\apache-tomcat-9.0.0.M9\webapps\docs has finished in 78 ms
九月 04, 2016 12:14:43 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\apache\apache-tomcat-9.0.0.M9\webapps\examples
九月 04, 2016 12:14:44 下午 org.apache.catalina.core.ApplicationContext log
信息: ContextListener: contextInitialized()
九月 04, 2016 12:14:44 下午 org.apache.catalina.core.ApplicationContext log
信息: SessionListener: contextInitialized()
九月 04, 2016 12:14:44 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\apache\apache-tomcat-9.0.0.M9\webapps\examples has finished in 1,061 ms
九月 04, 2016 12:14:44 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\apache\apache-tomcat-9.0.0.M9\webapps\host-manager
九月 04, 2016 12:14:44 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\apache\apache-tomcat-9.0.0.M9\webapps\host-manager has finished in 69 ms
九月 04, 2016 12:14:44 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\apache\apache-tomcat-9.0.0.M9\webapps\manager
九月 04, 2016 12:14:44 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\apache\apache-tomcat-9.0.0.M9\webapps\manager has finished in 91 ms
九月 04, 2016 12:14:44 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deploying web application directory D:\apache\apache-tomcat-9.0.0.M9\webapps\ROOT
九月 04, 2016 12:14:44 下午 org.apache.catalina.startup.HostConfig deployDirectory
信息: Deployment of web application directory D:\apache\apache-tomcat-9.0.0.M9\webapps\ROOT has finished in 62 ms
九月 04, 2016 12:14:44 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler [http-nio-8080]
九月 04, 2016 12:14:44 下午 org.apache.coyote.AbstractProtocol start
信息: Starting ProtocolHandler [ajp-nio-8009]
九月 04, 2016 12:14:44 下午 org.apache.catalina.startup.Catalina start
信息: Server startup in 8153 ms
相关文章推荐
- Failed to read candidate component class,java.lang.IllegalArgumentException
- Failed to read candidate component class
- Failed to read candidate component class
- Failed to read candidate component class
- 解决:“ Failed to read candidate component class: file”问题
- SSH 整合的时候遇到的问题 Failed to read candidate component class
- Failed to read candidate component class:错误
- maven项目导入:Failed to read candidate component class: file
- Failed to read candidate component class: file [D:\workspace\j2ee\springdemo-forsimple-3\build\class
- java中Failed to read candidate component class的问题解决
- Failed to read candidate component class: URL [];
- Failed to read candidate component class: file [F:\eclipse neon\.metadata\.plugins\org.eclipse.wst.s
- Failed to read candidate component class
- SSH 整合的时候遇到的问题 Failed to read candidate component class
- Failed to read candidate component class: 的解决办法
- spring3.2.0与mybatis3.2.7整合出错--Failed to read candidate component class--nested exception is java.lang.IllegalArgumentException
- Failed to read candidate component class: file 处理
- 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
- Failed to read candidate component class:
- SpringMVC报错: Failed to read candidate component class