2 Replies Latest reply on Apr 14, 2015 12:07 PM by tujasiri

    JBPM 6.2 Console Running Under Wildfly, Simple Java Example Crashes

    tujasiri

      Greetings,

       

      I’ve recently deployed the JBPM Console, 6.2.0, within my Wildfly 8.2 container.  The web-based applications seem to work well – WildFly and jbpm-console.  I deployed the console using this tutorial ==> http://mswiderski.blogspot.com/2015/03/jbpm-62-installation-and-upgrade-from.html.  I have not yet configured persistence, nor added a datasource, as I’m only attempting to run this simple example first.

       

      I’m running all of this on an virtual 64-Bit Ubuntu server using Java SE Runtime Environment 1.7.0_65-b17.


      When I run the project as a Junit Test I get the following:

       

      • org.jbpm.process.builder.ProcessBuilderFactoryServiceImpl.newProcessBuilder(Lorg/drools/compiler/compiler/PackageBuilder;)Lorg/drools/compiler/compiler/ProcessBuilder;

              at org.drools.compiler.compiler.ProcessBuilderFactory.newProcessBuilder(ProcessBuilderFactory.java:11)

              at org.drools.compiler.compiler.PackageBuilder.createProcessBuilder(PackageBuilder.java:408)

              at org.drools.compiler.compiler.PackageBuilder.<init>(PackageBuilder.java:346)

              at org.drools.compiler.compiler.PackageBuilder.<init>(PackageBuilder.java:242)

              at org.drools.compiler.builder.impl.KnowledgeBuilderFactoryServiceImpl.newKnowledgeBuilder(KnowledgeBuilderFactoryServiceImpl.java:40)

              at org.kie.internal.builder.KnowledgeBuilderFactory.newKnowledgeBuilder(KnowledgeBuilderFactory.java:46)

              at org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment.<init>(SimpleRuntimeEnvironment.java:92)

              at org.jbpm.runtime.manager.impl.SimpleRuntimeEnvironment.<init>(SimpleRuntimeEnvironment.java:86)

              at org.jbpm.runtime.manager.impl.RuntimeEnvironmentBuilder.<init>(RuntimeEnvironmentBuilder.java:82)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

              at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)

              at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)

              at java.lang.reflect.Constructor.newInstance(Constructor.java:526)

              at java.lang.Class.newInstance(Class.java:374)

              at org.kie.api.runtime.manager.RuntimeEnvironmentBuilder$Factory.<clinit>(RuntimeEnvironmentBuilder.java:41)

              at com.sample.ProcessTest.testProcess(ProcessTest.java:38)

              at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

              at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

              at java.lang.reflect.Method.invoke(Method.java:606)

              at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)

              at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

              at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)

              at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

              at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)

              at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)

              at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)

              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

              at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

              at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

              at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)

              at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)

              at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)

              at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)

              at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

              at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

              at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

              at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

       

       

      My Java code is here (crashing @ environment = RuntimeEnvironmentBuilder.Factory.get() ):

       

      package com.sample;

       

      import org.jbpm.test.JbpmJUnitBaseTestCase;

      import org.junit.Test;

      import org.kie.api.KieBase;

      import org.kie.api.io.ResourceType;

      import org.kie.api.runtime.KieSession;

      import org.kie.api.runtime.manager.RuntimeEngine;

      import org.kie.api.runtime.manager.RuntimeEnvironment;

      import org.kie.api.runtime.manager.RuntimeEnvironmentBuilder;

      import org.kie.api.runtime.manager.RuntimeManager;

      import org.kie.api.runtime.manager.RuntimeManagerFactory;

      import org.kie.api.runtime.process.ProcessInstance;

      import org.kie.internal.io.ResourceFactory;

      import org.kie.internal.runtime.manager.context.EmptyContext;

      import org.kie.internal.utils.KieHelper;

       

       

      /**

      * This is a sample file to test a process.

      */

      public class xx extends JbpmJUnitBaseTestCase {

       

      @Test

      public void testProcess() {

       

       

      KieHelper kieHelper = new KieHelper();

       

      RuntimeEnvironment environment = null;

       

       

      environment = RuntimeEnvironmentBuilder.Factory.get()

      .newDefaultInMemoryBuilder()

      .addAsset(ResourceFactory.newClassPathResource("sample.bpmn2"), ResourceType.BPMN2)

                                      .addEnvironmentEntry("IS_JTA_TRANSACTION", false)

                                      .get();

       

      RuntimeManager manager = RuntimeManagerFactory.Factory.get().newSingletonRuntimeManager(environment);

       

       

      RuntimeEngine runtime = manager.getRuntimeEngine(EmptyContext.get());

       

       

      RuntimeEngine engine  = manager.getRuntimeEngine(EmptyContext.get());

       

      KieSession ksession = engine.getKieSession();

       

      ProcessInstance processInstance = ksession.startProcess("com.sample.bpmn.hello");

       

       

                      // check whether the process instance has completed successfully

      assertProcessInstanceCompleted(processInstance.getId(), ksession);

      assertNodeTriggered(processInstance.getId(), "Hello");

       

      manager.disposeRuntimeEngine(engine);

      manager.close();

      ksession.dispose();

       

              }

       

      }

       

      And here’s my pom.xml :

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">

      <modelVersion>4.0.0</modelVersion>

      <groupId>hellojbpm</groupId>

      <artifactId>hellojbpm</artifactId>

      <version>0.0.1-SNAPSHOT</version>

        <build>

          <plugins>

      <plugin>

      <artifactId>maven-compiler-plugin</artifactId>

              <version>3.1</version>

      <configuration>

      <source/>

      <target/>

      </configuration>

      </plugin>

      </plugins>

        </build>

      <dependencies>

      <dependency>

      <groupId>org.slf4j</groupId>

      <artifactId>slf4j-api</artifactId>

      <version>1.7.2</version>

      <scope>runtime</scope>

      </dependency>

              <dependency>

      <groupId>org.slf4j</groupId>

      <artifactId>slf4j-ext</artifactId>

      <version>1.7.2</version>

      <scope>runtime</scope>

      </dependency>

      <dependency>

      <groupId>org.jbpm</groupId>

      <artifactId>jbpm-audit</artifactId>

      <version>6.2.0.Final</version>

      <scope>runtime</scope>

      </dependency>

      <dependency>

      <groupId>org.kie</groupId>

      <artifactId>kie-api</artifactId>

      <version>6.2.0.Final</version>

      <scope>runtime</scope>

      </dependency>

      <dependency>

      <groupId>org.jbpm</groupId>

      <artifactId>jbpm-runtime-manager</artifactId>

      <version>6.2.0.Final</version>

      <scope>runtime</scope>

      </dependency>

      <dependency>

      <groupId>org.jbpm</groupId>

      <artifactId>jbpm-flow-builder</artifactId>

      <version>6.2.0.Final</version>

      <scope>runtime</scope>

      </dependency>

      <dependency>

      <groupId>org.jbpm</groupId>

      <artifactId>jbpm-flow</artifactId>

      <version>6.2.0.Final</version>

      <scope>runtime</scope>

      </dependency>

      <dependency>

      <groupId>org.drools</groupId>

      <artifactId>drools-compiler</artifactId>

      <version>6.2.0.Final</version>

      <scope>runtime</scope>

      </dependency>

      <dependency>

      <groupId>org.kie</groupId>

      <artifactId>kie-internal</artifactId>

      <version>6.2.0.Final</version>

      <scope>runtime</scope>

      </dependency>

      </dependencies>

      </project>

       

      Any help is appreciated!

      -TU

        • 1. Re: JBPM 6.2 Console Running Under Wildfly, Simple Java Example Crashes
          krisverlaenen

          Tajiri,

           

          Your paste seems to cut of the actual exception?  Is this a linking issue?

               org.jbpm.process.builder.ProcessBuilderFactoryServiceImpl.newProcessBuilder(Lorg/drools/compiler/compiler/PackageBuilder;)Lorg/drools/compiler/compiler/ProcessBuilder;

           

          If it is, I guess this would indicate you have a non-matching version of the drools-compiler and jbpm-flow-builder jars in your classpath.

           

          Kris

          • 2. Re: JBPM 6.2 Console Running Under Wildfly, Simple Java Example Crashes
            tujasiri

            krisverlaenen,

             

            I did not realize that the exception was cut Kris.  What's missing is "java.lang.AbstractMethodError:".  I included a library copied from another machine and there was indeed an older copy (from jbpm 6.0.1)  in that directory.

             

            After adding about 10 other libraries and/or dependencies, I now get the following:

                java.lang.NullPointerException

                at org.jbpm.runtime.manager.impl.RuntimeManagerFactoryImpl.getSessionFactory(RuntimeManagerFactoryImpl.java:103)

                at org.jbpm.runtime.manager.impl.RuntimeManagerFactoryImpl.newSingletonRuntimeManager(RuntimeManagerFactoryImpl.java:59)

                at org.jbpm.runtime.manager.impl.RuntimeManagerFactoryImpl.newSingletonRuntimeManager(RuntimeManagerFactoryImpl.java:55)

            at com.sample.ProcessTest.testProcess(ProcessTest.java:53) ==>


            environment = RuntimeEnvironmentBuilder.Factory.get()

                                .newDefaultInMemoryBuilder()

                                .addAsset(ResourceFactory.newClassPathResource("sample.bpmn2"), ResourceType.BPMN2)

                                .addEnvironmentEntry("IS_JTA_TRANSACTION", false)

                                .get();

             

                at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

                at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

                at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

                at java.lang.reflect.Method.invoke(Method.java:606)

                at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)

                at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

                at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)

                at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)

                at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)

                at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:27)

                at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

                at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

                at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

                at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)

                at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)

                at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)

                at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)

                at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

                at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

                at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

                at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)