Win a copy of 97 Things Every Java Programmer Should Know this week in the Java in General forum!
  • 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
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

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: 21950
106
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.
 
We cannot change unless we survive, but we will not survive unless we change. Evolving tiny ad:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic