[jetty-user] Extra setup for Jetty/Atomikos/Hibernate/JPA to get EntityManagerFactory reference in J2SE web application?

Justin Cranford <[email protected]> Mon, 23 Jan 2012 15:53:00 -0500
Newsgroups gmane.comp.java.jetty.support
Message-ID <[email protected]>



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