• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • paul wheaton
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Ron McLeod
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Tim Holloway
  • Carey Brown
  • salvin francis

I am trying spring and hibernet example with mysql database but getting exception

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Exception

Emloyee.java


Employee.dao.java


InsertTest.java



applicationContext.xml



Employee.hbm.xml

 
Sheriff
Posts: 21783
103
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The bean is called id but you're using "d". That said, both are terrible names for a DAO. Why not call the bean employeeDao?
 
Bartender
Posts: 1868
81
Android IntelliJ IDE MySQL Database Chrome Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to CodeRanch shelendra.

In the future please use the code tags feature as explained here https://coderanch.com/wiki/659781/Code-Tags.
This makes the code easier to read and follow for everyone.

I think that you may be using the tutorial found here https://www.javatpoint.com/spring-tutorial-constructor-injection-with-dependent-object, if not which tutorial are you using?

Looking at your code, you don't seem to have any xml elements with an id value of "d". This is the most likely reason for the error that you are experiencing.
 
The harder I work, the luckier I get. -Sam Goldwyn So tiny. - this ad:
create, convert, edit or print DOC and DOCX in Java
https://products.aspose.com/words/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!