Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1074962

Summary: unable to run all test scenarion after editing kmodule.xml
Product: [Retired] JBoss BPMS Platform 6 Reporter: Anantya Wibowo <anantya.wibowo>
Component: Business CentralAssignee: Kris Verlaenen <kverlaen>
Status: CLOSED EOL QA Contact: Lukáš Petrovický <lpetrovi>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.0CC: anantya.wibowo, kverlaen, trikkola
Target Milestone: ER5   
Target Release: 6.1.0   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-03-27 19:37:21 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
project files containing all test and edited kmodule.xml none

Description Anantya Wibowo 2014-03-11 09:47:07 UTC
Description of problem:


Version-Release number of selected component (if applicable): 6.0.0.GA


How reproducible:easy


Steps to Reproduce:
1. create for example 5 rules
2. create positive and negative test scenarios on all rules
3. edit file kmodule.xml
4. re run all tests should fail with message : 
Unable to complete your request. The following exception occurred: Cannot instance WorkItemHandler new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler().

Actual results:
Unable to complete your request. The following exception occurred: Cannot instance WorkItemHandler new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler().


Expected results:
all test scenarios success

Additional info:
after we edit kmodule.xml in META-INF folder.. all test scenario become unable to execute. the error is :
Unable to complete your request. The following exception occurred: Cannot instance WorkItemHandler new org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler().

any idea how to solve this? because we need to re run all our test scenario again eventhough after editing kmodule.xml

Comment 2 Kris Verlaenen 2014-03-13 13:27:46 UTC
Is this in Eclipse? What changes do you do when you edit kmodule.xml?  Could you attach a project that we can use to reproduce this issue?

Comment 3 Anantya Wibowo 2014-03-14 04:33:24 UTC
Created attachment 874236 [details]
project files containing all test and edited kmodule.xml

Comment 4 Anantya Wibowo 2014-03-14 04:34:42 UTC
no. i edited from business-central web app on browser.

Comment 5 Kris Verlaenen 2014-04-01 13:30:31 UTC
I reproduced this on 6.0.1.CR2.  Michael, it seems that when the test scenario is instantiating a ksession, it does not have the jbpm-flow jar in the classpath?

Comment 6 manstis 2014-04-01 13:40:49 UTC
Does the project have a dependency for jbpm-flow?

How could it be expected to consume classes (org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler) in it, without the dependency?

Comment 7 manstis 2014-04-07 14:22:15 UTC
Two issues need resolving (by reporter):

(1) Please explain how you expect to consume jBPM classes (org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler) without including the library as a project dependency

(2) Please attach insurance-model.jar (needed by the project you've attached).

Comment 8 Kris Verlaenen 2014-04-08 13:36:52 UTC
Michael, I was able to reproduce this, simply adding the handler to the kmodule.xml and then running any rule scenario seems to introduce the issue.  Note that the handler is available in jbpm-flow, and projects don't define dependencies to the core jars (they are assumed provided), so I would expect this to be available when running the scenario tests as well.

Comment 9 manstis 2014-04-09 07:35:39 UTC
"Note that the handler is available in jbpm-flow, and projects don't define dependencies to the core jars (they are assumed provided)". 

This understanding is incorrect. The classpath for projects is *only* themselves + dependencies. KIE does not handle either explicit *provided* scope dependencies nor implicit (as would be the case with your understanding).

(In reply to Kris Verlaenen from comment #8)
> Michael, I was able to reproduce this, simply adding the handler to the
> kmodule.xml and then running any rule scenario seems to introduce the issue.
> Note that the handler is available in jbpm-flow, and projects don't define
> dependencies to the core jars (they are assumed provided), so I would expect
> this to be available when running the scenario tests as well.

Comment 10 manstis 2014-04-09 10:57:48 UTC
There are two issues here:

(1) The WIH definition needs to be corrected to just their FQCNs:-

<workItemHandler type="org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler" name="Log"/><workItemHandler type="org.jbpm.process.workitem.bpmn2.ServiceTaskHandler" name="Service Task"/>

(2) Use of the demo WIHs in the kmodule.xml can be solved *if* we include jbpm-flow.jar with the web application. However my question is *should* we bundle jbpm-flow just because the project attached to this BZ uses the demo WIHs?

What if the project used a custom WIH? The applicable JAR would need to be included as a project dependency. Why is using the demo WIHs any different? IMO it's up to the user to include the applicable dependencies.

Comment 11 manstis 2014-04-09 13:46:45 UTC
It appears this could be an issue with "modules". 

jbpm-flow is included in both BRMS and BPMS's module definitions however the class "org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler" cannot be found by org.drools.compiler.kie.util.CDIHelper.wireListnersAndWIHs().

The reported error can be replicated with drools-wb (running in GWT's Hosted Mode, i.e. on Jetty). If I add org.jbpm:jbpm-flow as a dependency to the webapp (so it appears in WEB-INF/lib) the reported problem is fixed.

Kris said he'd take a look at the module configuration.

Comment 12 Kris Verlaenen 2014-11-03 14:40:18 UTC
Jeremy, this was reported as a modules issue on 6.0, although it might already be solved, could you possibly try reproducing this on 6.2.x and if you can't reproduce move this issue to MODIFIED?  Thanks!

Comment 14 Jeremy Lindop 2015-01-15 12:18:40 UTC
I've reproduced this with the current 6.3.0-SNAPSHOT builds on EAP6.3 and the error happens both with the fat war and the skinny war. This means it doesn't look like a modules problem.

Comment 15 Kris Verlaenen 2015-01-16 16:28:21 UTC
Reproduce by making a new (empty) project, add a default kbase and stateful ksession and then add the work item handler
"Log" -> "org.jbpm.process.instance.impl.demo.SystemOutWorkItemHandler"

Works fine with fat war, since modularized wars are being removed setting this to MODIFIED.

Comment 16 Pavel Kralik 2015-03-24 15:57:08 UTC
BPMS 6.1.0.ER6

Comment 18 Red Hat Bugzilla 2023-09-14 02:04:47 UTC
The needinfo request[s] on this closed bug have been removed as they have been unresolved for 1000 days