当前位置: 代码迷 >> J2SE >> 求大神帮忙解决个错误
  详细解决方案

求大神帮忙解决个错误

热度:25   发布时间:2016-04-23 20:05:19.0
求大神帮忙解决个异常,在线等
 ERROR [com.opensymphony.xwork2.spring.SpringObjectFactory] - <Error building bean>
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'java.lang.Integer': Unsatisfied dependency expressed through constructor argument with index 0 of type [int]: : No matching bean of type [int] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No matching bean of type [int] found for dependency: expected at least 1 bean which qualifies as autowire candidate for this dependency. Dependency annotations: {}

------解决思路----------------------
   'java.lang.Integer  和  int  转换出问题。
------解决思路----------------------
哥们,可能问题在这句oSuchBeanDefinitionException: No matching bean of type [int] found for dependency:,看下你的xml配置文件,是不是少配置了什么实体类,或者实体类都配置好了少配置了什么属性。如果是hibernate的实体类和数据库映射文件的话,需要注意类型不能写int,需要写Integer
  相关解决方案