lundi 19 mai 2014

« Impossible de localiser SessionFactory dans JNDI » avec Hibernate dans la jetée sous Juno Eclipse - Stack Overflow


I've spent a few days understanding this problem, but I have not come up with a solution. The following are posts that are having similar problems: Similar Post 1, Similar Post 2, Similar Post 3. I have tried some of the partial solutions there, but nothing has resolved the problem.


Problem


I'm developing a Google Web Application and using Hibernate for the persistence layer to connect to a Postgresql database. I run it in development mode with the built-in Jetty server that comes with the GWT Eclipse plugin. I have received some help from this post in configuring the Jetty server.


I have used the Hibernate Tools to reverse engineer and export the following:



  • Domain Code (.java)

  • Hibernate XML Mappings (.hbm.xml)

  • DAO code (.java)

  • Hibernate XML Configuration


These have all been exported to the src folder, and I've verified using the Hibernate Tool that the configurations are at least able to pull schema information.


Now the problem comes after the Jetty server starts running. As soon as you visit the site associated with the application, it reports the following errors in Eclipse's debug console:


    com.site.application.<reverse engineered DAO> getSessionFactory
SEVERE: Could not locate SessionFactory in JNDI
javax.naming.NameNotFoundException; remaining name 'SessionFactory'
at org.mortbay.naming.NamingContext.lookup(NamingContext.java:578)
at org.mortbay.naming.NamingContext.lookup(NamingContext.java:680)
at org.mortbay.naming.local.localContextRoot.lookup(localContextRoot.java:164)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at com.site.application.<reverse engineered DAO>.getSessionFactory(<reverse engineered DAO>.java:31)

Ending with:


    [ERROR] 500 - POST <application path> (127.0.0.1) xxxx bytes

Please let me know if you need any more details. I did not want to inundate the page with debug information.


Environment



  • Ubuntu 12.04 LTS

  • Eclipse Juno 4.2 Build id: 20120614-1722

  • GWT SDK 2.4.0

  • Hibernate 4.0

  • Postgresql 9.1



I've spent a few days understanding this problem, but I have not come up with a solution. The following are posts that are having similar problems: Similar Post 1, Similar Post 2, Similar Post 3. I have tried some of the partial solutions there, but nothing has resolved the problem.


Problem


I'm developing a Google Web Application and using Hibernate for the persistence layer to connect to a Postgresql database. I run it in development mode with the built-in Jetty server that comes with the GWT Eclipse plugin. I have received some help from this post in configuring the Jetty server.


I have used the Hibernate Tools to reverse engineer and export the following:



  • Domain Code (.java)

  • Hibernate XML Mappings (.hbm.xml)

  • DAO code (.java)

  • Hibernate XML Configuration


These have all been exported to the src folder, and I've verified using the Hibernate Tool that the configurations are at least able to pull schema information.


Now the problem comes after the Jetty server starts running. As soon as you visit the site associated with the application, it reports the following errors in Eclipse's debug console:


    com.site.application.<reverse engineered DAO> getSessionFactory
SEVERE: Could not locate SessionFactory in JNDI
javax.naming.NameNotFoundException; remaining name 'SessionFactory'
at org.mortbay.naming.NamingContext.lookup(NamingContext.java:578)
at org.mortbay.naming.NamingContext.lookup(NamingContext.java:680)
at org.mortbay.naming.local.localContextRoot.lookup(localContextRoot.java:164)
at javax.naming.InitialContext.lookup(InitialContext.java:411)
at com.site.application.<reverse engineered DAO>.getSessionFactory(<reverse engineered DAO>.java:31)

Ending with:


    [ERROR] 500 - POST <application path> (127.0.0.1) xxxx bytes

Please let me know if you need any more details. I did not want to inundate the page with debug information.


Environment



  • Ubuntu 12.04 LTS

  • Eclipse Juno 4.2 Build id: 20120614-1722

  • GWT SDK 2.4.0

  • Hibernate 4.0

  • Postgresql 9.1


0 commentaires:

Enregistrer un commentaire