Error creating bean with name ‘car’ defined in class path resource [ApplicationContext.xml]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [domain.Car]: No default constructor found; nested exception is java.lang.NoSuchMethodException: domain.Car.()

刚开始练习spring,使用p名称空间实例化对象时遇到这样的报错问题:
spring:p名称空间实例化对象
核对原因之后是因为BeanInstantiationException:没有实例化Cat,构造函数异常;
解决方法:在实体类中加入无参的构造函数。

相关文章:

  • 2022-12-23
  • 2022-02-23
  • 2022-02-08
  • 2022-12-23
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-12
  • 2022-12-23
  • 2022-12-23
  • 2021-09-09
  • 2022-12-23
  • 2021-12-01
  • 2022-12-23
相关资源
相似解决方案