2 Replies Latest reply on Apr 14, 2015 6:59 AM by mariaprabudass Edwin

    Concurrency problem when completing two task

    mariaprabudass Edwin Newbie

      Hello,

       

      We are using jBPM 5.2.0 Final, we have implemented LocalTaskService for Human Task. In that, when two user try to complete the different task in the same time, One is getting correct response and another is getting error response. Please find jBoss server log for reference. We're really getting stuck with this. Could you please share me the solution...

       

      Exception:-

      forcing batcher resource cleanup on transaction completion; forgot to close ScrollableResults/Iterator?

      11:27:28,315 WARNING [org.hibernate.util.JDBCExceptionReporter] (http--10.0.5.53-8080-18) SQL Error: 0, SQLState: null

      11:27:28,316 INFO  [stdout] (http--10.0.5.53-8080-4) Exception..!

      11:27:28,316 ERROR [stderr] (http--10.0.5.53-8080-4) javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query

      11:27:28,316 SEVERE [org.hibernate.util.JDBCExceptionReporter] (http--10.0.5.53-8080-18) The result set is closed.

      11:27:28,316 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)

      11:27:28,317 INFO  [stdout] (http--10.0.5.53-8080-18) Exception..!

      11:27:28,317 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1315)

      11:27:28,317 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:255)

      11:27:28,317 ERROR [stderr] (http--10.0.5.53-8080-4) at org.jbpm.task.service.TaskServiceSession.doUserGroupCallbackOperation(TaskServiceSession.java:1005)

      11:27:28,317 ERROR [stderr] (http--10.0.5.53-8080-4) at org.jbpm.task.service.TaskServiceSession.taskOperation(TaskServiceSession.java:374)

      11:27:28,317 ERROR [stderr] (http--10.0.5.53-8080-4) at org.jbpm.task.service.local.LocalTaskService.start(LocalTaskService.java:224)

      11:27:28,318 ERROR [stderr] (http--10.0.5.53-8080-4) at com.tnq.workflow.engine.BaseTaskManagement.startTask(BaseTaskManagement.java:363)

      11:27:28,318 ERROR [stderr] (http--10.0.5.53-8080-4) at com.tnq.workflow.engine.TaskManagementImpl.startTask(TaskManagementImpl.java:126)

      11:27:28,318 ERROR [stderr] (http--10.0.5.53-8080-4) at com.tnq.workflow.engine.BaseTaskManagement.eventBeforePushToNext(BaseTaskManagement.java:463)

      11:27:28,318 ERROR [stderr] (http--10.0.5.53-8080-4) at com.tnq.workflow.engine.TaskManagementImpl.eventBeforePushToNext(TaskManagementImpl.java:217)

      11:27:28,318 ERROR [stderr] (http--10.0.5.53-8080-4) at com.tnq.workflow.engine.TaskManagementImpl$$FastClassByCGLIB$$ade224e9.invoke(<generated>)

      11:27:28,318 ERROR [stderr] (http--10.0.5.53-8080-4) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)

      11:27:28,318 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)

      11:27:28,319 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

      11:27:28,319 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)

      11:27:28,319 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

      11:27:28,319 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)

      11:27:28,319 ERROR [stderr] (http--10.0.5.53-8080-4) at com.tnq.workflow.engine.TaskManagementImpl$$EnhancerByCGLIB$$c7f19b33.eventBeforePushToNext(<generated>)

      11:27:28,319 ERROR [stderr] (http--10.0.5.53-8080-4) at com.tnq.workflow.services.TaskServiceImpl.completeTask(TaskServiceImpl.java:428)

      11:27:28,320 ERROR [stderr] (http--10.0.5.53-8080-4) at com.tnq.workflow.services.TaskServiceImpl$$FastClassByCGLIB$$89eef3ab.invoke(<generated>)

      11:27:28,320 ERROR [stderr] (http--10.0.5.53-8080-4) at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)

      11:27:28,320 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)

      11:27:28,320 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

      11:27:28,320 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)

      11:27:28,320 ERROR [stderr] (http--10.0.5.53-8080-4) at com.tnq.aspects.TaskNotificationAspect.notifyCompleteTask(TaskNotificationAspect.java:133)

      11:27:28,320 ERROR [stderr] (http--10.0.5.53-8080-4) at sun.reflect.GeneratedMethodAccessor843.invoke(Unknown Source)

      11:27:28,321 ERROR [stderr] (http--10.0.5.53-8080-4) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      11:27:28,321 ERROR [stderr] (http--10.0.5.53-8080-4) at java.lang.reflect.Method.invoke(Method.java:606)

      11:27:28,321 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:621)

      11:27:28,321 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:610)

      11:27:28,321 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:65)

      11:27:28,321 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

      11:27:28,322 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)

      11:27:28,322 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

      11:27:28,322 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)

      11:27:28,322 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

      11:27:28,322 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)

      11:27:28,322 ERROR [stderr] (http--10.0.5.53-8080-4) at com.tnq.workflow.services.TaskServiceImpl$$EnhancerByCGLIB$$86fb2246.completeTask(<generated>)

      11:27:28,322 ERROR [stderr] (http--10.0.5.53-8080-4) at com.tnq.workflow.web.controllers.TasksController.completeTask(TasksController.java:114)

      11:27:28,323 ERROR [stderr] (http--10.0.5.53-8080-4) at sun.reflect.GeneratedMethodAccessor853.invoke(Unknown Source)

      11:27:28,323 ERROR [stderr] (http--10.0.5.53-8080-4) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

      11:27:28,323 ERROR [stderr] (http--10.0.5.53-8080-4) at java.lang.reflect.Method.invoke(Method.java:606)

      11:27:28,323 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.web.method.support.InvocableHandlerMethod.invoke(InvocableHandlerMethod.java:213)

      11:27:28,323 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.web.method.support.InvocableHandlerMethod.invokeForRequest(InvocableHandlerMethod.java:126)

      11:27:28,323 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.web.servlet.mvc.method.annotation.ServletInvocableHandlerMethod.invokeAndHandle(ServletInvocableHandlerMethod.java:96)

      11:27:28,324 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.invokeHandlerMethod(RequestMappingHandlerAdapter.java:617)

      11:27:28,324 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerAdapter.handleInternal(RequestMappingHandlerAdapter.java:578)

      11:27:28,324 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.web.servlet.mvc.method.AbstractHandlerMethodAdapter.handle(AbstractHandlerMethodAdapter.java:80)

      11:27:28,324 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923)

      11:27:28,324 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852)

      11:27:28,324 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882)

      11:27:28,325 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.web.servlet.FrameworkServlet.doPut(FrameworkServlet.java:800)

      11:27:28,325 ERROR [stderr] (http--10.0.5.53-8080-4) at javax.servlet.http.HttpServlet.service(HttpServlet.java:757)

      11:27:28,325 ERROR [stderr] (http--10.0.5.53-8080-4) at javax.servlet.http.HttpServlet.service(HttpServlet.java:847)

      11:27:28,325 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:329)

      11:27:28,325 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

      11:27:28,325 ERROR [stderr] (http--10.0.5.53-8080-4) at com.thetransactioncompany.cors.CORSFilter.doFilter(Unknown Source)

      11:27:28,325 ERROR [stderr] (http--10.0.5.53-8080-4) at com.thetransactioncompany.cors.CORSFilter.doFilter(Unknown Source)

      11:27:28,326 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

      11:27:28,326 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

      11:27:28,326 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)

      11:27:28,326 ERROR [stderr] (http--10.0.5.53-8080-4) at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)

      11:27:28,326 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:280)

      11:27:28,326 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:248)

      11:27:28,327 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:275)

      11:27:28,327 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:161)

      11:27:28,327 ERROR [stderr] (http--10.0.5.53-8080-4) at org.jboss.as.web.security.SecurityContextAssociationValve.invoke(SecurityContextAssociationValve.java:139)

      11:27:28,327 ERROR [stderr] (http--10.0.5.53-8080-4) at org.jboss.as.web.NamingValve.invoke(NamingValve.java:57)

      11:27:28,327 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:154)

      11:27:28,327 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

      11:27:28,327 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

      11:27:28,328 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:362)

      11:27:28,328 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:877)

      11:27:28,328 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:667)

      11:27:28,328 ERROR [stderr] (http--10.0.5.53-8080-4) at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952)

      11:27:28,328 ERROR [stderr] (http--10.0.5.53-8080-4) at java.lang.Thread.run(Thread.java:745)

      11:27:28,329 ERROR [stderr] (http--10.0.5.53-8080-4) Caused by: org.hibernate.exception.GenericJDBCException: could not execute query

      11:27:28,329 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)

      11:27:28,329 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)

      11:27:28,330 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

      11:27:28,330 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.loader.Loader.doList(Loader.java:2545)

      11:27:28,330 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2276)

      11:27:28,330 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.loader.Loader.list(Loader.java:2271)

      11:27:28,330 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:459)

      11:27:28,330 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:365)

      11:27:28,331 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)

      11:27:28,331 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.impl.SessionImpl.list(SessionImpl.java:1268)

      11:27:28,331 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)

      11:27:28,331 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.ejb.QueryImpl.getResultList(QueryImpl.java:246)

      11:27:28,331 ERROR [stderr] (http--10.0.5.53-8080-4) ... 73 more

      11:27:28,332 ERROR [stderr] (http--10.0.5.53-8080-4) Caused by: java.sql.SQLException: The result set is closed.

      11:27:28,332 ERROR [stderr] (http--10.0.5.53-8080-4) at org.jboss.jca.adapters.jdbc.WrappedResultSet.checkState(WrappedResultSet.java:4059)

      11:27:28,332 ERROR [stderr] (http--10.0.5.53-8080-4) at org.jboss.jca.adapters.jdbc.WrappedResultSet.wasNull(WrappedResultSet.java:3005)

      11:27:28,332 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.type.descriptor.sql.BasicExtractor.extract(BasicExtractor.java:65)

      11:27:28,332 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:254)

      11:27:28,333 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:250)

      11:27:28,333 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:230)

      11:27:28,333 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:331)

      11:27:28,333 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.loader.Loader.extractKeysFromResultSet(Loader.java:668)

      11:27:28,333 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:606)

      11:27:28,333 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.loader.Loader.doQuery(Loader.java:829)

      11:27:28,334 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)

      11:27:28,334 ERROR [stderr] (http--10.0.5.53-8080-4) at org.hibernate.loader.Loader.doList(Loader.java:2542)

      11:27:28,334 ERROR [stderr] (http--10.0.5.53-8080-4) ... 81 more

      11:27:28,334 ERROR [stderr] (http--10.0.5.53-8080-18) javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not execute query

       

      Thanks & Regards.

      Maria Prabudass

        • 1. Re: Concurrency problem when completing two task
          Maciej Swiderski Master

          you need to ensure that each call will use it's own instance of LocalTaskService and by that make it thread safe. Otherwise same underlying resources (such as hibernate session) will be used and might cause number of issues with concurrent usage.

           

          HTH

          • 2. Re: Concurrency problem when completing two task
            mariaprabudass Edwin Newbie

            Thank you Maciej..

            Yes, as like you said we are using new instance of LocalTaskService on every request. But still we face problems. Can you please look in our configs and logs suggest your comments?

            Due to above problem. I have migrated from "jBPM - 5.2.0.Final" to "jBPM - 5.4.0.Final" , still the same exception occurs.

             

            Given below the version details,

            jBPM - 5.4.0.Final

            jBoss - 7.0.2.Final

            Spring - 3.1.1.RELEASE

            Hibernate - 3.6.9

            Drools -  5.5.0.Final

             

            JbpmAPIUtil.java:-

               private EntityManagerFactory taskEmf;

               private EntityManagerFactory jbpmEmf;

               private Object jbpmTransactionManager;

               private LocalTaskService client;

               private org.jbpm.task.service.TaskService taskService;

             

                @Autowired

                @Qualifier("jbpmEmf")

                public void setJbpmEmf(EntityManagerFactory jbpmEmf) {

                    this.jbpmEmf = jbpmEmf;

                }

                @Autowired

                @Qualifier("taskEmf")

                public void setTaskEmf(EntityManagerFactory taskEmf) {

                    this.taskEmf = taskEmf;

                }

                @Autowired

                @Qualifier("jbpmTransactionManager")

                public void setJbpmTransactionManager(Object jbpmTransactionManager) {

                    this.jbpmTransactionManager = jbpmTransactionManager;

                }

             

                public StatefulKnowledgeSession createKnowledgeSession(String process) throws Exception {

                    KnowledgeBase kbase = createKnowledgeBase(process);

                    return createKnowledgeSession(kbase);

                }

             

                public StatefulKnowledgeSession loadKnowledgeSession(int sessionId, String process) throws Exception {

                    KnowledgeBase kbase = createKnowledgeBase(process);

                    return loadKnowledgeSession(sessionId, kbase);

                }

             

                public KnowledgeBase createKnowledgeBase(String process) throws Exception {

                    KnowledgeBuilder kbuilder = KnowledgeBuilderFactory.newKnowledgeBuilder();

                    kbuilder.add(ResourceFactory.newFileResource(getProcessFile(process)), ResourceType.BPMN2);

                    if (kbuilder.hasErrors()) {

                        if (kbuilder.getErrors().size() > 0) {

                            boolean errors = false;

                            for (KnowledgeBuilderError error : kbuilder.getErrors()) {

                                logger.warn(error.toString());

                                errors = true;

                            }

                        }

                    }

                    return kbuilder.newKnowledgeBase();

                }

             

                public StatefulKnowledgeSession createKnowledgeSession(KnowledgeBase kbase) throws Exception {

                    StatefulKnowledgeSession result;

                    final KnowledgeSessionConfiguration config = createConfig();

                    Environment env = createEnvironment();

                    result = JPAKnowledgeService.newStatefulKnowledgeSession(kbase, config, env);

                    NotificationWorkItemHandler notificationHandler = new NotificationWorkItemHandler();

                    result.getWorkItemManager().registerWorkItemHandler("Call", notificationHandler);

                    org.jbpm.task.service.TaskService taskService = new org.jbpm.task.service.TaskService(taskEmf, new SystemEventListener());

                    LocalTaskService localTaskService = new LocalTaskService(taskService);

                    LocalHTWorkItemHandler humanTaskHandler = new LocalHTWorkItemHandler(localTaskService, result, OnErrorAction.RETHROW);

                    humanTaskHandler.setClient(localTaskService);

                    humanTaskHandler.setLocal(true);

                    humanTaskHandler.setOwningSessionOnly(true);

                    humanTaskHandler.setBaseTaskService(baseTaskService);

                    humanTaskHandler.connect();

                    result.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);

                    return result;

                }

             

                protected KnowledgeSessionConfiguration createConfig() throws Exception {

                    Properties properties = new Properties();

                    properties.put("drools.processInstanceManagerFactory", "org.jbpm.persistence.processinstance.JPAProcessInstanceManagerFactory");

                    properties.put("drools.processSignalManagerFactory", "org.jbpm.persistence.processinstance.JPASignalManagerFactory");

                    return KnowledgeBaseFactory.newKnowledgeSessionConfiguration(properties);

                }

             

                protected Environment createEnvironment() throws Exception {

                    System.setProperty("jbpm.usergroup.callback", "com.test.engine.UserGroupCallbackImpl");

                    Environment env = EnvironmentFactory.newEnvironment();

                    env.set(EnvironmentName.ENTITY_MANAGER_FACTORY, jbpmEmf);

                    env.set(EnvironmentName.TRANSACTION_MANAGER, jbpmTransactionManager);

                    env.set(EnvironmentName.GLOBALS, new MapGlobalResolver());

                    return env;

                }

             

            public StatefulKnowledgeSession loadKnowledgeSession(int sessionId, KnowledgeBase kbase) throws Exception {

                    StatefulKnowledgeSession result;

                    final KnowledgeSessionConfiguration config = createConfig();

                    Environment env = createEnvironment();

                    result = JPAKnowledgeService.loadStatefulKnowledgeSession(sessionId, kbase, config, env);

                    NotificationWorkItemHandler notificationHandler = new NotificationWorkItemHandler();

                    result.getWorkItemManager().registerWorkItemHandler("Call", notificationHandler);

                    org.jbpm.task.service.TaskService taskService = new org.jbpm.task.service.TaskService(taskEmf, new SystemEventListener());

                    LocalTaskService localTaskService = new LocalTaskService(taskService);

                    LocalHTWorkItemHandler humanTaskHandler = new LocalHTWorkItemHandler(localTaskService, result, OnErrorAction.RETHROW);

              humanTaskHandler.setClient(localTaskService);

                    humanTaskHandler.setLocal(true);

                    humanTaskHandler.setBaseTaskService(baseTaskService);

                    humanTaskHandler.connect();

              result.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);

                    return result;

                }

             

             

            public TaskService createTaskService(Integer sessionId, String jobFlowName) {

                    TaskService taskService = null;

                    try {

                        StatefulKnowledgeSession ksession = loadKnowledgeSession(sessionId, jobFlowName);

                        taskService = getTaskService(ksession, getService(taskEmf), taskEmf);

                    } catch (Exception e) {

                        logger.error("Exception:" +e);

                    }

                    return taskService;

                }

              

                protected TaskService getTaskService(StatefulKnowledgeSession ksession, org.jbpm.task.service.TaskService taskService, EntityManagerFactory emf) {

                   taskService = new org.jbpm.task.service.TaskService(

                                        emf, SystemEventListenerFactory.getSystemEventListener());

                    LocalTaskService localTaskService = new LocalTaskService(taskService);

                    LocalHTWorkItemHandler humanTaskHandler = new LocalHTWorkItemHandler(localTaskService, ksession, OnErrorAction.RETHROW);

                    humanTaskHandler.setClient(localTaskService);

                    humanTaskHandler.setLocal(true);

                    humanTaskHandler.setBaseTaskService(baseTaskService);

                    humanTaskHandler.connect();

              ksession.getWorkItemManager().registerWorkItemHandler("Human Task", humanTaskHandler);

                    return new LocalTaskService(taskService);

                }

              

                public org.jbpm.task.service.TaskService getService(EntityManagerFactory emf) {

                    return new org.jbpm.task.service.TaskService(emf, SystemEventListenerFactory.getSystemEventListener());

                }

             

            TaskManagement.java:-

            public void completeTask(long taskId, String userId, Integer sessionId, String jobFlowName) throws Exception {

                    try {

                        TaskService taskService = getTaskService(sessionId, jobFlowName);

                        taskService.complete(taskId, userId, null);

                        taskService = null;

                    } catch (Exception e) {

                        throw e;

                    }

                }

            private TaskService getTaskService(Integer sessionId, String jobFlowName) throws Exception {

                    TaskService taskService = null;

                    try {

                          taskService = jbpmAPIUtil.createTaskService(sessionId, jobFlowName);

                    } catch (Exception e) {

                        throw e;

                    }

                    return taskService;

                }

             

            persistence.xml:-

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

            <persistence version="1.0"

                         xsi:schemaLocation="http://java.sun.com/xml/ns/persistence

                                             http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd

                                             http://java.sun.com/xml/ns/persistence/orm

                                             http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"

                         xmlns:orm="http://java.sun.com/xml/ns/persistence/orm"

                         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                         xmlns="http://java.sun.com/xml/ns/persistence">

                <persistence-unit name="org.jbpm.persistence.jpa.cust" transaction-type="JTA">

                    <provider>org.hibernate.ejb.HibernatePersistence</provider>

                    <jta-data-source>java:jboss/datasources/custDS</jta-data-source>

                    <mapping-file>META-INF/JBPMorm.xml</mapping-file>

                    <mapping-file>META-INF/ExtraIndexes.hbm.xml</mapping-file>

                    <mapping-file>META-INF/ProcessInstanceInfo.hbm.xml</mapping-file>

                    <!--<mapping-file>META-INF/Taskorm.xml</mapping-file>-->

                 

                    <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>

                    <class>org.drools.persistence.info.SessionInfo</class>

                    <class>org.drools.persistence.info.WorkItemInfo</class>

                    <properties>

                        <property name="hibernate.max_fetch_depth" value="3"/>

                        <property name="hibernate.hbm2ddl.auto" value="validate" />

                        <property name="hibernate.transaction.manager_lookup_class" value="com.test.engine.AS7TransactionManagerLookup" />     

                        <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

                    </properties>

                </persistence-unit>

               <persistence-unit name="org.jbpm.task.cust">

                    <provider>org.hibernate.ejb.HibernatePersistence</provider>

                    <jta-data-source>java:jboss/datasources/custTASKORMDS</jta-data-source>     

                    <mapping-file>META-INF/Taskorm.xml</mapping-file>

                    <class>org.jbpm.task.Attachment</class>

                    <class>org.jbpm.task.Content</class>

                    <class>org.jbpm.task.BooleanExpression</class>

                    <class>org.jbpm.task.Comment</class>

                    <class>org.jbpm.task.Deadline</class>

                    <class>org.jbpm.task.Comment</class>

                    <class>org.jbpm.task.Deadline</class>

                    <class>org.jbpm.task.Delegation</class>

                    <class>org.jbpm.task.Escalation</class>

                    <class>org.jbpm.task.Group</class>

                    <class>org.jbpm.task.I18NText</class>

                    <class>org.jbpm.task.Notification</class>

                    <class>org.jbpm.task.EmailNotification</class>

                    <class>org.jbpm.task.EmailNotificationHeader</class>

                    <class>org.jbpm.task.PeopleAssignments</class>

                    <class>org.jbpm.task.Reassignment</class>

                    <class>org.jbpm.task.Status</class>

                    <class>org.jbpm.task.Task</class>

                    <class>org.jbpm.task.TaskData</class>

                    <class>org.jbpm.task.SubTasksStrategy</class>

                    <class>org.jbpm.task.OnParentAbortAllSubTasksEndStrategy</class>

                    <class>org.jbpm.task.OnAllSubTasksEndParentEndStrategy</class>

                    <class>org.jbpm.task.User</class>

                    <properties>

                        <property name="hibernate.max_fetch_depth" value="3"/>         

                        <property name="hibernate.hbm2ddl.auto" value="validate" />

                        <property name="hibernate.transaction.manager_lookup_class" value="com.test.engine.AS7TransactionManagerLookup" />

                        <property name="hibernate.dialect" value="org.hibernate.dialect.MySQLDialect"/>

                    </properties>     

                </persistence-unit>

            </persistence>

             

            TransactionManagerLookup:-

            import org.hibernate.transaction.JNDITransactionManagerLookup;

            public class AS7TransactionManagerLookup extends JNDITransactionManagerLookup {

                @Override

                public String getUserTransactionName() {

                    return "UserTransaction";

                }

                @Override

                protected String getName() {

                    return "java:jboss/TransactionManager";

                }

            }

             

            applicationContext.xml:-

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

            <beans xmlns="http://www.springframework.org/schema/beans"

                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                   xmlns:aop="http://www.springframework.org/schema/aop"

                   xmlns:context="http://www.springframework.org/schema/context"

                   xmlns:tx="http://www.springframework.org/schema/tx"

                   xmlns:p="http://www.springframework.org/schema/p"

                   xmlns:util="http://www.springframework.org/schema/util"

                   xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd

                      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd

                      http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd

                      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.1.xsd

                      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd

            ">

                <bean id="dataSource"

                      class="org.springframework.jdbc.datasource.DriverManagerDataSource"

                      p:driverClassName="${jdbc.driver}"

                      p:url="${jdbc.url}"

                      p:username="${jdbc.username}"

                      p:password="${jdbc.password}" />

             

                <!-- Hibernate Template -->

                <bean id="hibernateTemplate" class="org.springframework.orm.hibernate3.HibernateTemplate">

                    <property name="sessionFactory">

                        <ref local="sessionFactory"/>

                    </property>

                    <property name="flushModeName" value="FLUSH_COMMIT" />

                </bean>

             

            <beans profile="cust">

            <context:property-placeholder ignore-resource-not-found="true" location="classpath:test.cust.properties,file:///test/data/cust.properties"/>

                <bean id="jbpmEmf" class="javax.persistence.Persistence" factory-method="createEntityManagerFactory">

                    <constructor-arg>

                        <value>org.jbpm.persistence.jpa.cust</value>

                    </constructor-arg>

                </bean>

                <bean id="taskEmf" class="javax.persistence.Persistence" factory-method="createEntityManagerFactory">

                    <constructor-arg>

                        <value>org.jbpm.task.cust</value>

                    </constructor-arg>

                </bean>

             

                <bean id="jbpmTransactionManager" class="com.test.engine.BeanFactory" factory-method="createJBossTransactionManager">

                </bean>

                <bean id="hornetQ" class="com.test.engine.BeanFactory" factory-method="getAPIQueueName"/>

                <tx:annotation-driven transaction-manager="txManager" proxy-target-class="true" />

                <bean id="txManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">

                    <property name="sessionFactory" ref="sessionFactory" />

                </bean>

            </beans>

             

            jBoss Server Log:-

             

            19:20:08,771 ERROR [stderr] (http--localhost-8080-8) java.lang.RuntimeException: Operation failed

            19:20:08,772 ERROR [stderr] (http--localhost-8080-8)    at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:1130)

            19:20:08,772 ERROR [stderr] (http--localhost-8080-8)    at org.jbpm.task.service.TaskServiceSession.getEntity(TaskServiceSession.java:1069)

            19:20:08,772 ERROR [stderr] (http--localhost-8080-8)    at org.jbpm.task.service.TaskServiceSession.getTask(TaskServiceSession.java:605)

            19:20:08,772 ERROR [stderr] (http--localhost-8080-8)    at org.jbpm.task.service.local.LocalTaskService.getTask(LocalTaskService.java:157)

            19:20:08,772 ERROR [stderr] (http--localhost-8080-8)    at com.test.engine.BaseTaskManagement.getTask(BaseTaskManagement.java:621)

            19:20:08,772 ERROR [stderr] (http--localhost-8080-8)    at com.test.engine.TaskManagementImpl.getTask(TaskManagementImpl.java:203)

            19:20:08,773 ERROR [stderr] (http--localhost-8080-8)    at com.test.engine.BaseTaskManagement.eventBeforePushToNext(BaseTaskManagement.java:511)

            19:20:08,773 ERROR [stderr] (http--localhost-8080-8)    at com.test.engine.TaskManagementImpl.eventBeforePushToNext(TaskManagementImpl.java:219)

            19:20:08,773 ERROR [stderr] (http--localhost-8080-8)    at com.test.engine.TaskManagementImpl$$FastClassByCGLIB$$ade224e9.invoke(<generated>)

            19:20:08,773 ERROR [stderr] (http--localhost-8080-8)    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)

            19:20:08,773 ERROR [stderr] (http--localhost-8080-8)    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)

            19:20:08,773 ERROR [stderr] (http--localhost-8080-8)    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

            19:20:08,773 ERROR [stderr] (http--localhost-8080-8)    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)

            19:20:08,773 ERROR [stderr] (http--localhost-8080-8)    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

            19:20:08,773 ERROR [stderr] (http--localhost-8080-8)    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90)

            19:20:08,773 ERROR [stderr] (http--localhost-8080-8)    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)

            19:20:08,773 ERROR [stderr] (http--localhost-8080-8)    at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622)

            19:20:08,774 ERROR [stderr] (http--localhost-8080-8)    at com.test.engine.TaskManagementImpl$$EnhancerByCGLIB$$59d43401.eventBeforePushToNext(<generated>)

            19:20:08,774 ERROR [stderr] (http--localhost-8080-8)    at com.test.services.TaskServiceImpl.completeTask(TaskServiceImpl.java:431)

            19:20:08,774 ERROR [stderr] (http--localhost-8080-8)    at com.test.services.TaskServiceImpl$$FastClassByCGLIB$$89eef3ab.invoke(<generated>)

            19:20:08,774 ERROR [stderr] (http--localhost-8080-8)    at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191)

            19:20:08,774 ERROR [stderr] (http--localhost-8080-8)    at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689)

            19:20:08,774 ERROR [stderr] (http--localhost-8080-8)    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)

            19:20:08,774 ERROR [stderr] (http--localhost-8080-8)    at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80)

            19:20:08,775 ERROR [stderr] (http--localhost-8080-8)    at com.test.aspects.TaskNotificationAspect.notifyCompleteTask(TaskNotificationAspect.java:133)

            19:20:08,775 ERROR [stderr] (http--localhost-8080-8)    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

            19:20:08,775 ERROR [stderr] (http--localhost-8080-8)    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

            19:20:08,775 ERROR [stderr] (http--localhost-8080-8)    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

            19:20:08,781 ERROR [stderr] (http--localhost-8080-8)    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952)

            19:20:08,781 ERROR [stderr] (http--localhost-8080-8)    at java.lang.Thread.run(Thread.java:745)

            19:20:08,781 ERROR [stderr] (http--localhost-8080-8) Caused by: javax.persistence.PersistenceException: org.hibernate.exception.GenericJDBCException: could not load an entity: [org.jbpm.task.Task#3]

            19:20:08,781 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.ejb.AbstractEntityManagerImpl.convert(AbstractEntityManagerImpl.java:1387)

            19:20:08,782 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:800)

            19:20:08,782 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:754)

            19:20:08,782 ERROR [stderr] (http--localhost-8080-8)    at org.jbpm.task.service.persistence.TaskPersistenceManager.findEntity(TaskPersistenceManager.java:212)

            19:20:08,782 ERROR [stderr] (http--localhost-8080-8)    at org.jbpm.task.service.TaskServiceSession$15.doOperation(TaskServiceSession.java:1071)

            19:20:08,782 ERROR [stderr] (http--localhost-8080-8)    at org.jbpm.task.service.TaskServiceSession.doOperationInTransaction(TaskServiceSession.java:1115)

            19:20:08,782 ERROR [stderr] (http--localhost-8080-8)    ... 75 more

            19:20:08,782 ERROR [stderr] (http--localhost-8080-8) Caused by: org.hibernate.exception.GenericJDBCException: could not load an entity: [org.jbpm.task.Task#3]

            19:20:08,782 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)

            19:20:08,783 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)

            19:20:08,783 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

            19:20:08,783 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.loader.Loader.loadEntity(Loader.java:2041)

            19:20:08,783 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:86)

            19:20:08,783 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.loader.entity.AbstractEntityLoader.load(AbstractEntityLoader.java:76)

            19:20:08,783 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.persister.entity.AbstractEntityPersister.load(AbstractEntityPersister.java:32

            19:20:08,783 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.event.def.DefaultLoadEventListener.loadFromDatasource(DefaultLoadEventListener.java:496)

            19:20:08,783 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.event.def.DefaultLoadEventListener.doLoad(DefaultLoadEventListener.java:477)

            19:20:08,783 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:227)

            19:20:08,784 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:285)

            19:20:08,784 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:152)

            19:20:08,784 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:1090)

            19:20:08,784 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.impl.SessionImpl.get(SessionImpl.java:1005)

            19:20:08,784 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.impl.SessionImpl.get(SessionImpl.java:998)

            19:20:08,784 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:779)

            19:20:08,784 ERROR [stderr] (http--localhost-8080-8)    ... 79 more

            19:20:08,784 ERROR [stderr] (http--localhost-8080-8) Caused by: java.sql.SQLException: Error

            19:20:08,784 ERROR [stderr] (http--localhost-8080-8)    at org.jboss.jca.adapters.jdbc.WrappedConnection.checkException(WrappedConnection.java:1621)

            19:20:08,785 ERROR [stderr] (http--localhost-8080-8)    at org.jboss.jca.adapters.jdbc.WrappedStatement.checkException(WrappedStatement.java:1240)

            19:20:08,785 ERROR [stderr] (http--localhost-8080-8)    at org.jboss.jca.adapters.jdbc.WrappedResultSet.checkException(WrappedResultSet.java:4041)

            19:20:08,785 ERROR [stderr] (http--localhost-8080-8)    at org.jboss.jca.adapters.jdbc.WrappedResultSet.getString(WrappedResultSet.java:1363)

            19:20:08,785 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.type.descriptor.sql.VarcharTypeDescriptor$2.doExtract(VarcharTypeDescriptor.java:61)

            19:20:08,785 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:250)

            19:20:08,785 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.type.AbstractStandardBasicType.nullSafeGet(AbstractStandardBasicType.java:230)

            19:20:08,785 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.type.AbstractStandardBasicType.hydrate(AbstractStandardBasicType.java:331)

            19:20:08,786 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.loader.Loader.extractKeysFromResultSet(Loader.java:668)

            19:20:08,786 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:606)

            19:20:08,786 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.loader.Loader.doQuery(Loader.java:829)

            19:20:08,786 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)

            19:20:08,786 ERROR [stderr] (http--localhost-8080-8)    at org.hibernate.loader.Loader.loadEntity(Loader.java:2037)

            19:20:08,786 ERROR [stderr] (http--localhost-8080-8)    ... 91 more

            19:20:08,786 ERROR [stderr] (http--localhost-8080-8) Caused by: java.lang.NullPointerException

            19:20:08,786 ERROR [stderr] (http--localhost-8080-8)    at com.mysql.jdbc.ResultSetImpl.getStringInternal(ResultSetImpl.java:5720)

            19:20:08,786 ERROR [stderr] (http--localhost-8080-8)    at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5570)

            19:20:08,787 ERROR [stderr] (http--localhost-8080-8)    at com.mysql.jdbc.ResultSetImpl.getString(ResultSetImpl.java:5610)

            19:20:08,787 ERROR [stderr] (http--localhost-8080-8)    at org.jboss.jca.adapters.jdbc.WrappedResultSet.getString(WrappedResultSet.java:1359)

            19:20:08,787 ERROR [stderr] (http--localhost-8080-8)    ... 102 more

            19:20:08,787 ERROR [stderr] (http--localhost-8080-2) org.jboss.jca.core.spi.transaction.local.LocalXAException: IJ001151: Trying to start a new transaction when old is not complete: Old: < formatId=131076, gtrid_length=29, bqual_length=28, tx_uid=0:ffff7f000101:-6ba6af63:552bbabb:362, node_name=1, branch_uid=0:ffff7f000101:-6ba6af63:552bbabb:364, eis_name=unknown eis name >, New < formatId=131076, gtrid_length=29, bqual_length=28, tx_uid=0:ffff7f000101:-6ba6af63:552bbabb:367, node_name=1, branch_uid=0:ffff7f000101:-6ba6af63:552bbabb:36a, eis_name=unknown eis name >, Flags 0

            19:20:08,787 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.tx.jbossts.LocalXAResourceImpl.start(LocalXAResourceImpl.java:103)

            19:20:08,787 ERROR [stderr] (http--localhost-8080-2)    at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:630)

            19:20:08,788 ERROR [stderr] (http--localhost-8080-2)    at com.arjuna.ats.internal.jta.transaction.arjunacore.TransactionImple.enlistResource(TransactionImple.java:391)

            19:20:08,788 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener$TransactionSynchronization.enlist(TxConnectionListener.java:587)

            19:20:08,788 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.enlist(TxConnectionListener.java:264)

            19:20:08,788 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:423)

            19:20:08,788 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:602)

            19:20:08,788 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:470)

            19:20:08,788 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:129)

            19:20:08,788 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.connection.DatasourceConnectionProvider.getConnection(DatasourceConnectionProvider.java:92)

            19:20:08,789 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

            19:20:08,789 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)

            19:20:08,789 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)

            19:20:08,789 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1700)

            19:20:08,789 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.loader.Loader.doQuery(Loader.java:801)

            19:20:08,789 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)

            19:20:08,789 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)

            19:20:08,789 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:62)

            19:20:08,800 ERROR [stderr] (http--localhost-8080-2)    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:952)

            19:20:08,800 ERROR [stderr] (http--localhost-8080-2)    at java.lang.Thread.run(Thread.java:745)

            19:20:08,802 WARNING [org.hibernate.util.JDBCExceptionReporter] (http--localhost-8080-2) SQL Error: 0, SQLState: null

            19:20:08,803 SEVERE [org.hibernate.util.JDBCExceptionReporter] (http--localhost-8080-2) javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@b4a6b15[state=DESTROYED managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@785bd667 connection handles=0 lastUse=1428933008733 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@555941ec pool internal context=org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool@258b4704 xaResource=org.jboss.jca.core.tx.jbossts.LocalXAResourceImpl@42bc357d txSync=null]

            19:20:08,805 ERROR [stderr] (http--localhost-8080-2) org.hibernate.exception.GenericJDBCException: Cannot open connection

            19:20:08,806 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:140)

            19:20:08,806 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:128)

            19:20:08,806 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)

            19:20:08,806 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:52)

            19:20:08,806 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:449)

            19:20:08,806 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.jdbc.ConnectionManager.getConnection(ConnectionManager.java:167)

            19:20:08,807 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.jdbc.AbstractBatcher.prepareQueryStatement(AbstractBatcher.java:161)

            19:20:08,807 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.loader.Loader.prepareQueryStatement(Loader.java:1700)

            19:20:08,807 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.loader.Loader.doQuery(Loader.java:801)

            19:20:08,807 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)

            19:20:08,807 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)

            19:20:08,807 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:62)

            19:20:08,807 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:627)

            19:20:08,807 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)

            19:20:08,808 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1863)

            19:20:08,808 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:369)

            19:20:08,808 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)

            19:20:08,808 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.collection.PersistentBag.iterator(PersistentBag.java:272)

            19:20:08,823 ERROR [stderr] (http--localhost-8080-2)    at org.hibernate.jdbc.ConnectionManager.openConnection(ConnectionManager.java:446)

            19:20:08,823 ERROR [stderr] (http--localhost-8080-2)    ... 90 more

            19:20:08,824 ERROR [stderr] (http--localhost-8080-2) Caused by: javax.resource.ResourceException: IJ000457: Unchecked throwable in managedConnectionReconnected() cl=org.jboss.jca.core.connectionmanager.listener.TxConnectionListener@b4a6b15[state=DESTROYED managed connection=org.jboss.jca.adapters.jdbc.local.LocalManagedConnection@785bd667 connection handles=0 lastUse=1428933008733 trackByTx=false pool=org.jboss.jca.core.connectionmanager.pool.strategy.OnePool@555941ec pool internal context=org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool@258b4704 xaResource=org.jboss.jca.core.tx.jbossts.LocalXAResourceImpl@42bc357d txSync=null]

            19:20:08,824 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:607)

            19:20:08,824 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.allocateConnection(AbstractConnectionManager.java:470)

            19:20:08,824 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.adapters.jdbc.WrapperDataSource.getConnection(WrapperDataSource.java:129)

            19:20:08,824 ERROR [stderr] (http--localhost-8080-2)    ... 92 more

            19:20:08,825 ERROR [stderr] (http--localhost-8080-2) Caused by: javax.resource.ResourceException: Could not enlist in transaction on entering meta-aware object

            19:20:08,825 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:430)

            19:20:08,825 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.connectionmanager.AbstractConnectionManager.reconnectManagedConnection(AbstractConnectionManager.java:602)

            19:20:08,825 ERROR [stderr] (http--localhost-8080-2)    ... 94 more

            19:20:08,826 ERROR [stderr] (http--localhost-8080-2) Caused by: javax.transaction.SystemException: IJ000356: Failed to enlist: java.lang.Throwable: Unabled to enlist resource, see the previous warnings. tx=TransactionImple < ac, BasicAction: 0:ffff7f000101:-6ba6af63:552bbabb:367 status: ActionStatus.ABORT_ONLY >

            19:20:08,826 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener$TransactionSynchronization.checkEnlisted(TxConnectionListener.java:552)

            19:20:08,826 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.connectionmanager.listener.TxConnectionListener.enlist(TxConnectionListener.java:282)

            19:20:08,826 ERROR [stderr] (http--localhost-8080-2)    at org.jboss.jca.core.connectionmanager.tx.TxConnectionManagerImpl.managedConnectionReconnected(TxConnectionManagerImpl.java:423)

            19:20:08,826 ERROR [stderr] (http--localhost-8080-2)    ... 95 more

             

            Thanks,

            Maria Prabudass