Failed to read candidate component class

异常原因:使用了jdk1.7.0_51

解决思路:

1.先在Java Compiler中将Compile compliance level设置成1.7
2.将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.ContainerBase StartChild.call(ContainerBase.java:1403)atorg.apache.catalina.core.ContainerBase StartChild.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

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值