Im trying to convert our RC3 apps to RC4-PFD but I cannot get EntityManager
lookup through JNDI to work. Similar posts have already been posted , but I
have read them and none have concluded with an answer to this.
The following persistence.xml registers my entitymanager in JNDI just fine.
| <persistence>
| <persistence-unit name="test">
| <jta-data-source>java:testDS</jta-data-source>
| <properties>
| <property name="jboss.entity.manager.jndi.name"
value="java:/EntityManagers/testEM"/>
| <property name="jboss.entity.manager.factory.jndi.name"
value="java:/EntityManagers/testEMFactory"/>
| <property name="hibernate.hbm2ddl.auto" value="update"/>
| <property name="hibernate.show_sql" value="false" />
| </properties>
| </persistence-unit>
| </persistence>
|
So far so good and I can see in the JNDI view service in JMX-Console that it is
registred correct
| java: Namespace
| EntityManagers (class: org.jnp.interfaces.NamingContext)
| | +- testEMFactory (class:
org.jboss.ejb3.entity.InjectedEntityManagerFactory)
| | +- testEM (class: org.jboss.ejb3.entity.InjectedEntityManager)
|
, but when i try to look it up it just returns null....
| EntityManager em = (EntityManager)ctx.lookup("java:/EntityManagers/testEM");
|
No exception...nothing..the "em" variable just gets set to null.
Best regards
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3920655#3920655
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3920655
-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems? Stop! Download the new AJAX search engine that makes
searching your log files as easy as surfing the web. DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
JBoss-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jboss-user