`
crabdave
  • 浏览: 1277984 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Spring CGlib Superclass has no null constructors but no arguments were given

阅读更多

Spring CGlib Superclass has no null constructors but no arguments were given

 

 <bean id="beanId" class="com.bean.BeanId">

        <!--构造器参数-->

        <constructor-arg value="BeanId"/>

 

出现Superclass has no null constructors but no arguments were given异常

 

 

改成属性注入

 

 <bean id="beanId" class="com.bean.BeanId">

        <!--构造器参数-->

        <property name="name" value="BeanId"/>

 

 

或者

创建参数为空的默认构造函数。

 

 

CGlib has one important restriction: the target class must provide a default constructor.

If you use property-based injection instead of constructor-based injection, the problem will go away.

 

or

 

I just created an empty default constructor to deal with this.

 

参考:

https://stackoverflow.com/questions/15223297/superclass-has-no-null-constructors-but-no-arguments-were-given

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics