[
https://issues.apache.org/jira/browse/OWB-590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13062769#comment-13062769
]
Mark Struberg commented on OWB-590:
-----------------------------------
Thomas, I debugged into your sample and it turned out that this is a bug in
Seam.
seam-persistence relies on the absence of javax.ejb.Stateless in
EnvironmentUtils.isEEEnvironment() and only then properly sets up the
EntityManager stuff. This is not a valid assumption!
I suggest to just create the EntityManager producer yourself in a small bean -
or you can take a look on CODIs @Transactional. It isn't as feature rich as the
pendant from Seam, but only trimmed down to the bare core (e.g. currently no
JTA support). But for 98% of the cases it should work well.
> Seam Persistence does not work with OWB - AfterBeanDiscovery.addBean will be
> ignored
> ------------------------------------------------------------------------------------
>
> Key: OWB-590
> URL: https://issues.apache.org/jira/browse/OWB-590
> Project: OpenWebBeans
> Issue Type: Bug
> Components: Events, Injection and Lookup
> Affects Versions: 1.1.1
> Environment: Owb 1.1.1-SNAPSHOT, Seam Faces, Seam Persistence, Seam
> Security, Seam Validation, MyFaces 2.1.1,
> Reporter: Thomas Andraschko
> Assignee: Gurkan Erdogdu
>
> AFAICS In org.jboss.seam.persistence.ManagedPersistenceContextExtension a
> bean for the EntityManager will be generated and added in the
> AfterBeanDiscovery event but OWB says that there is no bean/producer
> available:
> javax.enterprise.inject.UnsatisfiedResolutionException: Api type
> [javax.persistence.EntityManager] is not found with the qualifiers
> Qualifiers: [@javax.enterprise.inject.Default()]
> for injection into Field Injection Point, field name : entityManager, Bean
> Owner : [UserDaoImpl, Name:null, WebBeans Type:MANAGED, API
> Types:[java.io.Serializable,java.lang.Object,de.test.jpa.UserDaoImpl,de.test.jpa.UserDao],
> Qualifiers:[javax.enterprise.inject.Any,javax.enterprise.inject.Default]]
> at
> org.apache.webbeans.util.InjectionExceptionUtils.throwUnsatisfiedResolutionException(InjectionExceptionUtils.java:92)
> at
> org.apache.webbeans.container.ResolutionUtil.checkResolvedBeans(ResolutionUtil.java:98)
> at
> org.apache.webbeans.container.InjectionResolver.checkInjectionPoints(InjectionResolver.java:193)
> at
> org.apache.webbeans.container.BeanManagerImpl.validate(BeanManagerImpl.java:1148)
> at
> org.apache.webbeans.config.BeansDeployer.validate(BeansDeployer.java:390)
> at
> org.apache.webbeans.config.BeansDeployer.validateInjectionPoints(BeansDeployer.java:334)
> at
> org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:177)
> at
> org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:129)
> at
> org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:87)
> at
> org.apache.webbeans.servlet.WebBeansConfigurationListener.contextInitialized(WebBeansConfigurationListener.java:81)
> at
> org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4723)
> at
> org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5226)
> at
> org.apache.catalina.core.StandardContext$1.call(StandardContext.java:5221)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
> at java.util.concurrent.FutureTask.run(FutureTask.java:166)
> at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
> at java.lang.Thread.run(Thread.java:636)
> A sample project is available here: http://www.megaupload.com/?d=0CF4EVCP
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira