You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Nicolás Vázquez <ni...@gmail.com> on 2016/11/02 18:39:02 UTC

Spring errors when creating new DAO

Hi all,

I've been having troubles creating a new DAO on cloud-engine-schema.
Specifically, I'm getting this error:



*java.lang.IllegalArgumentException: Superclass has no null constructors
but no arguments were given*
I defined new bean on spring-engine-schema-core-daos.xml file and injected
it into StorageManagerImpl class.
I annotated new impl class with @Component, and provided a constructor with
no arguments. Did you have a similar issue?

Error creating bean with name 'storageManagerImpl': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: com.cloud.storage.dao.StoragePoolTagsDao
com.cloud.storage.StorageManagerImpl._storagePoolTagsDao; nested exception
is org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'storagePoolTagsDaoImpl' defined in URL
[jar:file:/usr/share/cloudstack-management/webapps/client/WEB-INF/lib/cloud-engine-schema-4.9.1.0-SNAPSHOT.jar!/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [com.cloud.storage.dao.StoragePoolTagsDaoImpl]: Constructor
threw exception; nested exception is java.lang.IllegalArgumentException:
Superclass has no null constructors but no arguments were given
        at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:526)
        at
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
        at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:295)

Re: Spring errors when creating new DAO

Posted by Nicolás Vázquez <ni...@gmail.com>.
Thanks so much Koushik! It worked like a charm, I had totally missed that
constructor.

2016-11-03 11:19 GMT-03:00 Koushik Das <ko...@accelerite.com>:

> Add a default ctor for StoragePoolTagVO class.
>
> On 03/11/16, 6:36 PM, "Nicolás Vázquez" <ni...@gmail.com> wrote:
>
>     Sure, thanks guys. This is the link to commit I'm working on:
>     https://github.com/nvazquez/cloudstack/commit/
> 62d6c0c06a1cd51b0adec5d896c45e574d2daab1
>
>     2016-11-03 8:15 GMT-03:00 Koushik Das <ko...@accelerite.com>:
>
>     > Can you share the details about StoragePoolTagsDaoImpl class and its
> super
>     > classes? Looks like in the hierarchy a default ctor is missing.
>     >
>     > On 03/11/16, 12:09 AM, "Nicolás Vázquez" <ni...@gmail.com>
> wrote:
>     >
>     >     Hi all,
>     >
>     >     I've been having troubles creating a new DAO on
> cloud-engine-schema.
>     >     Specifically, I'm getting this error:
>     >
>     >
>     >
>     >     *java.lang.IllegalArgumentException: Superclass has no null
>     > constructors
>     >     but no arguments were given*
>     >     I defined new bean on spring-engine-schema-core-daos.xml file
> and
>     > injected
>     >     it into StorageManagerImpl class.
>     >     I annotated new impl class with @Component, and provided a
> constructor
>     > with
>     >     no arguments. Did you have a similar issue?
>     >
>     >     Error creating bean with name 'storageManagerImpl': Injection of
>     > autowired
>     >     dependencies failed; nested exception is
>     >     org.springframework.beans.factory.BeanCreationException: Could
> not
>     > autowire
>     >     field: com.cloud.storage.dao.StoragePoolTagsDao
>     >     com.cloud.storage.StorageManagerImpl._storagePoolTagsDao; nested
>     > exception
>     >     is org.springframework.beans.factory.BeanCreationException:
> Error
>     > creating
>     >     bean with name 'storagePoolTagsDaoImpl' defined in URL
>     >     [jar:file:/usr/share/cloudstack-management/webapps/
>     > client/WEB-INF/lib/cloud-engine-schema-4.9.1.0-
> SNAPSHOT.jar!/META-INF/
>     > cloudstack/core/spring-engine-schema-core-daos-context.xml]:
>     >     Instantiation of bean failed; nested exception is
>     >     org.springframework.beans.BeanInstantiationException: Could not
>     > instantiate
>     >     bean class [com.cloud.storage.dao.StoragePoolTagsDaoImpl]:
> Constructor
>     >     threw exception; nested exception is java.lang.
>     > IllegalArgumentException:
>     >     Superclass has no null constructors but no arguments were given
>     >             at
>     >     org.springframework.beans.factory.annotation.
>     > AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(
>     > AutowiredAnnotationBeanPostProcessor.java:526)
>     >             at
>     >     org.springframework.beans.factory.annotation.
> InjectionMetadata.inject(
>     > InjectionMetadata.java:87)
>     >             at
>     >     org.springframework.beans.factory.annotation.
>     > AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(
>     > AutowiredAnnotationBeanPostProcessor.java:295)
>     >
>     >
>     >
>     >
>     >
>     > DISCLAIMER
>     > ==========
>     > This e-mail may contain privileged and confidential information
> which is
>     > the property of Accelerite, a Persistent Systems business. It is
> intended
>     > only for the use of the individual or entity to which it is
> addressed. If
>     > you are not the intended recipient, you are not authorized to read,
> retain,
>     > copy, print, distribute or use this message. If you have received
> this
>     > communication in error, please notify the sender and delete all
> copies of
>     > this message. Accelerite, a Persistent Systems business does not
> accept any
>     > liability for virus infected mails.
>     >
>
>
>
>
>
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is
> the property of Accelerite, a Persistent Systems business. It is intended
> only for the use of the individual or entity to which it is addressed. If
> you are not the intended recipient, you are not authorized to read, retain,
> copy, print, distribute or use this message. If you have received this
> communication in error, please notify the sender and delete all copies of
> this message. Accelerite, a Persistent Systems business does not accept any
> liability for virus infected mails.
>

Re: Spring errors when creating new DAO

Posted by Koushik Das <ko...@accelerite.com>.
Add a default ctor for StoragePoolTagVO class.

On 03/11/16, 6:36 PM, "Nicolás Vázquez" <ni...@gmail.com> wrote:

    Sure, thanks guys. This is the link to commit I'm working on:
    https://github.com/nvazquez/cloudstack/commit/62d6c0c06a1cd51b0adec5d896c45e574d2daab1
    
    2016-11-03 8:15 GMT-03:00 Koushik Das <ko...@accelerite.com>:
    
    > Can you share the details about StoragePoolTagsDaoImpl class and its super
    > classes? Looks like in the hierarchy a default ctor is missing.
    >
    > On 03/11/16, 12:09 AM, "Nicolás Vázquez" <ni...@gmail.com> wrote:
    >
    >     Hi all,
    >
    >     I've been having troubles creating a new DAO on cloud-engine-schema.
    >     Specifically, I'm getting this error:
    >
    >
    >
    >     *java.lang.IllegalArgumentException: Superclass has no null
    > constructors
    >     but no arguments were given*
    >     I defined new bean on spring-engine-schema-core-daos.xml file and
    > injected
    >     it into StorageManagerImpl class.
    >     I annotated new impl class with @Component, and provided a constructor
    > with
    >     no arguments. Did you have a similar issue?
    >
    >     Error creating bean with name 'storageManagerImpl': Injection of
    > autowired
    >     dependencies failed; nested exception is
    >     org.springframework.beans.factory.BeanCreationException: Could not
    > autowire
    >     field: com.cloud.storage.dao.StoragePoolTagsDao
    >     com.cloud.storage.StorageManagerImpl._storagePoolTagsDao; nested
    > exception
    >     is org.springframework.beans.factory.BeanCreationException: Error
    > creating
    >     bean with name 'storagePoolTagsDaoImpl' defined in URL
    >     [jar:file:/usr/share/cloudstack-management/webapps/
    > client/WEB-INF/lib/cloud-engine-schema-4.9.1.0-SNAPSHOT.jar!/META-INF/
    > cloudstack/core/spring-engine-schema-core-daos-context.xml]:
    >     Instantiation of bean failed; nested exception is
    >     org.springframework.beans.BeanInstantiationException: Could not
    > instantiate
    >     bean class [com.cloud.storage.dao.StoragePoolTagsDaoImpl]: Constructor
    >     threw exception; nested exception is java.lang.
    > IllegalArgumentException:
    >     Superclass has no null constructors but no arguments were given
    >             at
    >     org.springframework.beans.factory.annotation.
    > AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(
    > AutowiredAnnotationBeanPostProcessor.java:526)
    >             at
    >     org.springframework.beans.factory.annotation.InjectionMetadata.inject(
    > InjectionMetadata.java:87)
    >             at
    >     org.springframework.beans.factory.annotation.
    > AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(
    > AutowiredAnnotationBeanPostProcessor.java:295)
    >
    >
    >
    >
    >
    > DISCLAIMER
    > ==========
    > This e-mail may contain privileged and confidential information which is
    > the property of Accelerite, a Persistent Systems business. It is intended
    > only for the use of the individual or entity to which it is addressed. If
    > you are not the intended recipient, you are not authorized to read, retain,
    > copy, print, distribute or use this message. If you have received this
    > communication in error, please notify the sender and delete all copies of
    > this message. Accelerite, a Persistent Systems business does not accept any
    > liability for virus infected mails.
    >
    




DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Accelerite, a Persistent Systems business. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Accelerite, a Persistent Systems business does not accept any liability for virus infected mails.

Re: Spring errors when creating new DAO

Posted by Nicolás Vázquez <ni...@gmail.com>.
Sure, thanks guys. This is the link to commit I'm working on:
https://github.com/nvazquez/cloudstack/commit/62d6c0c06a1cd51b0adec5d896c45e574d2daab1

2016-11-03 8:15 GMT-03:00 Koushik Das <ko...@accelerite.com>:

> Can you share the details about StoragePoolTagsDaoImpl class and its super
> classes? Looks like in the hierarchy a default ctor is missing.
>
> On 03/11/16, 12:09 AM, "Nicolás Vázquez" <ni...@gmail.com> wrote:
>
>     Hi all,
>
>     I've been having troubles creating a new DAO on cloud-engine-schema.
>     Specifically, I'm getting this error:
>
>
>
>     *java.lang.IllegalArgumentException: Superclass has no null
> constructors
>     but no arguments were given*
>     I defined new bean on spring-engine-schema-core-daos.xml file and
> injected
>     it into StorageManagerImpl class.
>     I annotated new impl class with @Component, and provided a constructor
> with
>     no arguments. Did you have a similar issue?
>
>     Error creating bean with name 'storageManagerImpl': Injection of
> autowired
>     dependencies failed; nested exception is
>     org.springframework.beans.factory.BeanCreationException: Could not
> autowire
>     field: com.cloud.storage.dao.StoragePoolTagsDao
>     com.cloud.storage.StorageManagerImpl._storagePoolTagsDao; nested
> exception
>     is org.springframework.beans.factory.BeanCreationException: Error
> creating
>     bean with name 'storagePoolTagsDaoImpl' defined in URL
>     [jar:file:/usr/share/cloudstack-management/webapps/
> client/WEB-INF/lib/cloud-engine-schema-4.9.1.0-SNAPSHOT.jar!/META-INF/
> cloudstack/core/spring-engine-schema-core-daos-context.xml]:
>     Instantiation of bean failed; nested exception is
>     org.springframework.beans.BeanInstantiationException: Could not
> instantiate
>     bean class [com.cloud.storage.dao.StoragePoolTagsDaoImpl]: Constructor
>     threw exception; nested exception is java.lang.
> IllegalArgumentException:
>     Superclass has no null constructors but no arguments were given
>             at
>     org.springframework.beans.factory.annotation.
> AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(
> AutowiredAnnotationBeanPostProcessor.java:526)
>             at
>     org.springframework.beans.factory.annotation.InjectionMetadata.inject(
> InjectionMetadata.java:87)
>             at
>     org.springframework.beans.factory.annotation.
> AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(
> AutowiredAnnotationBeanPostProcessor.java:295)
>
>
>
>
>
> DISCLAIMER
> ==========
> This e-mail may contain privileged and confidential information which is
> the property of Accelerite, a Persistent Systems business. It is intended
> only for the use of the individual or entity to which it is addressed. If
> you are not the intended recipient, you are not authorized to read, retain,
> copy, print, distribute or use this message. If you have received this
> communication in error, please notify the sender and delete all copies of
> this message. Accelerite, a Persistent Systems business does not accept any
> liability for virus infected mails.
>

Re: Spring errors when creating new DAO

Posted by Koushik Das <ko...@accelerite.com>.
Can you share the details about StoragePoolTagsDaoImpl class and its super classes? Looks like in the hierarchy a default ctor is missing.

On 03/11/16, 12:09 AM, "Nicolás Vázquez" <ni...@gmail.com> wrote:

    Hi all,
    
    I've been having troubles creating a new DAO on cloud-engine-schema.
    Specifically, I'm getting this error:
    
    
    
    *java.lang.IllegalArgumentException: Superclass has no null constructors
    but no arguments were given*
    I defined new bean on spring-engine-schema-core-daos.xml file and injected
    it into StorageManagerImpl class.
    I annotated new impl class with @Component, and provided a constructor with
    no arguments. Did you have a similar issue?
    
    Error creating bean with name 'storageManagerImpl': Injection of autowired
    dependencies failed; nested exception is
    org.springframework.beans.factory.BeanCreationException: Could not autowire
    field: com.cloud.storage.dao.StoragePoolTagsDao
    com.cloud.storage.StorageManagerImpl._storagePoolTagsDao; nested exception
    is org.springframework.beans.factory.BeanCreationException: Error creating
    bean with name 'storagePoolTagsDaoImpl' defined in URL
    [jar:file:/usr/share/cloudstack-management/webapps/client/WEB-INF/lib/cloud-engine-schema-4.9.1.0-SNAPSHOT.jar!/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml]:
    Instantiation of bean failed; nested exception is
    org.springframework.beans.BeanInstantiationException: Could not instantiate
    bean class [com.cloud.storage.dao.StoragePoolTagsDaoImpl]: Constructor
    threw exception; nested exception is java.lang.IllegalArgumentException:
    Superclass has no null constructors but no arguments were given
            at
    org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:526)
            at
    org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
            at
    org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:295)
    




DISCLAIMER
==========
This e-mail may contain privileged and confidential information which is the property of Accelerite, a Persistent Systems business. It is intended only for the use of the individual or entity to which it is addressed. If you are not the intended recipient, you are not authorized to read, retain, copy, print, distribute or use this message. If you have received this communication in error, please notify the sender and delete all copies of this message. Accelerite, a Persistent Systems business does not accept any liability for virus infected mails.

Re: Spring errors when creating new DAO

Posted by Rohit Yadav <ro...@shapeblue.com>.
Hi Nicolas,


Can you share your PR/changes? Maybe the issue was caused by them.


The constructor for StoragePoolMonitor class had changed between 4.8 and 4.9+, I merged PR #1694 yesterday which has caused a build failure in a newly added unit test. Your build error looks different than what I'm getting, but this may be related. I'm pushing the build fix, can you try again rebasing against latest 4.9 branch?


I apologise for the build failure, historically when we forward-merge the PR, on those branch (not the original base branch for which the PR was sent) we don't run regression test suite again I'll also explore how we can fix that, at least run mvn builds.


Regards.

________________________________
From: Nicol?s V?zquez <ni...@gmail.com>
Sent: 03 November 2016 00:09:02
To: dev@cloudstack.apache.org
Subject: Spring errors when creating new DAO

Hi all,

I've been having troubles creating a new DAO on cloud-engine-schema.
Specifically, I'm getting this error:



*java.lang.IllegalArgumentException: Superclass has no null constructors
but no arguments were given*
I defined new bean on spring-engine-schema-core-daos.xml file and injected
it into StorageManagerImpl class.
I annotated new impl class with @Component, and provided a constructor with
no arguments. Did you have a similar issue?

Error creating bean with name 'storageManagerImpl': Injection of autowired
dependencies failed; nested exception is
org.springframework.beans.factory.BeanCreationException: Could not autowire
field: com.cloud.storage.dao.StoragePoolTagsDao
com.cloud.storage.StorageManagerImpl._storagePoolTagsDao; nested exception
is org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'storagePoolTagsDaoImpl' defined in URL
[jar:file:/usr/share/cloudstack-management/webapps/client/WEB-INF/lib/cloud-engine-schema-4.9.1.0-SNAPSHOT.jar!/META-INF/cloudstack/core/spring-engine-schema-core-daos-context.xml]:
Instantiation of bean failed; nested exception is
org.springframework.beans.BeanInstantiationException: Could not instantiate
bean class [com.cloud.storage.dao.StoragePoolTagsDaoImpl]: Constructor
threw exception; nested exception is java.lang.IllegalArgumentException:
Superclass has no null constructors but no arguments were given
        at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:526)
        at
org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:87)
        at
org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessPropertyValues(AutowiredAnnotationBeanPostProcessor.java:295)

rohit.yadav@shapeblue.com 
www.shapeblue.com
53 Chandos Place, Covent Garden, London  WC2N 4HSUK
@shapeblue