[seam-issues] [JBoss JIRA] Commented: (SEAMPERSIST-53) Injected EntityManager can not be invoked in java se
Jason Porter (JIRA)
jira-events at lists.jboss.org
Sat Jun 18 04:31:23 EDT 2011
[ https://issues.jboss.org/browse/SEAMPERSIST-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609571#comment-12609571 ]
Jason Porter commented on SEAMPERSIST-53:
-----------------------------------------
When you're running in SE you don't really have any of the scopes save @ApplicationScoped. It's just part of running in SE because CDI was specified to only run in EE (but all of the three implementations work in SE) and other scopes don't really have a good mapping in an SE application.
> 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$jboss$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
More information about the seam-issues
mailing list