Re: [jetty-user] Extra setup for Jetty/Atomikos/Hibernate/JPA to get EntityManagerFactory reference in J2SE web application?
Cemo <[email protected]> Mon, 23 Jan 2012 22:57:43 +0200
| Newsgroups | gmane.comp.java.jetty.support |
|---|---|
| Message-ID | <CAMd6iMi0ejL-YyyF0PXBCJVKYchVghj=+_8PFL=Q-6jSGsPG8Q@mail.gmail.com> |
Hi Justin, I am not sure it is an again JNDI conflict but hope this helps. It seems to me quite similar. http://javaadventure.blogspot.com/2010/03/openejb-jetty-and-maven-transaction.html On 23 January 2012 22:53, Justin Cranford <[email protected]>wrote: > Hi, > > I am running Jetty Hightide 8.0.4. I set up my Derby and Atomikos context > according to this wiki. > > http://docs.codehaus.org/display/JETTY/Atomikos > > Note I am using the J2SE Atomikos classes > (com.atomikos.icatch.jta.UserTransactionManager and > com.atomikos.icatch.jta.UserTransactionImp), not the J2EE classes > (com.atomikos.icatch.jta.J2eeTransactionManager and > com.atomikos.icatch.jta.J2eeUserTransaction). > > The context works fine; I can do JNDI lookups for > "java:/comp/env/jdbc/myDS" and "java:comp/env/TransactionManager" and use > them to execute some SQL. > > > What other configuration is required get EntityManagerFactory and > EntityManager? Is there extra context and config information required to > setup Hibernate/JPA to use the Atomikos DataSource and TransactionManager? > > I tried @PersistenceContext in my web application, but it is NULL. I > assume it is not injected because my app is J2SE, not J2EE. > > Your help is appreciated. Thank you. > > Sincerely, > Justin >