users@glassfish.java.net

Re: Hibernate persistence integration in Glassfish

From: Sahoo <Sahoo_at_Sun.COM>
Date: Sun, 03 Feb 2008 19:00:21 +0530

Hi Persa,

I don't understand why you are directly changing files under
$sailfin_home/domain/domain1/applications/j2ee-modules/My_SipServlet/.
You should be modifying the sar file before deploying. Can you please
try the following steps and let us know what you see?

1. copy Hibernate and related jars to $sailfin_home/lib (You can skip
this if you have already done so). Restart Sailfin.
2. change your persistence.xml to specify the correct data-source name
and provider name, rebuild the sar file.
3. deploy the sar file into Sailfin.

Now access your application.

Thanks,
Sahoo

Persa Zaloshnja wrote:
>
> 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! MSN Messenger
> <http://clk.atdmt.com/AVE/go/onm00200471ave/direct/01/>