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

Bug 1080121

Summary: NPE in KieScanner when building project with transitive deps in business-central
Product: [Retired] JBoss BRMS Platform 6 Reporter: Marek Winkler <mwinkler>
Component: BREAssignee: Mario Fusco <mfusco>
Status: CLOSED CURRENTRELEASE QA Contact: Marek Winkler <mwinkler>
Severity: high Docs Contact:
Priority: high    
Version: 6.0.1CC: etirelli, mfusco
Target Milestone: ER1   
Target Release: 6.0.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-08-06 19:53:49 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
server.log part with the stacktrace
none
Maven project with artifact to upload into business-central none

Description Marek Winkler 2014-03-24 17:40:25 UTC
Created attachment 878133 [details]
server.log part with the stacktrace

Description of problem:

Using business-central, when I upload a jar (see attachment) with a pom defining dependencies, which in turn define their own dependencies (i.e. the jar relies on some transitive dependencies), and I do not already have these transitive deps in my local maven repo, building a project in business-central throws a NPE in KieScanner:

18:07:00,414 ERROR [org.guvnor.common.services.builder.BuildServiceImpl] (pool-11-thread-1) null: java.lang.NullPointerException
	at org.kie.scanner.KieRepositoryScannerImpl.addDependencies(KieRepositoryScannerImpl.java:127)

Full stacktrace is attached.

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

BRMS 6.0.1 CR1

Steps to Reproduce:

It is important to ensure that the business-central uses a local maven repo which does not contain the transitive dependencies used by project-with-deps test project. I ensured this by modifying ~/.m2/settings.xml to contain <localRepository>myRepo</localRepository> and then starting business-central.

1. unzip the attached maven project and build it using the supplied settings.xml
   mvn clean install -s settings.xml
2. upload the created jar into business-central (Deployment-> Artifact repository-> Upload)
3. create a new project in business-central and add the uploaded artifact as a dependency
4. save and build the project

Actual results:

NPE is thrown and build fails.

Expected results:

Build succeeds.

Additional info:

This does not happen if business-central uses a local maven repository which already contains required artifacts (i.e. they got there for instance by building the attached project).

Comment 1 Marek Winkler 2014-03-24 17:43:38 UTC
Created attachment 878134 [details]
Maven project with artifact to upload into business-central

Comment 2 Mario Fusco 2014-03-25 09:24:10 UTC
Fixed by https://github.com/droolsjbpm/drools/commit/acb6e0bcb

Comment 3 Mario Fusco 2014-03-25 09:26:02 UTC
Cherry-picked to 6.0.x with https://github.com/droolsjbpm/drools/commit/ec93f4503

Comment 4 Marek Winkler 2014-05-06 09:21:56 UTC
Verified on BRMS 6.0.2 ER2.