[jboss-jira] [JBoss JIRA] (DROOLS-711) Kie Server unable to build KieBase which builds fine with kie-maven-plugin and unit test

Kaan Bingol (JIRA) issues at jboss.org
Fri Apr 1 02:26:00 EDT 2016


    [ https://issues.jboss.org/browse/DROOLS-711?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13185024#comment-13185024 ] 

Kaan Bingol commented on DROOLS-711:
------------------------------------

I think the issue still persists in 6.3.0.Final. I have tested in a similar setup to the reported one. Client driver project only depends on kie-ci 6.3.0.Final and when the kie container is tried to be constructed, kie module unable to build due to the same reasons. However, if I remove "declare" statement from the rule file, it works or if I add the dependency of rules project (the one that build and uploaded into maven repository) into the main container project pom while still constructing the kie container from maven repo the issue is also gone. However, both are not a feasible solutions since declare statement is used for CEP and adding dependency contradicts whole building kie container from maven repository concept.

> Kie Server unable to build KieBase which builds fine with kie-maven-plugin and unit test
> ----------------------------------------------------------------------------------------
>
>                 Key: DROOLS-711
>                 URL: https://issues.jboss.org/browse/DROOLS-711
>             Project: Drools
>          Issue Type: Bug
>    Affects Versions: 6.2.0.CR4, 6.2.0.Final
>         Environment: kie-server on WildFly 8.2.0.Final running with JDK 8
>            Reporter: Matteo Mortari
>            Assignee: Mark Proctor
>         Attachments: 20150213.DROOLS-711.zip
>
>
> I have deployed Kie Server kie-server-distribution-wars-6.2.0.CR4-ee7.war on WildFly 8.2.0.Final.
> I have a simple rule base in the project {{client-test-rules}} as per below, in a kie project structured as kie-drools-archetype, which passes all test and install in m2 repo with {{mvn clean install}}.
> {code:java}
> package com.acme.client_test_rules;
> declare Measurement
>  @role(event)
> end
> rule "keep latest Measurement ID"
> salience 1000
> no-loop
> when
>     $old : Measurement( $id : id )
>     $new : Measurement( id == $id , this after $old  )
> then
>  System.out.println("keep latest old : "+$old+" new (kept): "+$new);
>     retract($old);
> end
> {code}
> Then I issue Kie Server commands, using the client library, using project {{client-test}} to instantiate a container for the same artifact, but in the wildfly logs I get the following error below - which doesn't happen for kie-maven-plugin nor during unit test. Please note I'm assuming user {{kieserver}} with password {{kieserver}} is a valid user for the Kie Server Realm, or configure wildfly or the code in the project {{client-test}} accordingly to your environment =).
> {code}
> 09:41:41,700 ERROR [org.drools.compiler.kie.builder.impl.AbstractKieModule] (default task-4) Unable to build KieBaseModel:kbase1
> Unable to create Field Extractor for 'id'Field/method 'id' not found for class 'com.acme.client_test_rules.Measurement'
>  : [Rule name='keep latest Measurement ID']
> java.lang.RuntimeException: Field/method 'id' not found for class 'com.acme.client_test_rules.Measurement'
> Unable to create Field Extractor for 'id'Field/method 'id' not found for class 'com.acme.client_test_rules.Measurement'
>  : [Rule name='keep latest Measurement ID']
> java.lang.RuntimeException: Field/method 'id' not found for class 'com.acme.client_test_rules.Measurement'
> Field Reader does not exist for declaration '$id' in 'predicate 'id == $id'' in the rule 'keep latest Measurement ID' : [Rule name='keep latest Measurement ID']
> Unable to Analyse Expression id == $id:
> [Error: unable to resolve method using strict-mode: com.acme.client_test_rules.Measurement.id()]
> [Near : {... id == $id ....}]
>              ^
> [Line: 12, Column: 4] : [Rule name='keep latest Measurement ID']
> {code}
> Can you kindly verify if some bug is hiding behind this odd behavior, please?
> Thank you
> MM



--
This message was sent by Atlassian JIRA
(v6.4.11#64026)


More information about the jboss-jira mailing list