• Post Reply Bookmark Topic Watch Topic
  • New Topic

Integrate Hibernate into the JSF project  RSS feed

 
alex friday
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am using GlassFish server in Eclipse and  trying to intergerate the `hibernate-release-5.1.0.Final` into the JSF project. I have tried several steps but without seccuss.

- I have Placed the Hibernate Jars inside the GlassFisch directrory `glassfish4\bin` and restarted the server.
-   I placed them inside the following foloder `glassfish4\glassfish\bin` and restarted the GlassFisch server.
- I placed the Hibernate jars inside the WEB-INF/lib
- I added this part `.addResource("/resources/person.hbm.xml")` to the `CreatePersonDemo` class.
- I replaced the `jboss-logging.jar` inside the `glassfish4\glassfish\modules` directory with `jboss-logging-3.3.0.Final.jar`

CreatePersonDemo

 

hibernate.cfg.xml


person.hbm.xml



**Person.Java**



Error

  

Project structure

https://postimg.org/image/bvd1wtik1/

regards,
TheOcean
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In Tomcat, you have to include all your Hibernate jars in the WAR's WEB-INF/lib directory. GlassFish is a full-stack server, and I think it's using Hibernate internally to power EJBs. The best place to ask about that is in the GlassFish forum. It's possible that if you explicitly include Hibernate jars in a GlassFish WAR that there could be conflicts with the GlassFish server's internal database management.

JSF neither knows nor cares about database persistence in any form, so whatever solutions you find would be the same as for a non-JSF webapp.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!