0 Replies Latest reply on Feb 25, 2011 3:08 AM by Michel Werren

    Seam-persistence SMPC problem

    Michel Werren Newbie

      I try to use the SMPC for conversations


      first i add the producer field :



          @SeamManaged
          @ConversationScoped
          @Produces
          @PersistenceUnit
          @SMPC
          private EntityManagerFactory entityManagerFactory;




      Then i just try to use the SMPC like so



      @Stateful
      @ConversationScoped
      public class RuntimeConfigurationBusiness implements Serializable
      {
          private static final long serialVersionUID = 7161075159598261701L;
      
          @Inject
          @SMPC
          private EntityManager entityManager;
      
          public RuntimeConfiguration getRuntimeConfiguration()
          {
              Query query = entityManager.createQuery( "SELECT conf FROM RuntimeConfiguration as conf" );
              return (RuntimeConfiguration) query.getSingleResult();
          }
      }



      But when i access the EntityManager i get the exception




      javax.el.ELException: /backend/configuration/configurationView.xhtml @20,117 value="#{runtimeConfigurationView.runtimeConfiguration.defaultUserPassword}": javax.ejb.EJBException
       at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:107)
       at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:190)
       at javax.faces.component.ComponentStateHelper.eval(ComponentStateHelper.java:178)
       at javax.faces.component.UIOutput.getValue(UIOutput.java:168)
       at org.primefaces.util.ComponentUtils.getStringValueToRender(ComponentUtils.java:61)
       at org.primefaces.component.inputtext.InputTextRenderer.encodeMarkup(InputTextRenderer.java:86)
       at org.primefaces.component.inputtext.InputTextRenderer.encodeEnd(InputTextRenderer.java:53)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
       at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:59)
       at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:43)
       at org.primefaces.component.outputpanel.OutputPanelRenderer.encodeEnd(OutputPanelRenderer.java:44)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
       at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:59)
       at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:43)
       at org.primefaces.component.outputpanel.OutputPanelRenderer.encodeEnd(OutputPanelRenderer.java:44)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
       at com.sun.faces.renderkit.html_basic.HtmlBasicRenderer.encodeRecursive(HtmlBasicRenderer.java:295)
       at com.sun.faces.renderkit.html_basic.GridRenderer.renderRow(GridRenderer.java:185)
       at com.sun.faces.renderkit.html_basic.GridRenderer.encodeChildren(GridRenderer.java:129)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
       at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:55)
       at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:43)
       at org.primefaces.component.outputpanel.OutputPanelRenderer.encodeEnd(OutputPanelRenderer.java:44)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
       at org.primefaces.renderkit.CoreRenderer.renderChild(CoreRenderer.java:59)
       at org.primefaces.renderkit.CoreRenderer.renderChildren(CoreRenderer.java:43)
       at org.primefaces.component.panel.PanelRenderer.encodeContent(PanelRenderer.java:229)
       at org.primefaces.component.panel.PanelRenderer.encodeMarkup(PanelRenderer.java:152)
       at org.primefaces.component.panel.PanelRenderer.encodeEnd(PanelRenderer.java:75)
       at javax.faces.component.UIComponentBase.encodeEnd(UIComponentBase.java:878)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1620)
       at javax.faces.render.Renderer.encodeChildren(Renderer.java:168)
       at javax.faces.component.UIComponentBase.encodeChildren(UIComponentBase.java:848)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1613)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
       at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1616)
       at com.sun.faces.application.view.FaceletViewHandlingStrategy.renderView(FaceletViewHandlingStrategy.java:380)
       at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:126)
       at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
       at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:127)
       at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
       at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
       at javax.faces.webapp.FacesServlet.service(FacesServlet.java:313)
       at org.apache.catalina.core.StandardWrapper.service(StandardWrapper.java:1523)
       at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:279)
       at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:188)
       at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:641)
       at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:97)
       at com.sun.enterprise.web.PESessionLockingStandardPipeline.invoke(PESessionLockingStandardPipeline.java:85)
       at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:185)
       at org.apache.catalina.connector.CoyoteAdapter.doService(CoyoteAdapter.java:325)
       at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:226)
       at com.sun.enterprise.v3.services.impl.ContainerMapper.service(ContainerMapper.java:165)
       at com.sun.grizzly.http.ProcessorTask.invokeAdapter(ProcessorTask.java:791)
       at com.sun.grizzly.http.ProcessorTask.doProcess(ProcessorTask.java:693)
       at com.sun.grizzly.http.ProcessorTask.process(ProcessorTask.java:954)
       at com.sun.grizzly.http.DefaultProtocolFilter.execute(DefaultProtocolFilter.java:170)
       at com.sun.grizzly.DefaultProtocolChain.executeProtocolFilter(DefaultProtocolChain.java:135)
       at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:102)
       at com.sun.grizzly.DefaultProtocolChain.execute(DefaultProtocolChain.java:88)
       at com.sun.grizzly.http.HttpProtocolChain.execute(HttpProtocolChain.java:76)
       at com.sun.grizzly.ProtocolChainContextTask.doCall(ProtocolChainContextTask.java:53)
       at com.sun.grizzly.SelectionKeyContextTask.call(SelectionKeyContextTask.java:57)
       at com.sun.grizzly.ContextTask.run(ContextTask.java:69)
       at com.sun.grizzly.util.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:330)
       at com.sun.grizzly.util.AbstractThreadPool$Worker.run(AbstractThreadPool.java:309)
       at java.lang.Thread.run(Thread.java:619)
      Caused by: javax.ejb.EJBException
       at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:5119)
       at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:5017)
       at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:4805)
       at com.sun.ejb.containers.StatefulSessionContainer.postInvokeTx(StatefulSessionContainer.java:1656)
       at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:2004)
       at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1955)
       at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:198)
       at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:84)
       at $Proxy156.getRuntimeConfiguration(Unknown Source)
       at ch.rte.cms.business.applicationconfiguration.__EJB31_Generated__RuntimeConfigurationBusiness__Intf____Bean__.getRuntimeConfiguration(Unknown Source)
       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 org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:304)
       at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
       at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
       at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:298)
       at org.jboss.weld.bean.proxy.EnterpriseBeanProxyMethodHandler.invoke(EnterpriseBeanProxyMethodHandler.java:127)
       at org.jboss.weld.util.CleanableMethodHandler.invoke(CleanableMethodHandler.java:43)
       at ch.rte.cms.business.applicationconfiguration.RuntimeConfigurationBusiness_$$_javassist_52.getRuntimeConfiguration(RuntimeConfigurationBusiness_$$_javassist_52.java)
       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 org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:304)
       at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
       at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
       at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:298)
       at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:113)
       at org.jboss.weld.util.CleanableMethodHandler.invoke(CleanableMethodHandler.java:43)
       at ch.rte.cms.business.applicationconfiguration.RuntimeConfigurationBusiness_$$_javassist_70.getRuntimeConfiguration(RuntimeConfigurationBusiness_$$_javassist_70.java)
       at ch.rte.cms.view.configuration.RuntimeConfigurationView.getRuntimeConfiguration(RuntimeConfigurationView.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 org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:304)
       at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
       at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
       at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:298)
       at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:113)
       at org.jboss.weld.util.CleanableMethodHandler.invoke(CleanableMethodHandler.java:43)
       at ch.rte.cms.view.configuration.RuntimeConfigurationView_$$_javassist_68.getRuntimeConfiguration(RuntimeConfigurationView_$$_javassist_68.java)
       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.getValue(BeanELResolver.java:302)
       at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:175)
       at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:72)
       at com.sun.el.parser.AstValue.getValue(AstValue.java:116)
       at com.sun.el.parser.AstValue.getValue(AstValue.java:163)
       at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:219)
       at org.jboss.weld.el.WeldValueExpression.getValue(WeldValueExpression.java:71)
       at com.sun.faces.facelets.el.TagValueExpression.getValue(TagValueExpression.java:102)
       ... 66 more
      Caused by: java.lang.RuntimeException: org.hibernate.TransactionException: Could not find UserTransaction in JNDI [java:comp/UserTransaction]
       at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:132)
       at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:52)
       at org.jboss.seam.solder.bean.ImmutableBean.create(ImmutableBean.java:87)
       at org.jboss.weld.context.AbstractMapContext.get(AbstractMapContext.java:112)
       at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.getProxiedInstance(ClientProxyMethodHandler.java:143)
       at org.jboss.weld.bean.proxy.ClientProxyMethodHandler.invoke(ClientProxyMethodHandler.java:100)
       at org.jboss.weld.util.CleanableMethodHandler.invoke(CleanableMethodHandler.java:43)
       at javax.persistence.EntityManager_$$_javassist_71.createQuery(EntityManager_$$_javassist_71.java)
       at ch.rte.cms.business.applicationconfiguration.RuntimeConfigurationBusiness.getRuntimeConfiguration(RuntimeConfigurationBusiness.java:43)
       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 org.glassfish.ejb.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1056)
       at org.glassfish.ejb.security.application.EJBSecurityManager.invoke(EJBSecurityManager.java:1128)
       at com.sun.ejb.containers.BaseContainer.invokeBeanMethod(BaseContainer.java:5292)
       at com.sun.ejb.EjbInvocation.invokeBeanMethod(EjbInvocation.java:615)
       at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
       at com.sun.ejb.EjbInvocation.proceed(EjbInvocation.java:567)
       at org.jboss.weld.ejb.SessionBeanInterceptor.aroundInvoke(SessionBeanInterceptor.java:47)
       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 com.sun.ejb.containers.interceptors.AroundInvokeInterceptor.intercept(InterceptorManager.java:858)
       at com.sun.ejb.containers.interceptors.AroundInvokeChainImpl.invokeNext(InterceptorManager.java:797)
       at com.sun.ejb.containers.interceptors.InterceptorManager.intercept(InterceptorManager.java:367)
       at com.sun.ejb.containers.BaseContainer.__intercept(BaseContainer.java:5264)
       at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:5252)
       at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:190)
       ... 115 more
      Caused by: org.hibernate.TransactionException: Could not find UserTransaction in JNDI [java:comp/UserTransaction]
       at org.hibernate.transaction.JTATransactionFactory.getUserTransaction(JTATransactionFactory.java:173)
       at org.hibernate.transaction.JTATransactionFactory.createTransaction(JTATransactionFactory.java:149)
       at org.hibernate.jdbc.JDBCContext.registerSynchronizationIfPossible(JDBCContext.java:195)
       at org.hibernate.impl.SessionImpl.checkTransactionSynchStatus(SessionImpl.java:2102)
       at org.hibernate.impl.SessionImpl.isOpen(SessionImpl.java:357)
       at org.hibernate.ejb.AbstractEntityManagerImpl.joinTransaction(AbstractEntityManagerImpl.java:931)
       at org.hibernate.ejb.AbstractEntityManagerImpl.postInit(AbstractEntityManagerImpl.java:154)
       at org.hibernate.ejb.EntityManagerImpl.<init>(EntityManagerImpl.java:84)
       at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:111)
       at org.hibernate.ejb.EntityManagerFactoryImpl.createEntityManager(EntityManagerFactoryImpl.java:106)
       at com.sun.enterprise.container.common.impl.EntityManagerFactoryWrapper.createEntityManager(EntityManagerFactoryWrapper.java:101)
       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 org.jboss.weld.util.reflection.SecureReflections$13.work(SecureReflections.java:304)
       at org.jboss.weld.util.reflection.SecureReflectionAccess.run(SecureReflectionAccess.java:54)
       at org.jboss.weld.util.reflection.SecureReflectionAccess.runAsInvocation(SecureReflectionAccess.java:163)
       at org.jboss.weld.util.reflection.SecureReflections.invoke(SecureReflections.java:298)
       at org.jboss.weld.bean.builtin.CallableMethodHandler.invoke(CallableMethodHandler.java:64)
       at org.jboss.weld.util.CleanableMethodHandler.invoke(CleanableMethodHandler.java:43)
       at javax.persistence.EntityManagerFactory_$$_javassist_72.createEntityManager(EntityManagerFactory_$$_javassist_72.java)
       at org.jboss.seam.persistence.ManagedPersistenceContextBeanLifecycle.create(ManagedPersistenceContextBeanLifecycle.java:111)
       ... 144 more
      Caused by: javax.naming.NamingException: Lookup failed for 'java:comp/UserTransaction' in SerialContext [Root exception is javax.naming.NameNotFoundException: Lookup of java:comp/UserTransaction not allowed for Container managed Transaction beans]
       at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:442)
       at javax.naming.InitialContext.lookup(InitialContext.java:392)
       at javax.naming.InitialContext.lookup(InitialContext.java:392)
       at org.hibernate.transaction.JTATransactionFactory.getUserTransaction(JTATransactionFactory.java:163)
       ... 166 more
      Caused by: javax.naming.NameNotFoundException: Lookup of java:comp/UserTransaction not allowed for Container managed Transaction beans
       at com.sun.ejb.containers.BaseContainer.checkUserTransactionLookup(BaseContainer.java:830)
       at com.sun.ejb.EjbInvocation.userTransactionLookupAllowed(EjbInvocation.java:423)
       at com.sun.enterprise.transaction.TransactionNamingProxy.checkUserTransactionLookupAllowed(TransactionNamingProxy.java:136)
       at com.sun.enterprise.transaction.TransactionNamingProxy.handle(TransactionNamingProxy.java:109)
       at com.sun.enterprise.naming.impl.NamedNamingObjectManager.tryNamedProxies(NamedNamingObjectManager.java:84)
       at com.sun.enterprise.naming.impl.JavaURLContext.lookup(JavaURLContext.java:153)
       at com.sun.enterprise.naming.impl.SerialContext.lookup(SerialContext.java:428)
       ... 169 more
      |#]



      Anyone has a suggestion what i make wrong?