users@glassfish.java.net

Disabling embedded Persistence support?

From: <glassfish_at_javadesktop.org>
Date: Wed, 23 Jul 2008 11:29:15 PDT

Hello,
I have a webapp containing some persistence beans coded to JPA, but backed up by Spring and Hibernate, the idea is to have everything needed in a .war, so it runs on 'plain' Servlet containers such as Tomcat. And on Tomcat it runs just fine.

Now, the problem is, how do I tell Glassfish to ignore all the JPA-related annotations and leave all JPA-related things to Hibernate + Spring?

Mostly things like javax.persistence.PersistenceContext. Glassfish 2 fails with "Could not resolve a persistence unit corresponding to the blah blah blah" error, witch from its point of view is correct, it doesn't know anything about that Persistence Context, Spring does. Now, how do I tell Glassfish not to look for it?

Of course, I can change that annotation to Spring's autowire annotation or something else entirely, but it just doesn't seem right.

Thanks in advance, greetings, Lilianne
[Message sent by forum member 'lilianne_blaze' (lilianne_blaze)]

http://forums.java.net/jive/thread.jspa?messageID=288773