This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Run first Hibernate example in eclipse

 
pravin gajbhiye
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • 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
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Posts: 15279
39
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • 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
  • 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.
 
Campbell Ritchie
Sheriff
Pie
Posts: 48946
60
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Question too difficult for this forum: moving to where we usually discuss Hibernate.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic