File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Spring and the fly likes org.springframework.beans.factory.BeanCreationException: Error creating bean with name... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Spring
Bookmark "org.springframework.beans.factory.BeanCreationException: Error creating bean with name..." Watch "org.springframework.beans.factory.BeanCreationException: Error creating bean with name..." New topic
Author

org.springframework.beans.factory.BeanCreationException: Error creating bean with name...

Josep M Serrainat
Greenhorn

Joined: Sep 14, 2010
Posts: 16
Hello, i have this structure

...dao


...dao.jpa





...dao.jpa.impl



in applicationContext.xml



When run with mvn tomcat:run-war, i get this error



I investigate where's the problema, but .... i don't find nothing. Can help me please.
Thank's for all and regards.
Srinivas Kollaparthi
Greenhorn

Joined: Jan 19, 2008
Posts: 11
The class UserDaoImpl has no default constructor. It has a single parameterized constructor.

But In Context xml, you defined 'userDao' bean with no contructor argument.

Add a proper constructor argument to bean 'userDao'.
Josep M Serrainat
Greenhorn

Joined: Sep 14, 2010
Posts: 16
Hi Srinivas,
Thanks for response. I'm newer with it. How can i add a proper constructor argument to bean?

Srinivas Kollaparthi
Greenhorn

Joined: Jan 19, 2008
Posts: 11
Try this :



Spring at run time will see that the constructor formal parameter is a Class, and it will so auto-magically inject as the constructor actual parameter the result of the invokation of Class.forName("cat.innoments.s2.model.User").

The above config should work.

Another approach :

Josep M Serrainat
Greenhorn

Joined: Sep 14, 2010
Posts: 16
Hi Srinivas ,
Thanks for all.
David Newton
Author
Rancher

Joined: Sep 29, 2008
Posts: 12617

Moving to Spring; this has nothing to do with Struts.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: org.springframework.beans.factory.BeanCreationException: Error creating bean with name...
 
Similar Threads
Tomcat 5.5 SEVERE: Error listenerStart
Using properties file for defining class dependency
spring+hibernate: insert data into database(one to many)
Error: Bean property 'userDAO' is not writable or has an invalid setter method.
Question about generic