1 2 Previous Next 21 Replies Latest reply on Aug 3, 2015 8:26 AM by Chris Pike

    CMT, RuntimeEnivronment Configuration

    jimmy001 Apprentice

      Hello,

       

      I am trying to embed jbpm6 in a web application. I want to use jpa persistence.

      Here some code:

       

      @Startup
      @Singleton
      public class InitializeDemoData {
      
          private static final Logger LOG = LoggerFactory
                  .getLogger(InitializeDemoData.class);
         
          @PersistenceUnit(unitName="org.jbpm.persistence.jpa")
          EntityManagerFactory emf;
      
      
          /**
           * The method is intended to set up all necessary data to start up
           * . Currently it sets up a bunch of test data.
           */
          @PostConstruct   
          public void init() {
              createKIEModule();
      
          }
      
          private void createKIEModule() {
      
                     
              // first configure environment that will be used by RuntimeManager
              //
               RuntimeEnvironment environment = RuntimeEnvironmentBuilder.Factory
               .get()
               .newEmptyBuilder()
               .addEnvironmentEntry(EnvironmentName.TRANSACTION_MANAGER, new ContainerManagedTransactionManager())                
               .entityManagerFactory(emf)
               .addAsset(
               ResourceFactory
               .newClassPathResource("myDesignedProcess.bpmn2"),
               ResourceType.BPMN2).get();
      
              // next create RuntimeManager - in this case singleton strategy is
              // chosen
      
               RuntimeManager manager = RuntimeManagerFactory.Factory.get()
               .newSingletonRuntimeManager(environment);
              //
              // // then get RuntimeEngine out of manager - using empty context as
              // // singleton does not kep track
              //
              // // of runtime engine as there is only one
              //
               RuntimeEngine runtimeEngine = manager.getRuntimeEngine(EmptyContext
               .get());
      
              // get KieSession from runtime runtimeEngine - already initialized with
              // all handlers, listeners, etc that were configured
      
              // on the environment
      
               KieSession ksession = runtimeEngine.getKieSession();
      
              // add invocations to the process engine here,
      
              // e.g.
      
              ksession.startProcess("evaluation");
          }
         
      }
      
      
      

       

      in persistence.xml

      
      
      
      
      <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup"/>
      
      
      
      
      <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.CMTTransactionFactory"/>
      
      
      
      
      
      
      
      
      
      
      

       

      I end up with

       

      Caused by: javax.naming.NameNotFoundException: UserTransaction [Root exception is java.lang.IllegalStateException: JBAS014237: Only session and message-driven beans with bean-managed transaction demarcation are allowed to access UserTransaction]

          at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:140)

          at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:81)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:202)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)

          at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:235)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:188)

          at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)

          at javax.naming.InitialContext.lookup(Unknown Source) [rt.jar:1.7.0_60]

          at javax.naming.InitialContext.lookup(Unknown Source) [rt.jar:1.7.0_60]

          at org.drools.persistence.jta.JtaTransactionManager.findUserTransaction(JtaTransactionManager.java:131) [drools-persistence-jpa-6.2.0.CR4.jar:6.2.0.CR4]

          ... 72 more

      Caused by: java.lang.IllegalStateException: JBAS014237: Only session and message-driven beans with bean-managed transaction demarcation are allowed to access UserTransaction

          at org.jboss.as.ejb3.component.allowedmethods.AllowedMethodsInformation.realCheckPermission(AllowedMethodsInformation.java:138) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

          at org.jboss.as.ejb3.component.allowedmethods.AllowedMethodsInformation.checkAllowed(AllowedMethodsInformation.java:112) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

          at org.jboss.as.ejb3.subsystem.EJB3UserTransactionAccessControlService$1.authorizeAccess(EJB3UserTransactionAccessControlService.java:53) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

          at org.jboss.as.txn.service.UserTransactionAccessControlService.authorizeAccess(UserTransactionAccessControlService.java:83)

          at org.jboss.as.txn.service.UserTransactionBindingService$1.getReference(UserTransactionBindingService.java:71)

          at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:131)

       

       

      What am I missing?

      Thx for your help.

      J.

        • 1. Re: CMT, RuntimeEnivronment Configuration
          Maciej Swiderski Master

          since you're running on JBoss use jboss specific transaction manager look up and not WebSphere.

           

          Here you can find two sample applications where one is CDI based and the other is EJB based which embeds jBPM services - version 6.2. If you need to run on older version look at the branch of the same projects here.

           

          HTH

          1 of 1 people found this helpful
          • 2. Re: CMT, RuntimeEnivronment Configuration
            jimmy001 Apprentice

            Thx for your response.

            The first linked example works on JBoss 7 (after removing dom4j from WEB-INF/libs) but it fails with the same error on Wildfly 8.2.

            I assume it is related with https://issues.jboss.org/browse/WFLY-22.

             

            Additionally to the repository configuration I tried:

            <property name="hibernate.transaction.factory_class" value="org.hibernate.transaction.CMTTransactionFactory"/>

            <property name="hibernate.transaction.jta.platform" value="org.hibernate.service.jta.platform.internal.JBossAppServerJtaPlatform"/>

             

            But the same error.

             

            Any suggestions?

            J.

            • 3. Re: CMT, RuntimeEnivronment Configuration
              Maciej Swiderski Master

              could you please attach complete stack trace?

              • 4. Re: CMT, RuntimeEnivronment Configuration
                jimmy001 Apprentice

                2015-03-02 13:00:29,543 ERROR [stderr] (ServerService Thread Pool -- 59) ScriptEngineManager providers.next(): javax.script.ScriptEngineFactory: Provider jdk.nashorn.api.scripting.NashornScriptEngineFactory not found

                 

                2015-03-02 13:00:29,825 INFO  [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (ServerService Thread Pool -- 59) KieModule was added:ZipKieModule[ ReleaseId=org.jbpm:Evaluation:1.0file=C:\Users\XXX\.m2\repository\org\jbpm\Evaluation\1.0\Evaluation-1.0.jar]

                2015-03-02 13:00:30,012 WARN  [org.jbpm.services.task.HumanTaskConfigurator] (ServerService Thread Pool -- 59) No default interceptor found of type org.jbpm.services.task.persistence.TaskTransactionInterceptor might be mssing jbpm-human-task-jpa module on classpath (error null: java.lang.reflect.InvocationTargetException

                    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_45]

                    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_45]

                    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_45]

                    at java.lang.reflect.Constructor.newInstance(Constructor.java:526) [rt.jar:1.7.0_45]

                    at org.jbpm.services.task.HumanTaskConfigurator.addDefaultInterceptor(HumanTaskConfigurator.java:168) [jbpm-human-task-core-6.2.0.CR4.jar:6.2.0.CR4]

                    at org.jbpm.services.task.HumanTaskConfigurator.getTaskService(HumanTaskConfigurator.java:142) [jbpm-human-task-core-6.2.0.CR4.jar:6.2.0.CR4]

                    at org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory.newTaskService(LocalTaskServiceFactory.java:65) [jbpm-runtime-manager-6.2.0.CR4.jar:6.2.0.CR4]

                    at org.jbpm.runtime.manager.impl.SingletonRuntimeManager.init(SingletonRuntimeManager.java:85) [jbpm-runtime-manager-6.2.0.CR4.jar:6.2.0.CR4]

                    at org.jbpm.runtime.manager.impl.RuntimeManagerFactoryImpl.newSingletonRuntimeManager(RuntimeManagerFactoryImpl.java:64) [jbpm-runtime-manager-6.2.0.CR4.jar:6.2.0.CR4]

                    at org.jbpm.kie.services.impl.AbstractDeploymentService.commonDeploy(AbstractDeploymentService.java:129) [jbpm-kie-services-6.2.0.CR4.jar:6.2.0.CR4]

                    at org.jbpm.kie.services.impl.KModuleDeploymentService.deploy(KModuleDeploymentService.java:152) [jbpm-kie-services-6.2.0.CR4.jar:6.2.0.CR4]

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

                    at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

                    at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)

                    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

                    at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)

                    at org.jboss.as.ejb3.concurrency.ContainerManagedConcurrencyInterceptor.processInvocation(ContainerManagedConcurrencyInterceptor.java:104) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)

                    at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:46) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]

                    at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

                    at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:53)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ejb3.component.singleton.SingletonComponentInstanceAssociationInterceptor.processInvocation(SingletonComponentInstanceAssociationInterceptor.java:52) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInCallerTx(CMTTxInterceptor.java:251) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.required(CMTTxInterceptor.java:342) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.processInvocation(CMTTxInterceptor.java:239) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:95) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:59) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:55) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)

                    at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:448)

                    at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)

                    at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

                    at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:185)

                    at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:182)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

                    at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)

                    at org.jbpm.services.ejb.api.DeploymentServiceEJBLocal$$$view3.deploy(Unknown Source) [jbpm-services-ejb-api-6.2.0.CR4.jar:6.2.0.CR4]

                    at org.jbpm.examples.util.StartupBean.init(StartupBean.java:43) [classes:]

                    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [rt.jar:1.7.0_45]

                    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) [rt.jar:1.7.0_45]

                    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [rt.jar:1.7.0_45]

                    at java.lang.reflect.Method.invoke(Method.java:606) [rt.jar:1.7.0_45]

                    at org.jboss.as.ee.component.ManagedReferenceLifecycleMethodInterceptor.processInvocation(ManagedReferenceLifecycleMethodInterceptor.java:96)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doLifecycleInterception(Jsr299BindingsInterceptor.java:114) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:103) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:407)

                    at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:55) [weld-core-impl-2.2.6.Final.jar:2014-10-03 10:05]

                    at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.weld.injection.WeldInjectionInterceptor.processInvocation(WeldInjectionInterceptor.java:53) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ee.component.ManagedReferenceFieldInjectionInterceptorFactory$ManagedReferenceFieldInjectionInterceptor.processInvocation(ManagedReferenceFieldInjectionInterceptorFactory.java:109)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.WeavedInterceptor.processInvocation(WeavedInterceptor.java:53)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ee.component.AroundConstructInterceptorFactory$1.processInvocation(AroundConstructInterceptorFactory.java:28)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.weld.injection.WeldInterceptorInjectionInterceptor.processInvocation(WeldInterceptorInjectionInterceptor.java:56) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.weld.ejb.Jsr299BindingsCreateInterceptor.processInvocation(Jsr299BindingsCreateInterceptor.java:94) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.invokeInOurTx(CMTTxInterceptor.java:273) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.as.ejb3.tx.CMTTxInterceptor.requiresNew(CMTTxInterceptor.java:369) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.as.ejb3.tx.LifecycleCMTTxInterceptor.processInvocation(LifecycleCMTTxInterceptor.java:66) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.weld.injection.WeldInjectionContextInterceptor.processInvocation(WeldInjectionContextInterceptor.java:43) [wildfly-weld-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45) [wildfly-ee-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:326)

                    at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)

                    at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:309)

                    at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)

                    at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:160)

                    at org.jboss.as.ee.component.BasicComponent.constructComponentInstance(BasicComponent.java:133)

                    at org.jboss.as.ee.component.BasicComponent.createInstance(BasicComponent.java:89)

                    at org.jboss.as.ejb3.component.singleton.SingletonComponent.getComponentInstance(SingletonComponent.java:122) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.as.ejb3.component.singleton.SingletonComponent.start(SingletonComponent.java:137) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.as.ee.component.ComponentStartService$1.run(ComponentStartService.java:54)

                    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [rt.jar:1.7.0_45]

                    at java.util.concurrent.FutureTask.run(FutureTask.java:262) [rt.jar:1.7.0_45]

                    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145) [rt.jar:1.7.0_45]

                    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.7.0_45]

                    at java.lang.Thread.run(Thread.java:744) [rt.jar:1.7.0_45]

                    at org.jboss.threads.JBossThread.run(JBossThread.java:122)

                Caused by: java.lang.IllegalStateException: Unable to find transaction: UserTransaction

                    at org.drools.persistence.jta.JtaTransactionManager.findUserTransaction(JtaTransactionManager.java:139) [drools-persistence-jpa-6.2.0.CR4.jar:6.2.0.CR4]

                    at org.drools.persistence.jta.JtaTransactionManager.<init>(JtaTransactionManager.java:79) [drools-persistence-jpa-6.2.0.CR4.jar:6.2.0.CR4]

                    at org.jbpm.services.task.persistence.TaskTransactionInterceptor.initTransactionManager(TaskTransactionInterceptor.java:168) [jbpm-human-task-jpa-6.2.0.CR4.jar:6.2.0.CR4]

                    at org.jbpm.services.task.persistence.TaskTransactionInterceptor.<init>(TaskTransactionInterceptor.java:41) [jbpm-human-task-jpa-6.2.0.CR4.jar:6.2.0.CR4]

                    ... 138 more

                Caused by: javax.naming.NameNotFoundException: UserTransaction [Root exception is java.lang.IllegalStateException: JBAS014237: Only session and message-driven beans with bean-managed transaction demarcation are allowed to access UserTransaction]

                    at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:140)

                    at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:81)

                    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:202)

                    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:179)

                    at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:235)

                    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:188)

                    at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)

                    at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_45]

                    at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_45]

                    at org.drools.persistence.jta.JtaTransactionManager.findUserTransaction(JtaTransactionManager.java:131) [drools-persistence-jpa-6.2.0.CR4.jar:6.2.0.CR4]

                    ... 141 more

                Caused by: java.lang.IllegalStateException: JBAS014237: Only session and message-driven beans with bean-managed transaction demarcation are allowed to access UserTransaction

                    at org.jboss.as.ejb3.component.allowedmethods.AllowedMethodsInformation.realCheckPermission(AllowedMethodsInformation.java:138) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.as.ejb3.component.allowedmethods.AllowedMethodsInformation.checkAllowed(AllowedMethodsInformation.java:112) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.as.ejb3.subsystem.EJB3UserTransactionAccessControlService$1.authorizeAccess(EJB3UserTransactionAccessControlService.java:53) [wildfly-ejb3-8.2.0.Final.jar:8.2.0.Final]

                    at org.jboss.as.txn.service.UserTransactionAccessControlService.authorizeAccess(UserTransactionAccessControlService.java:83)

                    at org.jboss.as.txn.service.UserTransactionBindingService$1.getReference(UserTransactionBindingService.java:71)

                    at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:131)

                    ... 150 more

                • 5. Re: CMT, RuntimeEnivronment Configuration
                  jimmy001 Apprentice

                  Hello,

                   

                  any update on this?

                  Is anyone in the forum using jbpm6 with CMT and can at least give me some confidence, that this is working for jbpm and wildfly ?

                   

                  Thx for your help.

                  • 6. Re: CMT, RuntimeEnivronment Configuration
                    Maciej Swiderski Master

                    could you share your application so I could give it a try and see how it can be fixed?

                    • 8. Re: CMT, RuntimeEnivronment Configuration
                      Maciej Swiderski Master

                      See attached fixed version. Though it does use workaround as it looks like Wildfly is more restrictive than EAP 6 in regards of using UserTransaction from within EJB beans. So if you don't mind please file a jira issue for that to resolve it.

                       

                      In meantime, take a look at one class in the attached project that solves the issue: org.jbpm.examples.util.ConfigureBean it is an CDI extension that will register fake UserTransaction instance in JNDI to overcome problem with JtaTransactionManager used by jBPM. It will then allow to be used in CMT without any side effects.

                       

                      HTH

                      • 9. Re: CMT, RuntimeEnivronment Configuration
                        jimmy001 Apprentice

                        Hi,

                        i have deployed your solution and tried to integrate workaround in my application. Of course it would be way too easy if that would work .

                        The difference seems to be, that I am using an ear deployment. To verify this I have excluded all my modules from the build and only packaged rewards-basic

                        as webmodule. The result is:

                         

                        2015-03-11 15:21:15,659 ERROR [stderr] (MSC service thread 1-2) java.lang.UnsupportedOperationException: JBAS011859: Naming context is read-only

                        2015-03-11 15:21:15,659 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:161)

                        2015-03-11 15:21:15,660 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.as.naming.WritableServiceBasedNamingStore.bind(WritableServiceBasedNamingStore.java:66)

                        2015-03-11 15:21:15,660 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.as.naming.NamingContext.bind(NamingContext.java:253)

                        2015-03-11 15:21:15,660 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.as.naming.NamingContext.bind(NamingContext.java:262)

                        2015-03-11 15:21:15,661 ERROR [stderr] (MSC service thread 1-2)     at org.jbpm.examples.util.ConfigureBean.bindToJNDI(ConfigureBean.java:47)

                        2015-03-11 15:21:15,661 ERROR [stderr] (MSC service thread 1-2)     at org.jbpm.examples.util.ConfigureBean.beforeBeanDiscovery(ConfigureBean.java:34)

                         

                        I have taken a look into the sources and it SEEMS, that the problem is, that there is no deployment owner.

                        Do you know a way to get the workaround going in this case?

                        Thanks.

                         

                        PS: I will add a jira issue.

                        • 10. Re: CMT, RuntimeEnivronment Configuration
                          Maciej Swiderski Master

                          could you attach complete stacktrace? Looks like some misconfiguration of the ear file as it should be completely valid to bind objects to JNDI on application start at least as far as I know....

                           

                          HTH

                          • 11. Re: CMT, RuntimeEnivronment Configuration
                            jimmy001 Apprentice

                            2015-03-11 15:21:15,659 ERROR [stderr] (MSC service thread 1-2) java.lang.UnsupportedOperationException: JBAS011859: Naming context is read-only

                             

                            2015-03-11 15:21:15,659 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.as.naming.WritableServiceBasedNamingStore.requireOwner(WritableServiceBasedNamingStore.java:161)

                             

                            2015-03-11 15:21:15,660 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.as.naming.WritableServiceBasedNamingStore.bind(WritableServiceBasedNamingStore.java:66)

                             

                            2015-03-11 15:21:15,660 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.as.naming.NamingContext.bind(NamingContext.java:253)

                             

                            2015-03-11 15:21:15,660 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.as.naming.NamingContext.bind(NamingContext.java:262)

                             

                            2015-03-11 15:21:15,661 ERROR [stderr] (MSC service thread 1-2)     at org.jbpm.examples.util.ConfigureBean.bindToJNDI(ConfigureBean.java:47)

                             

                            2015-03-11 15:21:15,661 ERROR [stderr] (MSC service thread 1-2)     at org.jbpm.examples.util.ConfigureBean.beforeBeanDiscovery(ConfigureBean.java:34)

                             

                            2015-03-11 15:21:15,661 ERROR [stderr] (MSC service thread 1-2)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                             

                            2015-03-11 15:21:15,662 ERROR [stderr] (MSC service thread 1-2)     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                             

                            2015-03-11 15:21:15,662 ERROR [stderr] (MSC service thread 1-2)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                             

                            2015-03-11 15:21:15,662 ERROR [stderr] (MSC service thread 1-2)     at java.lang.reflect.Method.invoke(Method.java:606)

                             

                            2015-03-11 15:21:15,662 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.injection.MethodInjectionPoint.invokeOnInstanceWithSpecialValue(MethodInjectionPoint.java:90)

                             

                            2015-03-11 15:21:15,663 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:271)

                             

                            2015-03-11 15:21:15,663 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.event.ExtensionObserverMethodImpl.sendEvent(ExtensionObserverMethodImpl.java:121)

                             

                            2015-03-11 15:21:15,663 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.event.ObserverMethodImpl.sendEvent(ObserverMethodImpl.java:258)

                             

                            2015-03-11 15:21:15,664 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.event.ObserverMethodImpl.notify(ObserverMethodImpl.java:237)

                             

                            2015-03-11 15:21:15,664 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.event.ObserverNotifier.notifyObserver(ObserverNotifier.java:174)

                             

                            2015-03-11 15:21:15,664 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.event.ObserverNotifier.notifyObservers(ObserverNotifier.java:133)

                             

                            2015-03-11 15:21:15,664 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.event.ObserverNotifier.fireEvent(ObserverNotifier.java:107)

                             

                            2015-03-11 15:21:15,665 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.bootstrap.events.AbstractContainerEvent.fire(AbstractContainerEvent.java:54)

                             

                            2015-03-11 15:21:15,665 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.bootstrap.events.AbstractDefinitionContainerEvent.fire(AbstractDefinitionContainerEvent.java:42)

                             

                            2015-03-11 15:21:15,665 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.bootstrap.events.BeforeBeanDiscoveryImpl.fire(BeforeBeanDiscoveryImpl.java:45)

                             

                            2015-03-11 15:21:15,666 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.bootstrap.WeldStartup.startInitialization(WeldStartup.java:360)

                             

                            2015-03-11 15:21:15,666 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.weld.bootstrap.WeldBootstrap.startInitialization(WeldBootstrap.java:76)

                             

                            2015-03-11 15:21:15,666 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.as.weld.WeldStartService.start(WeldStartService.java:91)

                             

                            2015-03-11 15:21:15,666 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1948)

                             

                            2015-03-11 15:21:15,666 ERROR [stderr] (MSC service thread 1-2)     at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1881)

                             

                            2015-03-11 15:21:15,667 ERROR [stderr] (MSC service thread 1-2)     at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

                             

                            2015-03-11 15:21:15,667 ERROR [stderr] (MSC service thread 1-2)     at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

                             

                            2015-03-11 15:21:15,667 ERROR [stderr] (MSC service thread 1-2)     at java.lang.Thread.run(Thread.java:744)

                             

                            -----------------------

                            What I found is:

                            [WFLY-2164] Read only App, Module and Comp Naming Contexts - JBoss Issue Tracker

                            So I changed the "java:" to something different but the result is the same.

                             

                            The ear contains the following elements

                            -lib

                            --commons-lang

                            --commons-io

                            - rewards-basic-6.2.0-SNAPSHOT.war

                            -META-INF

                            -- application.xml

                             

                            --Content application.xml

                            <?xml version="1.0" encoding="UTF-8"?>

                            <application xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/application_6.xsd" version="6">

                              <description>This project contains global information and dependency data

                                    for all projects of the application.</description>

                              <display-name>ear_test</display-name>

                              <initialize-in-order>false</initialize-in-order>

                              <module>

                                <web>

                                  <web-uri>rewards-basic-6.2.0-SNAPSHOT.war</web-uri>

                                  <context-root>/rewards</context-root>

                                </web>

                              </module>

                              <library-directory>lib/</library-directory>

                            </application>

                             

                            Thx for your help.

                            • 12. Re: CMT, RuntimeEnivronment Configuration
                              jimmy001 Apprentice

                              Hello,

                               

                              could you reproduce the problem? Any new insights?

                              • 13. Re: CMT, RuntimeEnivronment Configuration
                                Maciej Swiderski Master

                                don't have an ear based project but if you have one that reproduces the issue I can try to take a look if you upload one here.

                                • 14. Re: CMT, RuntimeEnivronment Configuration
                                  franco80 Novice

                                  Hi all

                                   

                                  I have the same problem "JBAS011859: Naming context is read-only", with war was ok, but when I tried to move war into ear then I'm reciving this error.

                                   

                                  Maciej if you can take a look on that ear here

                                   

                                  regards

                                  1 2 Previous Next