[jboss-jira] [JBoss JIRA] Commented: (JBRULES-2043) No decent error message when the scoreDrl doesn't exist (was: Log problems while building the RuleBase)

Dietmar Scheidl (JIRA) jira-events at lists.jboss.org
Mon Apr 27 08:11:46 EDT 2009


    [ https://jira.jboss.org/jira/browse/JBRULES-2043?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12464612#action_12464612 ] 

Dietmar Scheidl commented on JBRULES-2043:
------------------------------------------

In org.drools.solver.config.localsearch.LocalSearchSolverConfig::buildRuleBase() fails:

    private RuleBase buildRuleBase() {
    ...
        RuleBaseConfiguration ruleBaseConfiguration = new RuleBaseConfiguration();
        RuleBase ruleBase = RuleBaseFactory.newRuleBase(ruleBaseConfiguration);
        try {
            ruleBase.addPackage(packageBuilder.getPackage());
        } catch (Exception e) { // TODO remove me if removed in drools 4.0.1
            throw new IllegalArgumentException("scoreDrlList (" + scoreDrlList + ") could not be loaded.", e);
        }
    ...
        return ruleBase;
    }

The thrown exception does not allow the analysis of the real problem. 

In my case packageBuilder.getPackage() fails caused by a error in the rule-file. So packageBuilder.getErrors() would return the list of problems.

> No decent error message when the scoreDrl doesn't exist (was: Log problems while building the RuleBase)
> -------------------------------------------------------------------------------------------------------
>
>                 Key: JBRULES-2043
>                 URL: https://jira.jboss.org/jira/browse/JBRULES-2043
>             Project: JBoss Drools
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: drools-solver
>    Affects Versions: 5.0.0.M5
>            Reporter: Dietmar Scheidl
>            Assignee: Geoffrey De Smet
>             Fix For: 5.0.0.GA
>
>
> I startet to experiment with the drools-solver but only got a NullPointerException:
> Caused by: java.lang.NullPointerException
> 	at org.drools.common.AbstractRuleBase.addPackages(AbstractRuleBase.java:429)
> 	at org.drools.reteoo.ReteooRuleBase.addPackage(ReteooRuleBase.java:395)
> 	at org.drools.solver.config.localsearch.LocalSearchSolverConfig.buildRuleBase(LocalSearchSolverConfig.java:166)
> 	at org.drools.solver.config.localsearch.LocalSearchSolverConfig.buildSolver(LocalSearchSolverConfig.java:137)
> 	at org.drools.solver.config.XmlSolverConfigurer.buildSolver(XmlSolverConfigurer.java:73)
> ...
> After debugging into this location, I found out that it comes from an error in my scoreDrl.
> The buildSolver-Method should fail with a more helpful exception or the result of the PackageBuilder should be available to analyse the problems.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list