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
Created attachment 895714 [details] jbpm-spring-dep-test-new.zip
Maciej, might this be solved by similar previous fixes?
this was indeed a bug with handling maven dependencies in kie-ci as it was only taking the direct dependencies of the project and not including transitive dependencies. fixed on master drools master: https://github.com/droolsjbpm/drools/commit/604f86c13596bc0d046753cacd8cd44221e09b60
backported to 6.0.x branch drools 6.0.x: https://github.com/droolsjbpm/drools/commit/a5549b276c934ce3bb92249abfde606d11e67bab
Verified in BPMS 6.0.3.ER1 (6.0.3-redhat-5) Output of the test is following: Starting ScriptTask Calling Spring Service Thread.currentThread().getContextClassLoader() = sun.misc.Launcher$AppClassLoader@3aeb203b CheckServiceClient.class.getClassLoader() = java.net.URLClassLoader@7548fbb4 Aug 26, 2014 4:03:48 PM org.springframework.context.support.AbstractApplicationContext prepareRefresh INFO: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@1ab7e237: startup date [Tue Aug 26 16:03:48 CEST 2014]; root of context hierarchy Aug 26, 2014 4:03:48 PM org.springframework.beans.factory.xml.XmlBeanDefinitionReader loadBeanDefinitions INFO: Loading XML bean definitions from URL [jar:file:/home/ibek/.m2/repository/com/sample/jbpm-spring-dep-jar/1.0.0-SNAPSHOT/jbpm-spring-dep-jar-1.0.0-SNAPSHOT.jar!/checkservice.xml] Aug 26, 2014 4:03:48 PM org.springframework.beans.factory.support.DefaultListableBeanFactory preInstantiateSingletons INFO: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@7eb6e1: defining beans [checkFeasibilityService]; root of factory hierarchy context.getClassLoader() = java.net.URLClassLoader@7548fbb4 false false Completed ScriptTask Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 10.749 sec