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. 期末架构-Centos7

    00--linux运维架构演变过程 01--老男孩教育-CentOS6和7 01-笔记 安装系统 系统下载地址:http://mirrors.aliyun.com/centos/7/isos/x86_ ...

  2. 授权普通非DBA用户可以有权限查看执行计划的方法

    drop table PLAN_TABLE;   删除原plan表   执行ORACLE自带的创建脚本 @?/rdbms/admin/utlxplan.sql   创建同义词 create or re ...

  3. 越狱解决iphone4s外放无声音

    删除iphone中/System/Library/PrivateFrameworks/IAP.framework/Support/目录下的iapd文件 进入/SYSTEM/Library/Launch ...

  4. vue style标签中使用less

    只需要下载相应的包即可:(前提是使用vue-cli搭建的项目) 1.安装less依赖,npm install less less-loader --save 2.即可在相应的vue文件中使用less操 ...

  5. hadoop 集群 master datanode 没有启动

    2018-02-07 02:47:50,377 WARN org.apache.hadoop.hdfs.server.common.Storage: java.io.IOException: Inco ...

  6. input 各种限制

    test 1.限制只能输入或黏贴11位长度的数字 <input onkeyup="this.value=this.value.replace(/\D/g,'')" onaft ...

  7. mysql常见问题处理

    出现: Access denied for user ''@'localhost' to database ' 2.error: Found option without preceding grou ...

  8. 解决import模块后提示无此模块的问题

    最近在工作中发现一个奇怪的问题: 明明已经装上了,但是还提示找不到该模块,没办法,我又去site-package文件下面看了: 发现Linux下自带的python2.7里面装上了该模块(我在root用 ...

  9. SparkStreaming+Kafa+HBase

    1. 总结一些概念: 安装zookeeper3.4.6 cp zoo_sample.cfg zoo.cfgvim zoo.cfg tickTime=2000initLimit=10syncLimit= ...

  10. 一键分享代码(提供能分享到QQ空间、新浪微博、人人网等的分享功能)

    <html> <head></head> <body> <div class="xl_2"> <span styl ...