[jboss-jira] [JBoss JIRA] (DROOLS-743) kie ci regression: unable to resolve dependency of kjar during KB creation

Tibor Zimányi (JIRA) issues at jboss.org
Wed Jul 11 08:29:00 EDT 2018


     [ https://issues.jboss.org/browse/DROOLS-743?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tibor Zimányi closed DROOLS-743.
--------------------------------
    Resolution: Done


Tested with 7.8.0.Final and Wildfly 11 and it works. Closing. 

> kie ci regression: unable to resolve dependency of kjar during KB creation
> --------------------------------------------------------------------------
>
>                 Key: DROOLS-743
>                 URL: https://issues.jboss.org/browse/DROOLS-743
>             Project: Drools
>          Issue Type: Bug
>          Components: core engine
>    Affects Versions: 6.2.0.Final
>         Environment: Please notice it works OK with Drools 6.1.0.Final
> Currently JDK8, Wildfly 8.2.0.Final.
>            Reporter: Matteo Mortari
>            Assignee: Mario Fusco
>         Attachments: 20150317.DROOLS-743.zip
>
>
> h5. Executive summary
> With version 610Final using kie-ci, if the kjar KieModule had some pom dependency, say on a "object model" or reference package, the classes in the dependency artifact would be resolved correctly during knowledge base creation. However with 620Final, when the kjar KieModule is fetched and knowledge base creation starts, it seems like the kie-ci is no longer able to "see" the classes of this pom dependency.
> This is a problem especially in all scenarios where different rule packages kjar KieModule defines rules based on a common library, "object model".
> h5. Details and Reproducer
> Suppose you have a library, object model, package reference .jar artifact, attached:
> {{exercise_kie_ci-rules-objectmodel}}
> Suppose you have a simple kjar project:
> {{exercise_kie_ci-rules}}
> with very simple rule
> {code}
> package com.acme.exercise_kie_ci_rules;
> import com.acme.exercise_kie_ci_rules_objectmodel.AcmePojo;
> rule "just test dependency of objectmodel"
> no-loop
> when
> then
> 	AcmePojo pojo = new AcmePojo("Ciao");
> 	System.out.println("Simple rule for inserting pojo..."+pojo);
> 	insert(pojo);
> end
> {code}
> You will notice in kjar pom the dependency is explicited and rule compilation works ok with kie-maven-plugin.
> Now install them with:
> mvn install the artifactId exercise_kie_ci-rules-objectmodel
> mvn install the artifactId exercise_kie_ci-rules
> Now deploy the {{exercise-kie-ci}} on WildFly:
> IFF Drools version is 610Final works ok: 
> {code}
> 19:21:03,708 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "exercise-kie-ci.war" (runtime-name: "exercise-kie-ci.war")
> ...
> 19:21:07,776 INFO  [org.drools.compiler.kie.builder.impl.KieRepositoryImpl] (ServerService Thread Pool -- 50) KieModule was added:ZipKieModule[ ReleaseId=com.acme:exercise_kie_ci-rules:1.0.0file=C:\Users\mmortari\.m2\repository\com\acme\exercise_kie_ci-rules\1.0.0\exercise_kie_ci-rules-1.0.0.jar]
> 19:21:07,877 INFO  [com.acme.exercise_kie_ci.Exercise] (ServerService Thread Pool -- 50) Creating kieBase with STREAM option
> 19:21:07,960 INFO  [com.acme.exercise_kie_ci.Exercise] (ServerService Thread Pool -- 50) There should be rules: 
> 19:21:07,960 INFO  [com.acme.exercise_kie_ci.Exercise] (ServerService Thread Pool -- 50) kp [Package name=com.acme.exercise_kie_ci_rules] rule just test dependency of objectmodel
> 19:21:08,123 INFO  [org.wildfly.extension.undertow] (MSC service thread 1-12) JBAS017534: Registered web context: /exercise-kie-ci
> 19:21:08,146 INFO  [org.jboss.as.server] (ServerService Thread Pool -- 28) JBAS018559: Deployed "exercise-kie-ci.war" (runtime-name : "exercise-kie-ci.war")
> {code}
> Kindly notice line mentioning the artifact was kjar KieModule was resolved and correctly imported, an debug log line mentioning the very simple rule is available in the KB.
> However, if you now switch the Drools version to 620Final in the {{exercise-kie-ci}} and redeploy to WildFly, it would no longer work:
> {code}
> 19:23:09,524 ERROR [org.drools.compiler.kie.builder.impl.AbstractKieModule] (ServerService Thread Pool -- 54) Unable to build KieBaseModel:defaultKieBase
> Error importing : 'com.acme.exercise_kie_ci_rules_objectmodel.AcmePojo'
> 19:23:09,747 ERROR [org.drools.compiler.kie.builder.impl.AbstractKieModule] (ServerService Thread Pool -- 54) Unable to build KieBaseModel:defaultKieBase
> Error importing : 'com.acme.exercise_kie_ci_rules_objectmodel.AcmePojo'
> 19:23:09,748 INFO  [com.acme.exercise_kie_ci.Exercise] (ServerService Thread Pool -- 54) Message [id=1, level=ERROR, path=rules.drl, line=1, column=0
>    text=Error importing : 'com.acme.exercise_kie_ci_rules_objectmodel.AcmePojo']
> {code}
> I will attach reproducer.
> Could you kindly advise, please?
> As always, thank you.
> Ciao
> MM



--
This message was sent by Atlassian JIRA
(v7.5.0#75005)



More information about the jboss-jira mailing list