[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
Tue Jun 21 04:00:24 EDT 2011
[ https://issues.jboss.org/browse/SEAMPERSIST-53?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12609968#comment-12609968 ]
Jason Porter commented on SEAMPERSIST-53:
-----------------------------------------
Yes, you can remove the @RequsetScoped or @ConversationScoped (this is telling Seam Persistence what you want the EntityManager to be scoped), but your entity manager will be DependentScoped. You may not see a lot of problems, but in a web app you may have to do some extra merge() operations because your transaction manager will no longer be around and any entities will have been detached.
> 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