• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Simple hibernate annotation example problem

 
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I have copied an simple hibernate example from website, every thing compiles fine when i rum i get the following error.

"Initial SessionFactory creation failed.java.lang.NoSuchFieldError: sqlResultSetMappings
Exception in thread "main" java.lang.ExceptionInInitializerError
at net.roseindia.HibernateUtil.<clinit>(HibernateUtil.java:15)
at net.roseindia.Example1.main(Example1.java:14)
Caused by: java.lang.NoSuchFieldError: sqlResultSetMappings
at org.hibernate.cfg.AnnotationConfiguration.createExtendedMappings(AnnotationConfiguration.java:166)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:254)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1049)
at net.roseindia.HibernateUtil.<clinit>(HibernateUtil.java:11)
... 1 more
Java Result: 1"



 
juniad Ahmed
Greenhorn
Posts: 24
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
these are the following jar files i am using

ant-antlr-1.6.3
cglib-2.2
commons=collections-2.11
commons.logging-1.1
commons-dhcp-1.0
commons-pool
derby
derbyClient
hibernate3
;pg4j
dom4j-1.6
ehcache-1.1
jta
jstl
antr\lr-2.7/5h3
javax.persistance
hibernate.annotationd
 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Can you try to use openSession() to get the session instead of getCurrentSession() in Example1.

 
bala rimmalapudi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Leave my earlier comments, It looks like there is issue with your database, can you check whether in the database you have a table called employee with column names as id,name.

 
bala rimmalapudi
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Just check this link http://www.velocityreviews.com/forums/t635509-hibernate-tutorial-problem.html it is for the similar problem.
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

bala rimmalapudi wrote:Hi,
Just check this link http://www.velocityreviews.com/forums/t635509-hibernate-tutorial-problem.html it is for the similar problem.



Well, this problem is a classpath problem too, but for a completely different jar. Its related to SLF4 dependencies.

My guess is the two different versions of antlr juniad is using might be part of the issue.
 
Whose rules are you playing by? This tiny ad doesn't respect those rules:
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic