• 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

Failed to create Session Factory -> Eclipse export problem

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

it is the second day now i spend searching on the internet for the same problem and now I hope someone here can help me.
I have a small H2 database running on my Windows machine and for the Data Access Layer I use hibernate and Java. Everything works
fine when I start the application from Eclipse, but when I export the project as a jar file I get following error massage:

Failed to create sessionFactory object.org.hibernate.HibernateException: Could not parse configuration: /hibernate.cfg.xml



The environment:
It runs on is a JWebSocket which is responsible for the communication an Android phone is sending Tokens and the java
tool is analyzing the Token and starting a transaction over hibernate.
As mentioned before everything works fine when I start the project from Eclipse.

The files:
hibernate.cfg.xml:
Code :


as a example the Position.hbm.xml:
Code:


HibernateUtil.java


Thank you very much
Youza
 
Anton Junker
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
So found a way the JWebSocket expects the hibernate.cfg.xml at
org.hibernate.cfg
so I had to create that package and place the hibernate.cfg.xml file there

-> it's still working in Eclipse and it's not working when I export it
now I get the following error
Failed to create sessionFactory object.java.lang.ExceptionInInitializerError

that's at least a little bit more specific now I read something about the log4j Logger and placed a Logger file also in the hibernate.cfg.xml package
and after adding the properties I get the message:

Failed to create sessionFactory object.org.hibernate.HibernateException: Could not parse configuration /hibernate.cfg.xml

So let's see what I can do against that if someone knows something about that error please help

Thanks
youza
 
Anton Junker
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solved simply updated the JWebSocketServer

-> Then you have to put the hibernate.cfg.xml in the source folder
 
reply
    Bookmark Topic Watch Topic
  • New Topic