|
View:
New views
4 Messages
—
Rating Filter:
Alert me
|
|
|
Tomcat InjectionHello, After reading some documentation, I though I had my injection code worked out, but apparently not. I am using Tomcat with OpenJPA. In my class, I have: @PersistenceUnit(unitName = "CallScheduler") private @Resource(name="bean/OpenJPAEMF")OpenJPAEntityManagerFactory emf; In my META-INF/context.xml, I have: <Resource name="bean/OpenJPAEMF" auth="Container" factory="org.apache.openjpa.persistence.OpenJPAEntityManagerFactory" type="org.apache.openjpa.persistence.OpenJPAEntityManagerFactory.class" /> While executing a method in my class, emf is still null. How should I instantiate emf? I am under the impression that OpenJPAPersistence.createEntityManagerFactory is for unmanaged code... Eric -- View this message in context: http://n2.nabble.com/Tomcat-Injection-tp395699p395699.html Sent from the OpenJPA Users mailing list archive at Nabble.com. |
|
|
Re: Tomcat InjectionI tried: emf = OpenJPAPersistence.getEntityManagerFactory(); but it doesn't find persistence.xml, and raises: <openjpa-1.1.0-r422266:657916 fatal user error> org.apache.openjpa.persistence.ArgumentException: A JDBC Driver or DataSource class name must be specified in the ConnectionDriverName property. Are there any samples out there? The ones included with OpenJPA don't include any managed resources. -- View this message in context: http://n2.nabble.com/Tomcat-Injection-tp395699p395729.html Sent from the OpenJPA Users mailing list archive at Nabble.com. |
|
|
|
|
|
|
| Free Forum Powered by Nabble | Forum Help |