• 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
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Knute Snortum
  • Bear Bibeault
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Piet Souris
  • Ganesh Patekar
Bartenders:
  • Frits Walraven
  • Carey Brown
  • Tim Holloway

org.hibernate.service.spi.ServiceException

 
Ranch Hand
Posts: 38
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My program shows exception on running. In this program i made a hibernate.properties file and two java  classes as Person.java and TestApplication.java .Any idea what's going wrong?

Hibernate.properties


Person.java


Test Application.java


Output:
 
Greenhorn
Posts: 21
1
MySQL Database Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hibernate chokes because it cannot find out the strategy to define a unique ID. I suggest you add a line underneath as
@GeneratedValue(strategy=GenerationType.AUTO)

You also have to define the Columns, otherwise you end up with a table of unique ID’s and that’s it.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!