TestNg和spring3测试报错:Failed to read candidate component class-遁地龙卷风
java.lang.IllegalStateException:Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException: Failed to read candidate component class: file [E:\Design\Spring3\target\classes\com\spring3\dao\UserDao.class]; nested exception is java.lang.ArrayIndexOutOfBoundsException: 256
Caused by: java.lang.ArrayIndexOutOfBoundsException: 256
这个错误的原因竟然是我在userDao这个类中使用了lamba表达式
public User findUserByName(final String username)
{
String sql = "select user_name,user_id from t_user where username = ?";
final User user = new User();
jdbcTemplate.query(sql,rs->{
user.setUserId(rs.getInt("user_id"));
user.setUserName(rs.getString("user_name"));
});
return new User();
}
将spring系列版本改为4.3.2.RELEASE 就ok了,之前的是3

TestNg和spring3测试报错:Failed to read candidate component class-遁地龙卷风的更多相关文章
- 使用laravel-admin后台sdk报错Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID、Provisional headers are shown
		
报错Failed to load resource: net::ERR_CERT_AUTHORITY_INVALID请先确定自己的资源url是否可以确实访问到(地址正确与否.访问权限是否开启等) 若n ...
 - junit单元测试报错Failed to load ApplicationContext,但是项目发布到tomcat浏览器访问没问题
		
junit单元测试报错Failed to load ApplicationContext,但是项目发布到tomcat浏览器访问没问题,说明代码是没问题的,配置也没问题.开始时怀疑是我使用junit版本 ...
 - Vue.js报错Failed to resolve filter问题原因
		
Vue.js报错Failed to resolve filter问题原因 金刚 vue Vue.js js javascript 之前使用vue.js写分页功能时,写了一个过滤器,发现一个比较奇怪的错 ...
 - nmap报错:  Failed to open device ethxxx
		
nmap报错: Failed to open device ethxxx 周银辉 今天用nmap时, 报错: Failed to open device eth4, 好郁闷. 调查了一下, 是w ...
 - Maven-008-Nexus 私服部署发布报错 Failed to deploy artifacts: Failed to transfer file: ... Return code is: 4XX, ReasonPhrase: ... 解决方案
		
我在部署构件至 maven nexus 私服时,有时会出现 Failed to deploy artifacts: Failed to transfer file: ... Return code i ...
 - apache ab压力测试报错(apr_socket_recv: Connection reset by peer (104))
		
apache ab压力测试报错(apr_socket_recv: Connection reset by peer (104)) 今天用apache 自带的ab工具测试,当并发量达到1000多的时 ...
 - Eclipse启动 报错[Failed to load the JNI shared library jvm.dll
		
准备要做java服务器,在安装开发环境时,启动Eclipse报错[Failed to load the JNI shared library jvm.dll] 研究了下,造成错误的原因是由于eclip ...
 - hive日志位置(日志定位报错:Failed with exception Unable to move sourcehdfs://namenode/tmp/hive-pmp_bi/h)
		
Hive中的日志分为两种 1. 系统日志,记录了hive的运行情况,错误状况. 2. Job 日志,记录了Hive 中job的执行的历史过程. 日志查看方法 1,在本地运行机器上 hive日志存储位置 ...
 - libvirt启动报错Failed to start Virtualization daemon
		
libvirt启动报错Failed to start Virtualization daemon 1.启动libvirt的具体报错如下 [root@localhost IOS]# service li ...
 
随机推荐
- SQL ROUND() 函数
			
ROUND() 函数 ROUND 函数用于把数值字段舍入为指定的小数位数. SQL ROUND() 语法 SELECT ROUND(column_name,decimals) FROM table_n ...
 - UVA - 10917 - Walk Through the Forest(最短路+记忆化搜索)
			
Problem UVA - 10917 - Walk Through the Forest Time Limit: 3000 mSec Problem Description Jimmy exp ...
 - esp8266 免费wifi强推广告神器(4) 发现当前WIFI下的用户数目,IP,MAC请求http信息 在用户请求跳转后跳转
			
需求: 1 获取当前连接客户端的HTTP请求各种信息 方法 get http 请求路径 例如 /index.html / /pic.jpg 请求版本 HTTP/1.0 HT ...
 - jenkins编译打包nodejs
			
第一步 安装nodejs插件 第二步 在全局配置管理里面添加 nodejs配置 第三步 新建任务,从git上面拉取代码 cd /opt/tomcat7/bin/workspace/confdev #进 ...
 - 利用numpy+matplotlib绘图的基本操作教程
			
简述 Matplotlib是一个基于python的2D画图库,能够用python脚本方便的画出折线图,直方图,功率谱图,散点图等常用图表,而且语法简单.具体介绍见matplot官网. Numpy(Nu ...
 - 如何将多个C文件链接在一起----Makefile编写及make指令
			
需使用GCC编译器,关于MinGW的安装指南:https://people.eng.unimelb.edu.au/ammoffat/teaching/20005/Install-MinGW.pdf 单 ...
 - java高级-动态注入替换类Instrumentation
			
介绍 利用java.lang.instrument(容器类) 做动态 Instrumentation(执行容器) 是 Java SE 5 的新特性. 使用 Instrumentation,开发者可以构 ...
 - (haut oj  1261  )  地狱飞龙  利用不定积分求值
			
题目链接:http://218.28.220.249:50015/JudgeOnline/problem.php?id=1261 题目描述 最近clover迷上了皇室战争,他抽到了一种地狱飞龙,很开心 ...
 - CRM专业术语
			
客户关系管理(管理学词汇CRM)_百度百科https://baike.baidu.com/item/%E5%AE%A2%E6%88%B7%E5%85%B3%E7%B3%BB%E7%AE%A1%E7%9 ...
 - java valueOf()函数
			
valueOf() 方法用于返回给定参数的原生 Number 对象值,参数可以是原生数据类型, String等. 该方法是静态方法.该方法可以接收两个参数一个是字符串,一个是基数. 语法 该方法有以下 ...