Bug 1304051

Summary: [GSS](6.2.z)Cannot find KieModule with LATEST
Product: [Retired] JBoss BRMS Platform 6 Reporter: Alessandro Lazarotti <alazarot>
Component: Business CentralAssignee: Mario Fusco <mfusco>
Status: CLOSED EOL QA Contact: Tibor Zimanyi <tzimanyi>
Severity: urgent Docs Contact:
Priority: urgent    
Version: 6.2.0CC: etirelli, jlocker, lpetrovi, mfusco, tzimanyi
Target Milestone: CR1   
Target Release: 6.2.2   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 1303018 Environment:
Last Closed: 2020-03-27 19:34:19 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:
Bug Depends On: 1303018    
Bug Blocks: 1309326, 1309327    

Description Alessandro Lazarotti 2016-02-02 18:15:31 UTC
+++ This bug was initially created as a clone of Bug #1303018 +++

Description of problem:

Customer is trying to access KieJar using "LATEST" key word via KieScanner but if jar is built today, it's working and if jar is old (not built today) than it's not working.

This is similar bug filed on community.

https://issues.jboss.org/browse/DROOLS-465

Version-Release number of selected component (if applicable):
BRMS 6.1.0 and BRMS 6.2.0

How reproducible:
try to access any old kie-jar (not built today) via KieScanner using LATEST key word.

For Example :
public class SampleRuleExecution {
	
	private  static KieServices ks = null;
	private static  KieContainer contnrExceptionLD = null;
	
	public static void main(String[] args){
		try{
	    	ks = KieServices.Factory.get();
	    	
	    	ReleaseId releaseId = ks.newReleaseId("example", "SampleProject", "LATEST"); //6.1.0
	    	System.out.println("releaseId : " + releaseId.getGroupId() + " : " + releaseId.getArtifactId() + " : " + releaseId.getVersion() );
			contnrExceptionLD = ks.newKieContainer(releaseId);
    	}catch(Exception e){
    		e.printStackTrace();
    	}
	}
}

Actual results:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
java.lang.RuntimeException: Cannot find KieModule: example:SampleProject:LATEST
	at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:86)
	at com.sample.SampleRuleExecution.main(SampleRuleExecution.java:24)



Expected results:
Latest KieJar should be accessed from local maven repository.

Additional info:

Following are few more findings while working on this issue.

- If I am trying to access KieJar from sample java code via Kie-Scanner using "LATEST" key word and if the jar is built recently (today) than it is working properly where as if the project is not built today than kie-scanner is not considering the old jar (which is previously built and not built today) and facing this issue on BRMS 6.1.0 and 6.2.0.
 
- One more finding : If the "maven-metadata-loacl.xml" file is being updated manually by changing value of "lastUpdated" tag with latest value than it's working fine and in this scenario, it's not required to re-build the jar.
 
- While accessing jar from sample code (jar with old timestamp), than "maven-metadata-loacl.xml" is being removed from local repository and if you create new meta-data file than it's working fine.

--- Additional comment from JBoss Product and Program Management on 2016-01-29 05:20:19 EST ---

Since this issue was entered in Red Hat Bugzilla, the release flag has been
set to ? to ensure that it is properly evaluated for this release.

--- Additional comment from Petr Kočandrle on 2016-01-29 06:28:12 EST ---

I believe this is a problem in Business Central and not in the product Maven Repository delivered via CSP / hosted at maven.repository.redhat.com.

--- Additional comment from Suresh Pritmani on 2016-02-02 07:15:51 EST ---

As per SRM's request, prioritizing the bug request.

Comment 2 Mario Fusco 2016-02-24 13:59:16 UTC
Cherry-picked to 6.3.x branch with https://github.com/droolsjbpm/drools/compare/014f29c...eae76a6

Comment 3 Tibor Zimanyi 2016-03-08 08:08:09 UTC
Verified by running reproducer from [1].

[1] https://issues.jboss.org/browse/DROOLS-465