Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6200949
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T04:27:43+00:00 2026-05-24T04:27:43+00:00

I have a project (EJB 3.0, packaged as EAR) with a view (JSF 2.0)

  • 0

I have a project (EJB 3.0, packaged as EAR) with a view (JSF 2.0) and persistence (JPA 2.0, Hibernate) layer. To avoid the lazy initialization support and other issues I tried to introduce a Seam Managed Persistence Context with Seam 3.0.0.Final.
For this i wrote the following producer class:

import javax.enterprise.context.ConversationScoped;
import javax.enterprise.inject.Produces;
import javax.persistence.EntityManagerFactory;
import javax.persistence.PersistenceUnit;

import org.jboss.seam.solder.core.ExtensionManaged;

class PersistenceProvider {
    @ExtensionManaged
    @Produces
    @PersistenceUnit
    @ConversationScoped
    private EntityManagerFactory producerField;
}

And changed the @PersistenceContext Annotation on my EntityManager fields to @Inject.

If Iam trying to use the EntityManager now I’m getting the following stacktrace:

<WARNUNG: StandardWrapperValve[Faces Servlet]: PWC1406: Servlet.service() for servlet Faces Servlet threw exception
javax.faces.el.EvaluationException: java.lang.RuntimeException: java.lang.RuntimeException: Could not find EntityManagerFactory bean with qualifiers[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]
 at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
 at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
 at javax.faces.component.UICommand.broadcast(UICommand.java:315)
 at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:794)
 at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1259)
 at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:81)
 at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
 at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
 at javax.faces.webapp.FacesServlet.service(FacesServlet.java:409)
 at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1534)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:281)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
 at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:655)
 at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:595)
 at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:98)
 at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:91)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:162)
 at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:326)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:227)
 at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:170)
 at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:822)
 at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:719)
 at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:1013)
 at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:225)
 at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:137)
 at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:104)
 at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:90)
 at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:79)
 at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:54)
 at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:59)
 at com.sun.grizzly.ContextTask.run(ContextTask.java:71)
 at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:532)
 at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:513)
 at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Could not find EntityManagerFactory bean with qualifiers[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]
 at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:126)
 at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:46)
 at org.jboss.seam.solder.bean.ImmutableBean.create(ImmutableBean.java:87)
 at org.jboss.weld.context.AbstractContext.get(AbstractContext.java:121)
 at org.jboss.weld.bean.proxy.ContextBeanInstance.getInstance(ContextBeanInstance.java:99)
 at org.jboss.weld.bean.proxy.ProxyMethodHandler.invoke(ProxyMethodHandler.java:124)
 at org.jboss.weld.proxies.SMPC-org$jboss$seam$persistence$ManagedPersistenceContextExtension-de$wintersolutions$fitnessbuddy$persistence$cdi$PersistenceProvider$producerField[@javax$enterprise$context$ConversationScoped()@javax$enterprise$inject$Produces()@javax$persistence$PersistenceUnit(name=,unitName=)@org$jboss$seam$solder$core$ExtensionManaged()]_$$_WeldClientProxy.persist(SMPC-org$jboss$seam$persistence$ManagedPersistenceContextExtension-de$wintersolutions$fitnessbuddy$persistence$cdi$PersistenceProvider$producerField[@javax$enterprise$context$ConversationScoped()@javax$enterprise$inject$Produces()@javax$persistence$PersistenceUnit(name=,unitName=)@org$jboss$seam$solder$core$ExtensionManaged()]_$$_WeldClientProxy.java)
 at de.wintersolutions.fitnessbuddy.view.controller.ExerciseController.saveExercise(ExerciseController.java:54)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at javax.el.BeanELResolver.invokeMethod(BeanELResolver.java:737)
 at javax.el.BeanELResolver.invoke(BeanELResolver.java:467)
 at javax.el.CompositeELResolver.invoke(CompositeELResolver.java:254)
 at com.sun.el.parser.AstValue.invoke(AstValue.java:228)
 at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:297)
 at org.jboss.weld.util.el.ForwardingMethodExpression.invoke(ForwardingMethodExpression.java:43)
 at org.jboss.weld.el.WeldMethodExpression.invoke(WeldMethodExpression.java:56)
 at com.sun.faces.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:105)
 at javax.faces.component.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
 ... 33 more
Caused by: java.lang.RuntimeException: Could not find EntityManagerFactory bean with qualifiers[@javax.enterprise.inject.Any(), @javax.enterprise.inject.Default()]
 at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.getEntityManagerFactory(ManagedPersistenceContextBeanLifecycle.java:210)
 at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:104)
 ... 53 more

Debugging the applicaton on Glassfish 3.1 provided me with the following insights

The entity manager is a proxy of the type

entityManager SMPC-org$jboss$seam$persistence$ManagedPersistenceContextExtension-com$example$PersistenceProvider$producerField[@javax$enterprise$context$ConversationScoped()@javax$enterprise$inject$Produces()@javax$persistence$PersistenceUnit(name=,unitName=)@org$jboss$seam$solder$core$ExtensionManaged()]_$$_WeldClientProxy

The producer field can’t be found in the beans-Field of the BeanManager in the scope of the method org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.getEntityManagerFactory but in a BeanManager injected into my DAOs.

I tried some variations like qualifiying the producer field, trying to inject a entity manager in the view layer services and adding the unitName and/or name of my persistence unit to the @PersistenceUnit Annotation of the producer field.

Any suggestions what Im doing wrong here?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T04:27:44+00:00Added an answer on May 24, 2026 at 4:27 am

    Seems like when there is no Conversation (or Session) scope active in EJB’s MDB.

    You need manually active one. You can do it by implementing your MDB with the following messageHandler:

    @Inject
    private BoundConversationContext boundConversationContext;
    
    public void onMessage(Message message) {
        BoundRequest boundRequest = null;
        try {
            boundRequest = new MutableBoundRequest(new HashMap<String, Object>(), new HashMap<String, Object>());
            boundConversationContext.associate(boundRequest);
            if (!boundConversationContext.isActive())
                boundConversationContext.activate();
            // DO YOUR BUSINESS LOGIC HERE
        } finally {
            if (boundConversationContext != null) {
                if (boundRequest != null)
                    boundConversationContext.dissociate(boundRequest);
                if (boundConversationContext.isActive()) {
                    boundConversationContext.deactivate();
                }
            }
        }   
    }
    

    That worked for me on Jboss 6 AS, when tried to integrate an MDB with seam persistence.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I want to have a project with both EJB/JPA sourcecode and JSF in
I would like to implement pagination in my Servlet/EJB/JPA-Hibernate project, but I can't figure
I have an EJB project setup in the following way EAR Project EJB Proj
I have separated a Java EE project in the following submodules: project-war project-ejb project-ear
I've been working on a Java EE 6 project (EJB 3.1, JSF 2, JPA
I have an EAR file with a nested EJB project, a .war dynamic web
I'm working on a project which includes persistence library (JPA 1.2), EJB 3 and
I have created an EAR with a web project, ejb3 project and the ejb
I have an old EJB (2.1) project that uses xdoclet (1.2.3) to generate the
We have an old project written with EJB 2.1. Now we need to extend

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.