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-遁地龙卷风的更多相关文章

  1. 使用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 ...

  2. junit单元测试报错Failed to load ApplicationContext,但是项目发布到tomcat浏览器访问没问题

    junit单元测试报错Failed to load ApplicationContext,但是项目发布到tomcat浏览器访问没问题,说明代码是没问题的,配置也没问题.开始时怀疑是我使用junit版本 ...

  3. Vue.js报错Failed to resolve filter问题原因

    Vue.js报错Failed to resolve filter问题原因 金刚 vue Vue.js js javascript 之前使用vue.js写分页功能时,写了一个过滤器,发现一个比较奇怪的错 ...

  4. nmap报错: Failed to open device ethxxx

    nmap报错:  Failed to open device ethxxx 周银辉 今天用nmap时, 报错:   Failed to open device eth4, 好郁闷. 调查了一下, 是w ...

  5. 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 ...

  6. apache ab压力测试报错(apr_socket_recv: Connection reset by peer (104))

    apache ab压力测试报错(apr_socket_recv: Connection reset by peer (104))   今天用apache 自带的ab工具测试,当并发量达到1000多的时 ...

  7. Eclipse启动 报错[Failed to load the JNI shared library jvm.dll

    准备要做java服务器,在安装开发环境时,启动Eclipse报错[Failed to load the JNI shared library jvm.dll] 研究了下,造成错误的原因是由于eclip ...

  8. hive日志位置(日志定位报错:Failed with exception Unable to move sourcehdfs://namenode/tmp/hive-pmp_bi/h)

    Hive中的日志分为两种 1. 系统日志,记录了hive的运行情况,错误状况. 2. Job 日志,记录了Hive 中job的执行的历史过程. 日志查看方法 1,在本地运行机器上 hive日志存储位置 ...

  9. libvirt启动报错Failed to start Virtualization daemon

    libvirt启动报错Failed to start Virtualization daemon 1.启动libvirt的具体报错如下 [root@localhost IOS]# service li ...

随机推荐

  1. python之并发编程

    一 背景知识 顾名思义,进程即正在执行的一个过程.进程是对正在运行程序的一个抽象. 进程的概念起源于操作系统,是操作系统最核心的概念,也是操作系统提供的最古老也是最重要的抽象概念之一.操作系统的其他所 ...

  2. copy 和 deepcopy的区别

    import copy a = [1, 2, 3, 4, ['a', 'b']] b = a # 引用,除非直接给a重新赋值,否则a变则b变,b变则a变 c = copy.copy(a) # 浅复制, ...

  3. mac 利用svn下载远程代码出现Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo.

    终端输出的信息:Agreeing to the Xcode/iOS license requires admin privileges, please re-run as root via sudo. ...

  4. js 对数据进行过滤

    //对数据进行过滤 Array.prototype.filter = Array.prototype.filter || function (func) { var arr = this; var r ...

  5. HTML页面全屏/退出全屏

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  6. 什么是面向切面编程AOP

    一丶前言 看过一些描述关于AOP切面编程的文章,写的太概念化让人很难理解,下面是我自己的理解,希望能帮到新人,如有错误欢迎指正. 二丶AOP是什么,它的应用场景是什么? AOP也跟IOC,OOP这些思 ...

  7. hadoop用户写入文件权限不够的问题

    问题: 普通用户echo写入文件,提示权限不够. 解决方式: sudo tee test.txt <<< "要插入内容"

  8. C#中字符串的字面值(转义序列)

    在程序开发中,经常会碰到在字符串中字面值中使用转义序列,下面表格收集了下转义序列的完整列表,以便大家查看引用: 转义序列列表 转义序列 产生的字符 字符的Unicode值 \' 单引号 0x0027 ...

  9. bzoj3277-串

    Code #include<cstdio> #include<iostream> #include<cmath> #include<cstring> # ...

  10. 自定义一个IOC框架

    要实现的功能: 将对象的实例化交给自定的ioc容器. 通过注解的方式对接口进行依赖注入 通过getBean("userName")方法那到对象,使用对象的方法 首先,创建一个对象, ...