1 Reply Latest reply on Sep 8, 2015 2:21 AM by chetan.math

    Issue when running jbpm 6.1.0. with apache-tomcat-8.0.23 and java JRE 1.8.0_51

    chetan.math

      Currently our application runs on jboss without any issues. Current Stack - jbpm 6.1.0.Final , jboss 7, jdk1.7.0_45 , oracle database

      We use jbpm api's  to to manage the process state.

       

      We are in the process of upgrading our platform and want to use tomcat going forward. I am trying to port our existing application on the new stack

      Tomcat 8.0.23 , Oracle JRE 1.8.0_51 , jbpm 6.1.0.Final & oracle database


      Have followed the instructions listed in the below references . Attaching Steps.txt listing all the steps followed

      References:

      https://github.com/droolsjbpm/kie-wb-distributions/tree/master/kie-wb/kie-wb-distribution-wars/src/main/assembly/tomcat7

      https://developer.jboss.org/people/bpmn2user/blog/2013/12/27/jbpm6--tomcat-7--web-example


      I am getting the below error, attaching logs for more information.

      Came across similar issues that others faced but could not find the resolution for it.

      Eg  https://developer.jboss.org/message/865873#865873

            https://developer.jboss.org/thread/248809

       

       

      I have created a sample mavenized project to help reproduce the issue. On server startup we create the RuntimeManager .[Attaching jbpmproject.zip]

      Application is not deployed due to the below error.

      Could you please suggest .

       

      Error Log:

      WARN : No default interceptor found of type org.jbpm.services.task.persistence.TaskTransactionInterceptor might be mssing jbpm-human-task-jpa module on classpath (error null

      INFO : CDI BeanManager cannot be found. Not sending event org.jboss.solder.servlet.event.ImplicitServletObjectsHolder$InternalServletContextEvent@2040ca0e with qualifiers [@org.jboss.solder.servlet.event.Initialized()]

      INFO : CDI BeanManager cannot be found. Not sending event org.jboss.solder.servlet.WebApplication@ac2b949e with qualifiers [@org.jboss.solder.servlet.event.Initialized()]

      INFO : CDI BeanManager cannot be found. Not sending event org.apache.catalina.core.ApplicationContextFacade@138d97cb with qualifiers [@org.jboss.solder.servlet.event.Initialized()]

      02-Aug-2015 14:24:40.686 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal One or more listeners failed to start. Full details will be found in the appropriate container log file

      02-Aug-2015 14:24:40.686 SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.startInternal Context [/jbpmproject] startup failed due to previous errors

      INFO : CDI BeanManager cannot be found. Not sending event org.jboss.solder.servlet.event.ImplicitServletObjectsHolder$InternalServletContextEvent@25ccdea3 with qualifiers [@org.jboss.solder.servlet.event.Destroyed()]

      DEBUG: Context destroyed

       

      SEVERE [localhost-startStop-1] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class com.company.util.ServletJBPMContext

      java.lang.IllegalStateException: No task persistence context available

        at org.jbpm.services.task.commands.TaskContext.getPersistenceContext(TaskContext.java:114)

        at org.jbpm.services.task.commands.InitDeadlinesCommand.execute(InitDeadlinesCommand.java:32)

        at org.jbpm.services.task.commands.InitDeadlinesCommand.execute(InitDeadlinesCommand.java:18)

        at org.jbpm.services.task.commands.TaskCommandExecutorImpl$SelfExecutionCommandService.execute(TaskCommandExecutorImpl.java:65)

        at org.jbpm.services.task.commands.TaskCommandExecutorImpl.execute(TaskCommandExecutorImpl.java:40)

        at org.jbpm.services.task.impl.TaskDeadlinesServiceImpl.initialize(TaskDeadlinesServiceImpl.java:367)

        at org.jbpm.services.task.HumanTaskConfigurator.getTaskService(HumanTaskConfigurator.java:153)

        at org.jbpm.runtime.manager.impl.factory.LocalTaskServiceFactory.newTaskService(LocalTaskServiceFactory.java:65)

        at org.jbpm.runtime.manager.impl.PerRequestRuntimeManager.init(PerRequestRuntimeManager.java:142)

        at org.jbpm.runtime.manager.impl.RuntimeManagerFactoryImpl.newPerRequestRuntimeManager(RuntimeManagerFactoryImpl.java:88)

        at org.jbpm.runtime.manager.impl.RuntimeManagerFactoryImpl.newPerRequestRuntimeManager(RuntimeManagerFactoryImpl.java:79)

        at com.company.util.PerRequestRuntimeManager.getRuntimeManager(PerRequestRuntimeManager.java:58)

        at com.company.util.ServletJBPMContext.contextInitialized(ServletJBPMContext.java:22)

        • 1. Re: Issue when running jbpm 6.1.0. with apache-tomcat-8.0.23 and java JRE 1.8.0_51
          chetan.math

          Identified and fixed the issue.

          The problem is in logging and the actual exception never gets logged.

          Class HumanTaskConfigurator.java

          protected void addDefaultInterceptor() {

              // add default interceptor if present

              try {

              Class<Interceptor> defaultInterceptorClass = (Class<Interceptor>) Class.forName(DEFAULT_INTERCEPTOR);

              Constructor<Interceptor> constructor = defaultInterceptorClass.getConstructor(new Class[] {Environment.class});

             

              Interceptor defaultInterceptor = constructor.newInstance(this.environment);

              interceptor(5, defaultInterceptor);

              } catch (Exception e) {

              logger.warn("No default interceptor found of type {} might be mssing jbpm-human-task-jpa module on classpath (error {}",

              DEFAULT_INTERCEPTOR, e.getMessage());

              }

              }

           

          The exception is consumed and warning message is displayed as below

          Error printed in logs  :

          WARN : No default interceptor found of type org.jbpm.services.task.persistence.TaskTransactionInterceptor might be mssing jbpm-human-task-jpa module on classpath (error null

          Actual Exception : Caused by: java.lang.ClassCastException: bitronix.tm.BitronixTransactionManager cannot be cast to javax.transaction.UserTransaction

          Had to ensure that btm.jar and jta.jar are in tomcat's lib folder and

          are not in my web app's WEB-INF/lib . I had jboss-transaction-api_1.1_spec-1.0.0.Final-sources.jar in my WEB-INF/lib

          The problem could have been eaisly fixed if the execption was logged correctly