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 parameters-->

        <constructor-arg value="BeanId"/>

 

Superclass has no null constructors but no arguments were given exception

 

 

Change to property injection

 

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

        <!--Constructor parameters-->

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

 

 

or

Create a default constructor with empty arguments.

 

 

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.

 

refer to:

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

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326360044&siteId=291194637