-
1. Re: EntityManager always Null (Using Jboss,Seam)
kasim Nov 10, 2006 8:31 AM (in response to lara)
thats not really the way you set the entity manager
You need to use the persistence context annotation to create it. (extended type is optional)
@PersistenceContext(type=EXTENDED)
private EntityManager em; -
2. Re: EntityManager always Null (Using Jboss,Seam)
pmuir Nov 10, 2006 8:46 AM (in response to lara)"kasim" wrote:
thats not really the way you set the entity manager
You need to use the persistence context annotation to create it. (extended type is optional)
@PersistenceContext(type=EXTENDED)
private EntityManager em;
No, lara is injecting the EntityManager in the correct fashion (when using a Seam Managed Persistence Context).
Lara, does injecting an entity manager (using @In) work at all in your app? Do other injections work? Post components.xml please. -
3. Re: EntityManager always Null (Using Jboss Seam)
lara Nov 10, 2006 9:06 AM (in response to lara)Thanks for replying..
Well yes injection works in my application. I am accessing the entityManager from a stateful session bean and it worked perfectly.
Below is my components.xml file:
<?xml version="1.0" encoding="utf-8"?>
true
bpmshell/#{ejbName}/local
java:/bpmshellEntityManagerFactory -
4. Re: EntityManager always Null (Using Jboss Seam)
lara Nov 10, 2006 9:07 AM (in response to lara)Thanks for replying..
Well yes injection works in my application. I am accessing the entityManager from a stateful session bean and it worked perfectly.
Below is my components.xml file:
<?xml version="1.0" encoding="utf-8"?>
true
bpmshell/#{ejbName}/local
java:/bpmshellEntityManagerFactory
Thanks gain -
5. Re: EntityManager always Null (Using Jboss,Seam)
pmuir Nov 10, 2006 9:09 AM (in response to lara)Please post using [ code ] tags. Please post the class that isn't working. I take it no exceptions are thrown?
-
6. Re: EntityManager always Null (Using Jboss,Seam)
lara Nov 10, 2006 9:16 AM (in response to lara)I am extremely sorry..
Below is my components.xml file:<?xml version="1.0" encoding="utf-8"?> <components> <component name="org.jboss.seam.core.init"> <property name="myFacesLifecycleBug">true</property> <property name="jndiPattern">bpmshell/#{ejbName}/local</property> </component> <component name="entityManager" class="org.jboss.seam.core.ManagedPersistenceContext"> <property name="persistenceUnitJndiName">java:/bpmshellEntityManagerFactory</property> </component> </components>
Regards -
7. Re: EntityManager always Null (Using Jboss,Seam)
lara Nov 10, 2006 9:19 AM (in response to lara)By the way, I don't think it is a problem due to components.xml because as I said previously, I was able to inject the entityManager inside a stateful session bean and it worked perfectly.
-
8. Re: EntityManager always Null (Using Jboss,Seam)
kasim Nov 10, 2006 9:22 AM (in response to lara)"petemuir" wrote:
No, lara is injecting the EntityManager in the correct fashion (when using a Seam Managed Persistence Context).
Lara, does injecting an entity manager (using @In) work at all in your app? Do other injections work? Post components.xml please.
ahhh my bad ... i didnt realize thats what she was doing at first .... i guess i read the post too fast.