0 Replies Latest reply on Dec 14, 2015 8:23 PM by Naresh Iytha Vijaykumar

    Jbpm 6.3.0 as a module in Jboss 6.3 EAP

    Naresh Iytha Vijaykumar Newbie

      Hi,

      I am trying to use JBPM 6.3.0 as a module in JBoss EAP 6.3 and not able to succeed since I get ClassNotFoundException during deployment.

      (I have developed a restful service using JAX-RS api which exposes process/task operations as services for external entities to consume.)


      Below is the stack trace

      20:03:22,040 INFO  [org.jboss.as.jpa] (ServerService Thread Pool -- 48) JBAS011402: Starting Persistence Unit Service 'JbpmService.war#org.jbpm.domain'

      20:03:22,180 INFO  [org.hibernate.annotations.common.Version] (ServerService Thread Pool -- 48) HCANN000001: Hibernate Commons Annotations {4.0.1.Final-redhat-2}

      20:03:22,180 INFO  [org.hibernate.Version] (ServerService Thread Pool -- 48) HHH000412: Hibernate Core {4.2.14.SP1-redhat-1}

      20:03:22,180 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 48) HHH000206: hibernate.properties not found

      20:03:22,196 INFO  [org.hibernate.cfg.Environment] (ServerService Thread Pool -- 48) HHH000021: Bytecode provider name : javassist

      20:03:22,211 INFO  [org.hibernate.ejb.Ejb3Configuration] (ServerService Thread Pool -- 48) HHH000204: Processing PersistenceUnitInfo [

        name: org.jbpm.domain

        ...]

      20:03:22,227 WARN  [org.jboss.as.jpa] (ServerService Thread Pool -- 48) JBAS011408: Could not load entity class 'com.jbpmService.jbpmRuntime.JbpmHelper$1', ignoring this error and continuing with application deployment: java.lang.NoClassDefFoundError: org/kie/api/task/UserGroupCallback

        at java.lang.ClassLoader.defineClass1(Native Method) [rt.jar:1.8.0_60]

        at java.lang.ClassLoader.defineClass(ClassLoader.java:760) [rt.jar:1.8.0_60]

        at java.lang.ClassLoader.defineClass(ClassLoader.java:642) [rt.jar:1.8.0_60]

        at org.jboss.as.jpa.classloader.TempClassLoader.findClass(TempClassLoader.java:123) [jboss-as-jpa-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final-redhat-1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final-redhat-1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final-redhat-1]

        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final-redhat-1]

        at org.jboss.as.jpa.hibernate4.HibernateAnnotationScanner.getPackagesInJar(HibernateAnnotationScanner.java:171)

        at org.hibernate.ejb.Ejb3Configuration.addScannedEntries(Ejb3Configuration.java:492) [hibernate-entitymanager-4.2.14.SP1-redhat-1.jar:4.2.14.SP1-redhat-1]

        at org.hibernate.ejb.Ejb3Configuration.scanForClasses(Ejb3Configuration.java:861) [hibernate-entitymanager-4.2.14.SP1-redhat-1.jar:4.2.14.SP1-redhat-1]

        at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:606) [hibernate-entitymanager-4.2.14.SP1-redhat-1.jar:4.2.14.SP1-redhat-1]

        at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:75) [hibernate-entitymanager-4.2.14.SP1-redhat-1.jar:4.2.14.SP1-redhat-1]

        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:200) [jboss-as-jpa-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.access$600(PersistenceUnitServiceImpl.java:57) [jboss-as-jpa-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

        at org.jboss.as.jpa.service.PersistenceUnitServiceImpl$1.run(PersistenceUnitServiceImpl.java:99) [jboss-as-jpa-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0_60]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0_60]

        at java.lang.Thread.run(Thread.java:745) [rt.jar:1.8.0_60]

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

      Caused by: java.lang.ClassNotFoundException: org.kie.api.task.UserGroupCallback

        at org.jboss.as.jpa.classloader.TempClassLoader.findClass(TempClassLoader.java:79) [jboss-as-jpa-7.4.0.Final-redhat-19.jar:7.4.0.Final-redhat-19]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassUnchecked(ConcurrentClassLoader.java:459) [jboss-modules.jar:1.3.3.Final-redhat-1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClassChecked(ConcurrentClassLoader.java:408) [jboss-modules.jar:1.3.3.Final-redhat-1]

        at org.jboss.modules.ConcurrentClassLoader.performLoadClass(ConcurrentClassLoader.java:389) [jboss-modules.jar:1.3.3.Final-redhat-1]

        at org.jboss.modules.ConcurrentClassLoader.loadClass(ConcurrentClassLoader.java:134) [jboss-modules.jar:1.3.3.Final-redhat-1]

        ... 20 more



      Below steps have been done so far


      [1] Configured MySQL in JBoss

      [2] I was able to get the  6.3 modules from http://repository.jboss.org/nexus/content/groups/public/org/kie/kie-eap-distributions-bpms-layer/

      [3] Defined the global-modules in standalone.xml

      [4] Loading the persistence.xml from the WEB-INF/classes/META-INF of the war

      [5] Included the jbpm module in jboss-deployment-structure.xml@

       

      My module.xml is

      <resources>

        <resource-root path="jbpm-executor-6.3.0.Final.jar"/>

        <resource-root path="jbpm-shared-services-6.3.0.Final.jar"/>

        <resource-root path="jbpm-audit-6.3.0.Final.jar"/>

        <resource-root path="jbpm-human-task-audit-6.3.0.Final.jar"/>

        <resource-root path="jbpm-query-jpa-6.3.0.Final.jar"/>

        <resource-root path="jbpm-human-task-jpa-6.3.0.Final.jar"/>

        <resource-root path="jbpm-workitems-6.3.0.Final.jar"/>

        <resource-root path="jbpm-bpmn2-6.3.0.Final.jar"/>

        <resource-root path="jbpm-flow-builder-6.3.0.Final.jar"/>

        <resource-root path="jbpm-flow-6.3.0.Final.jar"/>

        <resource-root path="jbpm-workitems-6.3.0.Final.jar"/>

        <resource-root path="jbpm-bpmn2-emfextmodel-6.3.0.Final.jar"/>

        <resource-root path="jbpm-bpmn2-6.3.0.Final.jar"/>

        <resource-root path="jbpm-document-6.3.0.Final.jar"/>

        <resource-root path="jbpm-human-task-core-6.3.0.Final.jar"/>

        <resource-root path="jbpm-human-task-workitems-6.3.0.Final.jar"/>

        <resource-root path="jbpm-kie-services-6.3.0.Final.jar"/>

        <resource-root path="jbpm-persistence-jpa-6.3.0.Final.jar"/>

        <resource-root path="jbpm-runtime-manager-6.3.0.Final.jar"/>

        <resource-root path="jbpm-services-api-6.3.0.Final.jar"/>

        <resource-root path="jbpm-workitems-6.3.0.Final.jar"/>

        <resource-root path="drools-persistence-jpa-6.3.0.Final.jar"/>

        </resources>

       

          <dependencies>

        <module name="org.slf4j" export="false" slot="main" services="import" optional="false"/>

        <module name="org.apache.neethi" export="false" slot="main" services="import" optional="false"/>

        <module name="com.google.protobuf" export="false" slot="main" services="import" optional="false"/>

        <module name="org.jdom" export="false" slot="main" services="import" optional="false"/>

        <module name="org.joda.time" export="false" slot="main" services="import" optional="false"/>                    

        <module name="org.mvel" export="false" slot="main" services="import" optional="false"/>

        <module name="org.reflections" export="false" slot="main" services="import" optional="false"/>

        <module name="com.thoughtworks.xstream" export="false" slot="main" services="import" optional="false"/>

        <module name="org.apache.commons.codec" export="false" slot="main" services="import" optional="false"/>

        <module name="org.apache.commons.io" export="false" slot="main" services="import" optional="false"/>

        <module name="org.apache.commons.lang3" export="false" slot="main" services="import" optional="false"/>

        <module name="org.apache.commons.collections" export="false" slot="main" services="import" optional="false"/>

        <module name="org.apache.commons.exec" export="false" slot="main" services="import" optional="false"/>

        <module name="org.apache.httpcomponents" export="false" slot="main" services="import" optional="false"/>

        <module name="org.apache.commons.compress" export="false" slot="main" services="import" optional="false"/>

        <module name="org.apache.maven" export="false" slot="main" services="import" optional="false"/>

        <module name="org.apache.ws.xmlschema" export="false" slot="main" services="import" optional="false"/>

        <module name="org.freemarker" export="false" slot="main" services="import" optional="false"/>

        <module name="org.eclipse.aether" export="false" slot="main" services="import" optional="false"/>

        <module name="javaee.api" export="false" slot="main" services="import" optional="false"/>

        <module name="javax.activation.api" export="false" slot="main" services="import" optional="false"/>

        <module name="javax.wsdl4j.api" export="false" slot="main" services="import" optional="false"/>

        <module name="com.fasterxml.jackson" export="false" slot="main" services="import" optional="false"/>

        <module name="com.opensymphony.quartz" export="false" slot="main" services="import" optional="false"/>

        <module name="com.sun.xml.bind" export="false" slot="main" services="import" optional="false"/>

        <module name="javax.annotation.api" export="false" slot="main" services="import" optional="false"/>

        <module name="javax.api" export="false" slot="main" services="import" optional="false"/>

        <module name="javax.el.api" export="false" slot="main" services="import" optional="false"/>

        <module name="javax.jms.api" export="false" slot="main" services="import" optional="false"/>

        <module name="javax.mail.api" export="false" slot="main" services="import" optional="false"/>

        <module name="javax.persistence.api" export="false" slot="main" services="import" optional="false"/>

        <module name="javax.security.jacc.api" export="false" slot="main" services="import" optional="false"/>

        <module name="javax.wsdl4j.api" export="false" slot="main" services="import" optional="false"/>

        <module name="org.apache.cxf" export="false" slot="main" services="import" optional="false"/>

        <module name="org.apache.cxf.impl" export="false" slot="main" services="import" optional="false"/>

        <module name="org.codehaus.jackson.jackson-core-asl" export="false" slot="main" services="import" optional="false"/>

        <module name="org.codehaus.jackson.jackson-mapper-asl" export="false" slot="main" services="import" optional="false"/>

        <module name="org.eclipse.emf" export="false" slot="main" services="import" optional="false"/>

        <module name="org.drools" export="false" slot="main" services="import" optional="false"/>

        <module name="org.hibernate" export="false" slot="main" services="import" optional="false"/>

        <module name="org.javassist" export="false" slot="main" services="import" optional="false"/>

        <module name="org.jboss.as.osgi.jta" export="false" slot="main" services="import" optional="false"/>

       

        <module name="org.apache.camel" export="false" slot="main" services="import" optional="false"/>

        <module name="org.osgi" export="false" slot="main" services="import" optional="false"/>

        <module name="org.osgi.core" export="false" slot="main" services="import" optional="false"/>

        <module name="org.kie" export="false" slot="main" services="import" optional="false"/>

          </dependencies>

        </module>

       

      Included the below dependencies in pom.xml

      <dependency>

        <groupId>org.jbpm</groupId>

        <artifactId>jbpm-flow</artifactId>

        <version>${jbpm.version}</version>

        <scope>provided</scope>

        <exclusions>

        <exclusion>

        <artifactId>kie-internal</artifactId>

        <groupId>org.kie</groupId>

        </exclusion>

        <exclusion>

        <artifactId>drools-core</artifactId>

        <groupId>org.drools</groupId>

        </exclusion>

        <exclusion>

        <artifactId>protobuf-java</artifactId>

        <groupId>com.google.protobuf</groupId>

        </exclusion>

        <exclusion>

        <artifactId>mvel2</artifactId>

        <groupId>org.mvel</groupId>

        </exclusion>

        <exclusion>

        <artifactId>slf4j-api</artifactId>

        <groupId>org.slf4j</groupId>

        </exclusion>

        <exclusion>

        <artifactId>joda-time</artifactId>

        <groupId>joda-time</groupId>

        </exclusion>

        </exclusions>

      </dependency>

      <dependency>

        <artifactId>hibernate-jpa-2.0-api</artifactId>

        <groupId>org.hibernate.javax.persistence</groupId>

        <version>1.0.1.Final</version>

        <scope>provided</scope>

      </dependency>

       

      Below is the code snippet that defines the RuntimeManager

      private RuntimeManager getRuntimeManager(List<String> processList) {

        EntityManagerFactory emf = Persistence.createEntityManagerFactory("org.jbpm.domain");

        RuntimeEnvironment environment = RuntimeEnvironmentBuilder.Factory.get().newDefaultBuilder()

        .entityManagerFactory(emf)

        .userGroupCallback(new UserGroupCallback() {

        public List<String> getGroupsForUser(String userId, List<String> groupIds, List<String> allExistingGroupIds) {

      ..

      ...

       

      }

       

      Can anyone please help me to get this fixed?