[jboss-jira] [JBoss JIRA] (DROOLS-433) Score Cards: PMML4Compiler fails to load PMML- KBases

Michael Anstis (JIRA) issues at jboss.org
Mon Feb 17 11:25:47 EST 2014


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

Michael Anstis commented on DROOLS-433:
---------------------------------------

When running PMML4Compiler inside a container (Jetty, AS, etc) it fails to load KBase definitions with KieContainerImpl.getKieBase(kBaseName).

The issue appears to be classloader related as loading the KBases results in the following (truncated error):-

Unable to Analyse Expression "( " +
                                "m" + utils.compactUpperCase( $fld ) + " == " + "isMissing".equals( $op ) +
                                 ( "isMissing".equals( $op ) ? "" :
                                        " && v" + utils.compactUpperCase( $fld ) + " " + utils.mapOperator( $op ) + " " + utils.format( $type, $val )
                                 ) +
                             " )":
[Error: unable to resolve method using strict-mode: org.drools.pmml.pmml_4_1.PMML4Helper.format(org.dmg.pmml.pmml_4_1.descr.DATATYPE, java.lang.String)]
[Near : {... $op ) + " " + utils.format( $type, $val ) ....}]
                                 ^ : [Query name='compilePredicate']

Unable to Analyse Expression drools.insert( new FieldMarker( $n, $t ) );
    drools.insertLogical( new TypeOfField( $n, $t ) );:
[Error: Failed to compileShared: 1 compilation error(s): 
 - (1,16) could not resolve constructor org.drools.pmml.pmml_4_1.compiler.FieldMarker[class java.lang.String, class org.dmg.pmml.pmml_4_1.descr.DATATYPE]]
[Near : {... drools.insert( new FieldMarker( $n, $t ) ); ....}]
                            ^
[Line: 170, Column: 0] : [Rule name='typeOfDataField']

Unable to Analyse Expression drools.insert( new FieldMarker( $n,$t ) );
    drools.insertLogical( new TypeOfField( $n, $t ) );:
[Error: Failed to compileShared: 1 compilation error(s): 
 - (1,16) could not resolve constructor org.drools.pmml.pmml_4_1.compiler.FieldMarker[class java.lang.String, class org.dmg.pmml.pmml_4_1.descr.DATATYPE]]
[Near : {... drools.insert( new FieldMarker( $n,$t ) ); ....}]
                            ^
[Line: 373, Column: 0] : [Rule name='typeOfDerivedField']

Unable to Analyse Expression int num = $tracts.size();
    int j = 1;
    while (j < num) {
        java.util.HashMap map = new java.util.HashMap();
            map.put( "context",utils.context );
            map.put( "name", utils.compactUpperCase( $fld.name ) );
            map.put( "origField", utils.compactUpperCase($nc.field));
            map.put( "xmin", ( (LinearNorm) $tracts.get( j-1 ) ).orig);
            map.put( "ymin", ( (LinearNorm) $tracts.get( j-1 ) ).norm );
            map.put( "xmax", ( (LinearNorm) $tracts.get( j ) ).orig );
            map.put( "ymax", ( (LinearNorm) $tracts.get( j ) ).norm );
            map.put( "index",j );
            map.put( "type", utils.mapDatatype( $type ) );
        utils.applyTemplate( "linearTractNormalization.drlt", utils, registry, map, theory );
        j++;

...
...
...

[Line: 564, Column: 0]]]
	at org.drools.compiler.kie.builder.impl.KieContainerImpl.getKieBase(KieContainerImpl.java:337) ~[drools-compiler-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
	at org.drools.pmml.pmml_4_1.PMML4Compiler.checkBuildingResources(PMML4Compiler.java:420) ~[drools-pmml-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
	at org.drools.pmml.pmml_4_1.PMML4Compiler.generateTheory(PMML4Compiler.java:278) ~[drools-pmml-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
	at org.drools.scorecards.ScorecardCompiler.getDRL(ScorecardCompiler.java:134) ~[drools-scorecards-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]
	at org.drools.scorecards.ScorecardCompiler.convertToDRL(ScorecardCompiler.java:149) ~[drools-scorecards-6.1.0-SNAPSHOT.jar:6.1.0-SNAPSHOT]

Subsequent attempts to compile ScoreCards retrieves an empty KBase from KieContainerImpl resulting in a "Unexpected global [registry]." error (PMML4Compiler attempts to set a KBase Global variable that is not defined in the DRL as KieContainerImpl cached an empty KBase due to the above errors).

I cannot replicate these errors within Java SE Unit Tests.. unfortunately (after trying for way too long) this might best be debugged with kie-drools-wb and a remote debugger :(  
                
> Score Cards: PMML4Compiler fails to load PMML- KBases
> -----------------------------------------------------
>
>                 Key: DROOLS-433
>                 URL: https://issues.jboss.org/browse/DROOLS-433
>             Project: Drools
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>    Affects Versions: 6.0.0.Final
>            Reporter: Michael Anstis
>            Assignee: Mario Fusco
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the jboss-jira mailing list