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

Bug 1092860

Summary: KieModuleMetaDataImpl's initialization and Builder's verifyExternalClass doesn't accord with Maven's default behavior
Product: [Retired] JBoss BPMS Platform 6 Reporter: kylin <ksoong>
Component: Business CentralAssignee: Mario Fusco <mfusco>
Status: CLOSED WONTFIX QA Contact: Marek Baluch <mbaluch>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.1CC: kverlaen, mwinkler, tkobayas
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-05-06 12:11:02 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
error log none

Description kylin 2014-04-30 06:47:38 UTC
Description of problem:

org.kie.scanner.KieModuleMetaDataImpl's init() method add all dependencies' package to a package set
   Set<String> packages = new HashSet<String>();
and add all classes to class map
   Map<String, Collection<String>> classes = new HashMap<String, Collection<String>>();

Then in org.guvnor.common.services.builder.Builder's verifyExternalClass() method verified class like
~~~
        clazz.getDeclaredConstructors();
        clazz.getDeclaredFields();
        clazz.getDeclaredMethods();
        clazz.getDeclaredClasses();
        clazz.getDeclaredAnnotations();
~~~

This may cause class not found error, because Maven's default behavior didn't load the filed class referred jars to class path, this cause Build & Deploy failed.

I will add reproduce project shortly

Comment 2 kylin 2014-04-30 07:02:01 UTC
Created attachment 891025 [details]
reproduce

Comment 3 kylin 2014-04-30 07:24:26 UTC
How to Reproduce
================

1. start BPMS 6 with remote debug enable

2. download reproduce.zip, login to business-central, select Authoring -> Artifact repository ->Upload, upload attached checkservice-1.0.jar

3. create a new project, add checkservice-1.0.jar as dependency

4. Build & Deploy the new created project. Build & Deploy,

5. add breakpoint at org.kie.scanner.KieModuleMetaDataImpl's init() method, you will find all packeges and class under package be picked up add saved.

6. add reakpoint at org.guvnor.common.services.builder.Builder's verifyExternalClass() method, you will find verified failed due to Maven doesn't load implicit class to class path cause no class found error

Comment 4 kylin 2014-04-30 07:44:18 UTC
Created attachment 891062 [details]
error log

Comment 5 kylin 2014-04-30 07:59:03 UTC
I need add 2 supplements

* from business-central, execute Build & Deploy, the "Build Successful" prompt, but no deployments in Deploy -> Deployments, so build failed

* Build failed with lots of WARN output as attached server.log, 

https://bugzilla.redhat.com/show_bug.cgi?id=1092839

has recorded this.

Comment 6 Mario Fusco 2014-05-06 11:52:54 UTC
*** Bug 1094295 has been marked as a duplicate of this bug. ***

Comment 7 Mario Fusco 2014-05-06 12:10:25 UTC
That verifyExternalClass() method is necessary and it has been added to solve the other issue reported here: https://bugzilla.redhat.com/show_bug.cgi?id=1007055