users@glassfish.java.net

Hibernate persistence integration in Glassfish

From: Persa Zaloshnja <arushi58_at_hotmail.com>
Date: Sun, 3 Feb 2008 10:16:08 +0100

Hi, I have started working with sailfin, and currently I am trying to integrate Hibernate EntityManager with Glassfish. As I am slightly in trouble I'd appreciate any hints on the matter.Here goes slightly an explanation of what I am actually trying to achieve, and may be you can read any mistake through the steps:First I have implemented a SipServlet, Secondly a seperate Java Application handling the data persistence, (business logic, data layer implementation) using JPA, Hibernate EntityManger, this is packed as .jar file referenced/used in the SipServlet project, which is using the data layer. Then I deploy My_SipServlet.sar using sailfin web console.Third, copied all the required hibernate (and the third party libs) into $sailfin_home/lib, as well as, $sailfin_home/domain/domain1/applications/j2ee-modules/My_SipServlet/WEB-INF/lib/hibernate.jar* Fourth, I did go to sailfin admin web console and added a jdbc connection pool to the database I'd like to access. (did ping the connection and it is successful). Fifth, did place the persistence.xml (which specifies as a provider - Hibernate, and jta-data-source as jdbc/name_of_connection_pool created above) under '$sailfin_home/domain/domain1/applications/j2ee-modules/My_SipServlet/WEB-INF/classes/persistence.xml' Restarted sailfin and started testing - I have enabled logging and as I can see sailfin when it creates the EntityManager factory it fails, since it's trying to use the default oracle.toplink persistence. As I can see it's not even reading my persistence.xml file where I specify the provider. Where does it actually read oracle.toplink.Persistence - I wonder ? Have you experienced anything of the sort? I have read through blogs and forums and it seems a straight forward procedure of just copying the libs and providing persistence.xml with the right provider - but it's just not working for me. Any hints greatly appreciated,Many Thanks in advance, Persa
_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE!
http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/