[ 
https://issues.jboss.org/browse/SEAMPERSIST-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12610185#comment-12610185
 ] 

Mark Bell commented on SEAMPERSIST-53:
--------------------------------------

Jason - I'm not sure your reading this correctly.  The issue isn't the scoping 
of the injected EntityManager, nor the scoping of the persistence unit 
producer.  The issue is the scoping of the EntityTransaction class within seam 
persistence.  Specifically org.jboss.seam.transaction.EntityTransaction which 
has a @RequestScoped annotation on the class.  What Benjamin Wirtz and myself 
are referring to is removing this annotation from the class and rebuilding the 
seam-persistance jar.

> Injected EntityManager can not be invoked in java se 
> -----------------------------------------------------
>
>                 Key: SEAMPERSIST-53
>                 URL: https://issues.jboss.org/browse/SEAMPERSIST-53
>             Project: Seam Persistence
>          Issue Type: Bug
>    Affects Versions: 3.0.0.Final
>         Environment: weld-se-1.1.1,seam-persistence 3.0.0 and 3.0.1-SNAPSHOT
>            Reporter: Liu Jianhong
>
> When call entityManager.toString(), entityManager.persist() addn so on ,it 
> produces WELD-001303 error:
> Exception in thread "main" org.jboss.weld.context.ContextNotActiveException: 
> WELD-001303 No active contexts for scope type 
> javax.enterprise.context.RequestScoped
>       at 
> org.jboss.weld.manager.BeanManagerImpl.getContext(BeanManagerImpl.java:664)
>       at 
> org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:77)
>       at 
> org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:87)
>       at 
> org.jboss.seam.transaction.org$jboss$weld$bean-classpath-ManagedBean-org$jboss$seam$transaction$EntityTransaction$@javax$enterprise$context$RequestScoped()@org$jboss$seam$config$xml$core$XmlConfiguredBean()@org$jboss$seam$transaction$DefaultTransaction()${org$jboss$seam$transaction$EntityTransaction$entityManager$@javax$inject$Inject()$$org$jboss$seam$transaction$EntityTransaction$persistenceProvider$@javax$inject$Inject()$$org$jboss$seam$transaction$EntityTransaction$init$@javax$inject$Inject()$(org$jboss$seam$transaction$Synchronizations)$}_$$_WeldClientProxy.isActive(org$jboss$weld$bean-classpath-ManagedBean-org$jboss$seam$transaction$EntityTransaction$@javax$enterprise$context$RequestScoped()@org$jboss$seam$config$xml$core$XmlConfiguredBean()@org$jboss$seam$transaction$DefaultTransaction()${org$jboss$seam$transaction$EntityTransaction$entityManager$@javax$inject$Inject()$$org$jboss$seam$transaction$EntityTransaction$persistenceProvider$@javax$inject$Inject()$$org$j!
 
boss$seam$transaction$EntityTransaction$init$@javax$inject$Inject()$(org$jboss$seam$transaction$Synchronizations)$}_$$_WeldClientProxy.java)
>       at 
> org.jboss.seam.persistence.ManagedPersistenceContextProxyHandler.joinTransaction(ManagedPersistenceContextProxyHandler.java:126)
>       at 
> org.jboss.seam.persistence.ManagedPersistenceContextProxyHandler.invoke(ManagedPersistenceContextProxyHandler.java:114)
>       at $Proxy36.toString(Unknown Source)
>       at java.lang.String.valueOf(String.java:2826)
>       at java.io.PrintStream.println(PrintStream.java:771)
>       at test.UserFacet.save(UserFacet.java:27)
>       at test.Main.main(Main.java:17)

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

       

_______________________________________________
seam-issues mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/seam-issues

Reply via email to