[jboss-user] [JBoss Seam] - Re: SeamEntityConverter - Cannot access entityManager

giannidoe do-not-reply at jboss.com
Thu Mar 8 05:48:42 EST 2007


Thanks, after trying to inject EntityManager with "@In EntityManager entityManager" I can see it's a problem with the JNDI binding.

I'm running on Glassfish and I've tried the following:

components.xml
---------------------
<core:managed-persistence-context name="entityManager" 
    persistence-unit-jndi-name="java:comp/env/persistence/Orpello-PU"
    auto-create="true" />

in web.xml
---------------------
<persistence-context-ref>
    <persistence-context-ref-name>persistence/Orpello-PU</persistence-context-ref-name>
    <persistence-unit-name>Orpello-PU</persistence-unit-name>
</persistence-context-ref>

persistence.xml
---------------------
<persistence-unit name="Orpello-PU" transaction-type="JTA">


.. and i get

Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/persistence/Orpello-PU
  at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:751)
  at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:156)
  at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:307)
  at javax.naming.InitialContext.lookup(InitialContext.java:392)
  at org.jboss.seam.core.ManagedPersistenceContext.getEntityManagerFactoryFromJndiOrValueBinding(ManagedPersistenceContext.java:160)
  ... 115 more
  
Maybe getting a bit off-topic here but can anyone help on how I should bind the entity manager into JNDI in Glassfish?
>From what I have read the <persistence-context-ref> in web.xml should do it.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4026197#4026197

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4026197



More information about the jboss-user mailing list