• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

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

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srinivas,
Thanks for response. I'm newer with it. How can i add a proper constructor argument to bean?

 
Srinivas Kollaparthi
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Srinivas ,
Thanks for all.
 
Author
Posts: 12617
IntelliJ IDE Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to Spring; this has nothing to do with Struts.
 
What do you have in that there bucket? It wouldn't be a tiny ad by any chance ...
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic