BeanDefinitionStoreException: Failed to read candidate component class
ssm 整合时出现问题
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class
解决方案
JDK版本太高(我用的1.8),与3.2版本的spring框架冲突。
将jdk版本改为1.7 成功解决问题。
报错信息如下
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [Z:\nanshao\Eclipse\ESpring\bin\top\nanshaobit\ssm\mapper\UserMapper.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.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:83)
at top.nanshaobit.ssm.mapper.UserMapperTest.setUp(UserMapperTest.java:16)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:69)
at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:48)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)
at org.junit.runners.ParentRunner.run(ParentRunner.java:292)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
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: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)
... 32 more
BeanDefinitionStoreException: Failed to read candidate component class的更多相关文章
- 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 candidat ...
- BeanDefinitionStoreException: Failed to read candidate component class: URL
如题,遇到这种情况一般都是引用jar包版本不一致或者编译后的class除了问题 解决办法: a.如果是maven项目,把项目全部clean一下,重新mvn install b.如果不是maven项目, ...
- org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component
原因:jdk1.8和你所用框架(spring+springMVC+mybatis)中spring框架的版本有问题, 解决方法:更换jdk1.7或者1.6
- spring3.2.0与mybatis3.2.7整合出错--Failed to read candidate component class--nested exception is java.lang.IllegalArgumentException
错误信息如下: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate com ...
- spring在扫描包中的注解类时出现Failed to read candidate component错误
出现:org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate componen ...
- TestNg和spring3测试报错:Failed to read candidate component class-遁地龙卷风
java.lang.IllegalStateException:Failed to load ApplicationContext Caused by: org.springframework.bea ...
- spring 启动异常Failed to read candidate component class
Exception in thread "main" org.springframework.beans.factory.BeanDefinitionStoreException: ...
- Spring+Mybatis整合时 Failed to read candidate component class,Caused by:IllegalArgumentException
Spring+Mybatis整合时Caused by: java.lang.IllegalArgumentException错误 org.springframework.beans.factory.B ...
- Failed to read candidate component class错误分析
org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component c ...
- SpringMVC错误:Failed to read candidate component class:file... ...
Failed to read candidate component class:file错误分析和处理 org.springframework.beans.factory.BeanDefinitio ...
随机推荐
- 阿里巴巴建议这样遍历Map,今天就用几种方式做个比较一下看那种最好用
今天不举例子了,问一句你开心吗?不开心也要记得把开心的事情放到快乐源泉小瓶子里,偶尔拿出来一一遍历看看. Map在我们Java程序员高频使用的一种数据结构,Map的遍历方式也有很多种,那那种方式比较 ...
- node使用node-xlsx实现excel的下载与导入,保证你看的明明白白
需求简介 很多时候,我们都会有这样一个业务. 将列表中的数据导出为excel. 这样做的目的是为了方便查看,同时可以保存在本地归档. 还可以将导出的Excel后的数据进行加工. node-xlsx 的 ...
- HOOPS Exchange助力Shapr3D产品实现了“无障碍的用户体验”
HOOPS SDK是用于3D工业软件开发的工具包,其中包括4款工具,分别是用于 读取和写入30多种CAD文件格式的HOOPS Exchange.专注于Web端工程图形渲染的HOOPS Communic ...
- pandas技巧
1. 计算月初.2022-05-03 得到2022-05-01 df['month']=df['purchase_date'].apply(lambda x : x.replace(day=1))
- Java并发(二)----初次使用多线程并行提高效率
1.并行 并行代表充分利用多核 cpu 的优势,提高运行效率. 想象下面的场景,执行 3 个计算,最后将计算结果汇总. 计算 1 花费 10 ms 计算 2 花费 11 ms 计算 3 花费 ...
- 两分钟操作完成用VScode连接MySQL查询数据
第一步:下载一个插件,MySQL Syntax 安装后要是重启或刷新后没有出现 再安装一个MySQL 第二步:下载vscode-database 第三步:把需要的插件下载好后,接下来就开始操作 输入 ...
- Spring的Factories机制介绍
Java 的 SPI 机制 Java SpringBoot 加载 yml 配置文件中字典项 Spring的Factories就是Spring版本的Java Spi. Spring Factories的 ...
- mysql+proxysql+replication-manager的主从半同步复制+高可用+读写分离
环境: AlmaLinux release 9.1 MySQL Community Server Ver 8.0.33 Replication Manager v2.2.40 for MariaDB ...
- java RSA生成公钥和私钥
1.随机生成密钥对 /** * 随机生成密钥对 * @throws NoSuchAlgorithmException */ public static void genKeyPair() throws ...
- [aac @ 0x1dd24c0] Input contains NaN/+-Inf
ffmpeg编码pcm为aac时报错:[aac @ 0x1dd24c0] Input contains NaN/+-Inf 在./configure选项后面加上下列选项就可以 --enable-enc ...