Bug 1303018 - Cannot find KieModule with LATEST
Cannot find KieModule with LATEST
Status: VERIFIED
Product: JBoss BRMS Platform 6
Classification: JBoss
Component: Business Central (Show other bugs)
6.2.0
Unspecified Unspecified
urgent Severity urgent
: DR2
: 6.3.0
Assigned To: Mario Fusco
Tomas David
:
Depends On:
Blocks: 1304051
  Show dependency treegraph
 
Reported: 2016-01-29 05:15 EST by Suresh Pritmani
Modified: 2016-03-24 02:02 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1304051 (view as bug list)
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)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker DROOLS-465 Major Resolved Cannot find KieModule with LATEST 2016-09-01 23:32 EDT

  None (edit)
Description Suresh Pritmani 2016-01-29 05:15:02 EST
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.
Comment 2 Petr Kočandrle 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.
Comment 3 Suresh Pritmani 2016-02-02 07:15:51 EST
As per SRM's request, prioritizing the bug request.
Comment 4 Mario Fusco 2016-02-04 06:50:53 EST
The suggestion reported here https://issues.jboss.org/browse/DROOLS-465 (avoiding to add the local repository among the remote ones) actually prevents the maven-metadata.xml file to be removed and it fixes this issue as reported. Unfortunately this solution breaks the retrieval of newly deployed SNAPSHOTs while the KieScanner is running. 

I'm trying to figure out why and how to fix this problem without breaking SNAPSHOTs resolution.
Comment 5 Mario Fusco 2016-02-10 09:18:16 EST
Fixed by https://github.com/droolsjbpm/drools/commit/183bf11f7
Comment 6 Tomas David 2016-03-24 02:02:17 EDT
Verified with 6.3.0.ER1.

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