Uploaded image for project: 'JBoss BPMS Platform'
  1. JBoss BPMS Platform
  2. RHBPMS-4876

KieServerMDB retains jms connection retrieved from managed connection pool, which may cause potential issue such as NPE when invoking jbpm engine.

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 6.4.4
    • Fix Version/s: 6.4.6
    • Component/s: jBPM Core
    • Labels:
      None

      Description

      Some concerns are imposed on the KieServerMDB.java [1] that it retains connection retrieved from Managed Connection Pool(MCP) which is unnecessary. It could cause some issues in the subsequent jbpm engine call in the onMessage method.

      We've discovered one NullPointerException in a use case where a tibco resource adapter is configured in EAP 7 with bpms 6.4:

      2017-08-18 12:26:07,042 ERROR [stderr] (default-threads - 5) java.lang.NullPointerException
      2017-08-18 12:26:07,043 ERROR [stderr] (default-threads - 5) at org.jboss.jca.core.tx.jbossts.XAResourceWrapperImpl.setTransactionTimeout(XAResourceWrapperImpl.java:204)
      2017-08-18 12:26:07,043 ERROR [stderr] (default-threads - 5) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:637)
      2017-08-18 12:26:07,043 ERROR [stderr] (default-threads - 5) at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:423)
      2017-08-18 12:26:07,043 ERROR [stderr] (default-threads - 5) at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener$TransactionSynchronization.enlist(TxConnectionListener.java:986)
      2017-08-18 12:26:07,043 ERROR [stderr] (default-threads - 5) at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.enlist(TxConnectionListener.java:379)
      2017-08-18 12:26:07,043 ERROR [stderr] (default-threads - 5) at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.transactionStarted(TxConnectionManagerImpl.java:449)
      2017-08-18 12:26:07,043 ERROR [stderr] (default-threads - 5) at org.jboss.jca.core.connectionmanager.ccm.CachedConnectionManagerImpl.userTransactionStarted(CachedConnectionManagerImpl.java:249)
      2017-08-18 12:26:07,044 ERROR [stderr] (default-threads - 5) at org.jboss.jca.core.tx.jbossts.UserTransactionListenerImpl.userTransactionStarted(UserTransactionListenerImpl.java:52)
      2017-08-18 12:26:07,044 ERROR [stderr] (default-threads - 5) at org.jboss.tm.usertx.UserTransactionRegistry.userTransactionStarted(UserTransactionRegistry.java:119)
      2017-08-18 12:26:07,044 ERROR [stderr] (default-threads - 5) at org.jboss.tm.usertx.client.ServerVMClientUserTransaction.begin(ServerVMClientUserTransaction.java:171)
      2017-08-18 12:26:07,044 ERROR [stderr] (default-threads - 5) at org.drools.persistence.jta.JtaTransactionManager.begin(JtaTransactionManager.java:205)
      2017-08-18 12:26:07,044 ERROR [stderr] (default-threads - 5) at org.drools.persistence.SingleSessionCommandService.<init>(SingleSessionCommandService.java:106)
      2017-08-18 12:26:07,044 ERROR [stderr] (default-threads - 5) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
      2017-08-18 12:26:07,044 ERROR [stderr] (default-threads - 5) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
      2017-08-18 12:26:07,044 ERROR [stderr] (default-threads - 5) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
      2017-08-18 12:26:07,044 ERROR [stderr] (default-threads - 5) at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
      2017-08-18 12:26:07,044 ERROR [stderr] (default-threads - 5) at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.buildCommandService(KnowledgeStoreServiceImpl.java:171)
      2017-08-18 12:26:07,044 ERROR [stderr] (default-threads - 5) at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newKieSession(KnowledgeStoreServiceImpl.java:70)
      2017-08-18 12:26:07,044 ERROR [stderr] (default-threads - 5) at org.drools.persistence.jpa.KnowledgeStoreServiceImpl.newKieSession(KnowledgeStoreServiceImpl.java:39)
      2017-08-18 12:26:07,045 ERROR [stderr] (default-threads - 5) at org.kie.internal.persistence.jpa.JPAKnowledgeService.newStatefulKnowledgeSession(JPAKnowledgeService.java:121)
      2017-08-18 12:26:07,045 ERROR [stderr] (default-threads - 5) at org.jbpm.runtime.manager.impl.factory.JPASessionFactory.newKieSession(JPASessionFactory.java:42)
      2017-08-18 12:26:07,045 ERROR [stderr] (default-threads - 5) at org.jbpm.runtime.manager.impl.PerProcessInstanceRuntimeManager$PerProcessInstanceInitializer.initKieSession(PerProcessInstanceRuntimeManager.java:542)
      2017-08-18 12:26:07,045 ERROR [stderr] (default-threads - 5) at org.jbpm.runtime.manager.impl.RuntimeEngineImpl.getKieSession(RuntimeEngineImpl.java:70)
      2017-08-18 12:26:07,045 ERROR [stderr] (default-threads - 5) at org.jbpm.kie.services.impl.ProcessServiceImpl.startProcess(ProcessServiceImpl.java:97)
      2017-08-18 12:26:07,045 ERROR [stderr] (default-threads - 5) at org.kie.server.services.jbpm.ProcessServiceBase.startProcess(ProcessServiceBase.java:86)
      2017-08-18 12:26:07,045 ERROR [stderr] (default-threads - 5) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2017-08-18 12:26:07,045 ERROR [stderr] (default-threads - 5) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      2017-08-18 12:26:07,045 ERROR [stderr] (default-threads - 5) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      2017-08-18 12:26:07,045 ERROR [stderr] (default-threads - 5) at java.lang.reflect.Method.invoke(Method.java:498)
      2017-08-18 12:26:07,045 ERROR [stderr] (default-threads - 5) at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:133)
      2017-08-18 12:26:07,046 ERROR [stderr] (default-threads - 5) at org.apache.commons.lang3.reflect.MethodUtils.invokeMethod(MethodUtils.java:94)
      2017-08-18 12:26:07,046 ERROR [stderr] (default-threads - 5) at org.kie.server.services.jbpm.JBPMKieContainerCommandServiceImpl.executeScript(JBPMKieContainerCommandServiceImpl.java:137)
      2017-08-18 12:26:07,046 ERROR [stderr] (default-threads - 5) at org.kie.server.jms.KieServerMDB.onMessage(KieServerMDB.java:214)
      2017-08-18 12:26:07,046 ERROR [stderr] (default-threads - 5) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2017-08-18 12:26:07,046 ERROR [stderr] (default-threads - 5) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      2017-08-18 12:26:07,046 ERROR [stderr] (default-threads - 5) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      2017-08-18 12:26:07,046 ERROR [stderr] (default-threads - 5) at java.lang.reflect.Method.invoke(Method.java:498)
      2017-08-18 12:26:07,046 ERROR [stderr] (default-threads - 5) at org.jboss.as.ee.component.ManagedReferenceMethodInterceptor.processInvocation(ManagedReferenceMethodInterceptor.java:52)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.doMethodInterception(Jsr299BindingsInterceptor.java:82)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.as.weld.ejb.Jsr299BindingsInterceptor.processInvocation(Jsr299BindingsInterceptor.java:93)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.as.ee.component.interceptors.UserInterceptorFactory$1.processInvocation(UserInterceptorFactory.java:63)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.component.invocationmetrics.ExecutionTimeInterceptor.processInvocation(ExecutionTimeInterceptor.java:43)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.tx.EjbBMTInterceptor.handleInvocation(EjbBMTInterceptor.java:103)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.tx.BMTInterceptor.processInvocation(BMTInterceptor.java:58)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext$Invocation.proceed(InterceptorContext.java:437)
      2017-08-18 12:26:07,047 ERROR [stderr] (default-threads - 5) at org.jboss.weld.ejb.AbstractEJBRequestScopeActivationInterceptor.aroundInvoke(AbstractEJBRequestScopeActivationInterceptor.java:73)
      2017-08-18 12:26:07,048 ERROR [stderr] (default-threads - 5) at org.jboss.as.weld.ejb.EjbRequestScopeActivationInterceptor.processInvocation(EjbRequestScopeActivationInterceptor.java:83)
      2017-08-18 12:26:07,048 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,048 ERROR [stderr] (default-threads - 5) at org.jboss.as.ee.concurrent.ConcurrentContextInterceptor.processInvocation(ConcurrentContextInterceptor.java:45)
      2017-08-18 12:26:07,048 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,048 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InitialInterceptor.processInvocation(InitialInterceptor.java:21)
      2017-08-18 12:26:07,048 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,048 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      2017-08-18 12:26:07,048 ERROR [stderr] (default-threads - 5) at org.jboss.as.ee.component.interceptors.ComponentDispatcherInterceptor.processInvocation(ComponentDispatcherInterceptor.java:52)
      2017-08-18 12:26:07,048 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,049 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.component.pool.PooledInstanceInterceptor.processInvocation(PooledInstanceInterceptor.java:51)
      2017-08-18 12:26:07,049 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,049 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.component.interceptors.CurrentInvocationContextInterceptor.processInvocation(CurrentInvocationContextInterceptor.java:41)
      2017-08-18 12:26:07,049 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,049 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.component.invocationmetrics.WaitTimeInterceptor.processInvocation(WaitTimeInterceptor.java:43)
      2017-08-18 12:26:07,049 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,049 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.security.SecurityContextInterceptor.processInvocation(SecurityContextInterceptor.java:100)
      2017-08-18 12:26:07,049 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,049 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.deployment.processors.StartupAwaitInterceptor.processInvocation(StartupAwaitInterceptor.java:22)
      2017-08-18 12:26:07,049 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,049 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.component.interceptors.ShutDownInterceptorFactory$1.processInvocation(ShutDownInterceptorFactory.java:64)
      2017-08-18 12:26:07,050 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,050 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.deployment.processors.EjbSuspendInterceptor.processInvocation(EjbSuspendInterceptor.java:53)
      2017-08-18 12:26:07,050 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,050 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.component.interceptors.LoggingInterceptor.processInvocation(LoggingInterceptor.java:66)
      2017-08-18 12:26:07,050 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,050 ERROR [stderr] (default-threads - 5) at org.jboss.as.ee.component.NamespaceContextInterceptor.processInvocation(NamespaceContextInterceptor.java:50)
      2017-08-18 12:26:07,050 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,051 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.component.interceptors.AdditionalSetupInterceptor.processInvocation(AdditionalSetupInterceptor.java:54)
      2017-08-18 12:26:07,051 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,051 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.component.messagedriven.MessageDrivenComponentDescription$5$1.processInvocation(MessageDrivenComponentDescription.java:239)
      2017-08-18 12:26:07,051 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,051 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.ContextClassLoaderInterceptor.processInvocation(ContextClassLoaderInterceptor.java:64)
      2017-08-18 12:26:07,051 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,051 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
      2017-08-18 12:26:07,051 ERROR [stderr] (default-threads - 5) at org.wildfly.security.manager.WildFlySecurityManager.doChecked(WildFlySecurityManager.java:636)
      2017-08-18 12:26:07,051 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.AccessCheckingInterceptor.processInvocation(AccessCheckingInterceptor.java:61)
      2017-08-18 12:26:07,052 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,052 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.run(InterceptorContext.java:356)
      2017-08-18 12:26:07,052 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.PrivilegedWithCombinerInterceptor.processInvocation(PrivilegedWithCombinerInterceptor.java:80)
      2017-08-18 12:26:07,052 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,052 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      2017-08-18 12:26:07,052 ERROR [stderr] (default-threads - 5) at org.jboss.as.ee.component.ViewService$View.invoke(ViewService.java:198)
      2017-08-18 12:26:07,052 ERROR [stderr] (default-threads - 5) at org.jboss.as.ee.component.ViewDescription$1.processInvocation(ViewDescription.java:185)
      2017-08-18 12:26:07,052 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.InterceptorContext.proceed(InterceptorContext.java:340)
      2017-08-18 12:26:07,053 ERROR [stderr] (default-threads - 5) at org.jboss.invocation.ChainedInterceptor.processInvocation(ChainedInterceptor.java:61)
      2017-08-18 12:26:07,053 ERROR [stderr] (default-threads - 5) at org.jboss.as.ee.component.ProxyInvocationHandler.invoke(ProxyInvocationHandler.java:73)
      2017-08-18 12:26:07,053 ERROR [stderr] (default-threads - 5) at org.kie.server.jms.KieServerMDB$$$view3.onMessage(Unknown Source)
      2017-08-18 12:26:07,053 ERROR [stderr] (default-threads - 5) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2017-08-18 12:26:07,053 ERROR [stderr] (default-threads - 5) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
      2017-08-18 12:26:07,053 ERROR [stderr] (default-threads - 5) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      2017-08-18 12:26:07,053 ERROR [stderr] (default-threads - 5) at java.lang.reflect.Method.invoke(Method.java:498)
      2017-08-18 12:26:07,053 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.inflow.MessageEndpointInvocationHandler.doInvoke(MessageEndpointInvocationHandler.java:139)
      2017-08-18 12:26:07,053 ERROR [stderr] (default-threads - 5) at org.jboss.as.ejb3.inflow.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:73)
      2017-08-18 12:26:07,054 ERROR [stderr] (default-threads - 5) at org.kie.server.jms.KieServerMDB$$$endpoint4.onMessage(Unknown Source)
      2017-08-18 12:26:07,054 ERROR [stderr] (default-threads - 5) at org.jboss.resource.adapter.jms.inflow.JmsServerSession.onMessage(JmsServerSession.java:163)
      2017-08-18 12:26:07,054 ERROR [stderr] (default-threads - 5) at com.tibco.tibjms.TibjmsxSessionImp._submit(TibjmsxSessionImp.java:4249)
      2017-08-18 12:26:07,054 ERROR [stderr] (default-threads - 5) at com.tibco.tibjms.TibjmsxSessionImp._dispatchAsyncMessage(TibjmsxSessionImp.java:2299)
      2017-08-18 12:26:07,054 ERROR [stderr] (default-threads - 5) at com.tibco.tibjms.TibjmsxSessionImp._run(TibjmsxSessionImp.java:3706)
      2017-08-18 12:26:07,054 ERROR [stderr] (default-threads - 5) at com.tibco.tibjms.TibjmsxSessionImp.run(TibjmsxSessionImp.java:4936)

      The suggestion is to create the jms connection/session inside of the onMessage method instead of in the init method so that a clean connection/session is being used upon each message request.

      [1] https://github.com/kiegroup/droolsjbpm-integration/blob/master/kie-server-parent/kie-server-remote/kie-server-jms/src/main/java/org/kie/server/jms/KieServerMDB.java

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  swiderski.maciej Maciej Swiderski
                  Reporter:
                  ghjboss Gary Hu
                  Tester:
                  Radovan Synek
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: