Bug 1312285 - OSGi: Drools/jBPM engine fails to build a BPMN2 process that uses domain classes
OSGi: Drools/jBPM engine fails to build a BPMN2 process that uses domain classes
Status: VERIFIED
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: BRE (Show other bugs)
6.3.0
Unspecified Unspecified
medium Severity high
: ER3
: 6.3.0
Assigned To: Mario Fusco
Marek Winkler
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2016-02-26 05:35 EST by Marek Winkler
Modified: 2016-04-18 09:07 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed:
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Exception stacktrace (1.89 KB, text/plain)
2016-02-26 05:35 EST, Marek Winkler
no flags Details
Exception stacktrace after BZ 1310039 fix (20.03 KB, text/plain)
2016-03-24 09:14 EDT, Marek Winkler
no flags Details

  None (edit)
Description Marek Winkler 2016-02-26 05:35:57 EST
Created attachment 1130812 [details]
Exception stacktrace

Description of problem:

Drools/jBPM engine fails to create the KieBase for BPMN process which references classes from domain jars installed as another bundle in OSGi container.

The error message "Unable to generate action invoker. org.jbpm.process.instance.impl.Action cannot be resolved to a type" indicates that there might be a missing Import-Package header. Indeed, when I enabled dynamic import (dev:dynamic-import <BUNDLE_ID>) on drools-compiler and drools-core bundles, the process was compiled successfully.

This bug is similar to BZ 1310039, with the following differences:
  - the issue happens not only in Blueprint, but also when you create the KieContainer with proper class loader,
  - there is the workaround (enabling dynamic imports in drools-core and drools-compiler bundles).

The problem will very likely be fixed in Drools, so I reported it here instead of jBPM - feel free to reassign.

Version-Release number of selected component (if applicable):
BPMS 6.2.1
Fuse 6.2.1

How reproducible:
always

Steps to Reproduce:
1. see the PR with reproducer - run KieBlueprintProcessDependencyKarafIntegrationTest
2. please be aware that to make the reproducer test pass completely, BZ 1310039 needs to be fixed too.

Actual results:

java.lang.RuntimeException: Error while creating KieBase[Message [id=1, level=ERROR, path=blueprint_process_dep/sampleProcess.bpmn2, line=-1, column=0
   text=Unable to generate action invoker. org.jbpm.process.instance.impl.Action cannot be resolved to a type], Message [id=2, level=ERROR, path=blueprint_process_dep/sampleRule.drl, line=11, column=0
   text=Unable to resolve ObjectType 'Assert'], Message [id=3, level=ERROR, path=blueprint_process_dep/sampleRule.drl, line=7, column=0
   text=Rule Compilation error Only a type can be imported. org.junit.Assert resolves to a package
assertInstance cannot be resolved to a variable], Message [id=4, level=ERROR, path=blueprint_process_dep/sampleRule.drl, line=1, column=0
   text=Error importing : 'org.junit.Assert']]
at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:460)
...


Expected results:
KieBase is built without errors.
Comment 11 Marek Winkler 2016-03-24 09:14 EDT
Created attachment 1139956 [details]
Exception stacktrace after BZ 1310039 fix

Added updated stacktrace.
Comment 12 Mario Fusco 2016-03-24 10:47:43 EDT
Fixed by https://github.com/droolsjbpm/drools/commit/cc5a0b4ab
Comment 13 Marek Winkler 2016-04-01 04:31:51 EDT
Ryan, it seems that the commit with the fix has not made it into ER2, could you please double check?

It seems present on 6.4.x branch [1], while it seems not present in sync-6.4.x-2016.03.24 tag.

[1] https://github.com/droolsjbpm/drools/commit/8c0d2dc0ab937fb7e76bfb6411a55d14affd42c8
Comment 14 Marek Winkler 2016-04-14 11:25:19 EDT
The missing commit is present in ER3, waiting for test results for final verification.
Comment 15 Marek Winkler 2016-04-18 09:07:03 EDT
Verified in BRMS 6.3.0 ER3.

Note You need to log in before you can comment on or make changes to this bug.