• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Run first Hibernate example in eclipse

 
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I just started reading Hibernate
and did one application.
But I got error..
[main] INFO org.hibernate.cfg.Environment - Hibernate 3.3.2.GA
[main] INFO org.hibernate.cfg.Environment - hibernate.properties not found
[main] INFO org.hibernate.cfg.Environment - Bytecode provider name : javassist
[main] INFO org.hibernate.cfg.Environment - using JDK 1.4 java.sql.Timestamp handling
[main] INFO org.hibernate.cfg.Configuration - configuring from resource: /hibernate.cfg.xml
[main] INFO org.hibernate.cfg.Configuration - Configuration resource: /hibernate.cfg.xml
Initial SessionFactory creation failed.org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
Exception in thread "main" java.lang.ExceptionInInitializerError
at HibernateUtil.buildSessionFactory(HibernateUtil.java:15)
at HibernateUtil.<clinit>(HibernateUtil.java:6)
at Test.addUser(Test.java:59)
at Test.main(Test.java:18)
Caused by: org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1542)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1476)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1462)
at HibernateUtil.buildSessionFactory(HibernateUtil.java:10)
... 3 more
Caused by: org.dom4j.DocumentException: www.hibernate.org Nested exception: www.hibernate.org
at org.dom4j.io.SAXReader.read(SAXReader.java:484)
at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1532)
... 6 more

I am using:

hibernate-release-4.1.9.Final
slf4j-1.7.2

Please anybody help me , I am new for Hibernate
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This error message:

Could not parse configuration: /hibernate.cfg.xml


sounds like there is something wrong with your Hibernate configuration file. Maybe it is not a valid XML file. Check if the content of the file is valid XML and if it's a valid Hibernate configuration file.
 
pravin gajbhiye
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jesper...


Actually I don't know which jar files are needed .
I am reffering the link http://blog.sencide.com/2011/03/hibernate-tutorial-for-beginners.html. for learning basic application.
I have downloaded hibernate-release-4.1.9.Final .
But it dosn't have the files
1) cglib-2.2.2.jar
2)commons-collections-3.2.1.jar
3)jta-1.1.jar
So i downloaded these saperatly and add these as external jar files.


hibernate-release-4.1.9.Final contains
antlr-2.7.7
dom4j-1.6.1
hibernate-commons-annotations-4.0.1.Final
hibernate-core-4.1.9.Final
hibernate-jpa-2.0-api-1.0.1.Final
javassist-3.17.1-GA
jboss-logging-3.1.0.GA
jboss-transaction-api_1.1_spec-1.0.0.Final

I also downloaded
slf4j-1.7.2 folder which contains jars.
hibernate3.jar
mysql-connecter-java5.1.jar
and it.

Is there any problems with my setup?

Please give me a proper set configuration.
Thank you very much for your reply.
 
Marshal
Posts: 79239
377
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Question too difficult for this forum: moving to where we usually discuss Hibernate.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic