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

NoClassDefFoundError of dependent jar class during process execution

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Critical Critical
    • None
    • 6.0.1
    • jBPM Core
    • None
    • ER1
    • ?
    • Hide
      Fixed Issue Summary:

      A bug with handling maven dependencies in kie-ci occurred in which only direct dependencies of the project were taken, but the transitive dependencies were not. This would result in the following error:
      java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
      This issue has been resolved with 6.0.3, and the script runs without errors.
      Show
      Fixed Issue Summary: A bug with handling maven dependencies in kie-ci occurred in which only direct dependencies of the project were taken, but the transitive dependencies were not. This would result in the following error: java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext This issue has been resolved with 6.0.3, and the script runs without errors.

      Description of problem:

      This is the same projects as BZ1097632. (The difference: I applied Maciej's suggestion in comment#4. And edited jbpm-spring-dep-kjar/pom.xml as below)

      (A) Jar which uses Spring
      (B) Kjar which includes BPMN2 process which depends on (A) jar.
      (C) A main application which runs a process in (B) kjar.

      Please look into jbpm-spring-dep-test/jbpm-spring-dep-kjar/pom.xml

      I comment-out <dependency> for Spring libraries because (B) kjar just depends on (A) jar and I expect transitive dependencies will be resolved by maven.

      But when I run the process, Script Task fails with NoClassDefFoundError.

      =====
      java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext
      at org.jbpm.Process_org$u46$jbpm$u46$sample909675094.action0(Process_org$u46$jbpm$u46$sample909675094.java:18)
      at org.jbpm.Process_org$u46$jbpm$u46$sample909675094Action0Invoker.execute(Process_org$u46$jbpm$u46$sample909675094Action0Invoker.java:14)
      at org.jbpm.workflow.instance.impl.NodeInstanceImpl.executeAction(NodeInstanceImpl.java:182)
      at
      ...
      Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext
      at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
      at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
      at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
      ... 54 more
      ====

      Steps to Reproduce:
      1. Unzip the attached jbpm-spring-dep-test-new.zip
      2. cd jbpm-spring-dep-jar
      3. mvn clean install
      4. cd ../jbpm-spring-dep-kjar
      5. mvn clean install
      6. cd ../jbpm-spring-dep-main
      7. mvn test

      Actual results:

      Results :

      java.lang.NoClassDefFoundError: org/springframework/context/ApplicationContext

      Expected results:

      Test runs without error

            swiderski.maciej Maciej Swiderski (Inactive)
            rhn-support-tkobayas Toshiya Kobayashi
            Ivo Bek Ivo Bek
            Ivo Bek Ivo Bek
            Alessandro Lazarotti
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: