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-遁地龙卷风

相关文章:

  • 2022-12-23
  • 2021-07-11
  • 2019-11-17
  • 2021-04-19
  • 2022-12-23
  • 2022-01-17
  • 2021-05-24
猜你喜欢
  • 2022-12-23
  • 2021-12-25
  • 2022-12-23
  • 2021-08-02
  • 2021-10-07
  • 2021-09-26
相关资源
相似解决方案