When there is a mistake in the drools (DRL) code, it throws a different exception, coming from drools and stating on which line in the DRL the error message is.
The message
The scoreDrl (taskassignment/solver/taskAssignmentScoreRules.drl) does not exist as a classpath resource.
means that you've configured this in your solver config
<scoreDrl>taskassignment/solver/taskAssignmentScoreRules.drl</scoreDrl>
and that's not a valid classpath resource location.
In a typical project with a maven directory structure, classpath resources are located under src/main/resources
.
Pitfall: In 6.0, OptaPlanner uses Class.getResource(String)
to find it. In 6.1.0.Beta3+, OptaPlanner uses ClassLoader.getResource(String)
to find it. This means that currently in 6.0 it needs to start with a /
and in 6.1 it must not start with a /
.
So if you have a resource file in your project sources like this (presuming you're using the maven directory structure):
PROJECT_DIR/src/main/resources/taskassignment/solver/taskAssignmentScoreRules.drl
In 6.0 you'd need to configure:
<scoreDrl>/taskassignment/solver/taskAssignmentScoreRules.drl</scoreDrl>
And in 6.1 you'd need to configure:
<scoreDrl>taskassignment/solver/taskAssignmentScoreRules.drl</scoreDrl>
Note: you probably want to follow java conventions and use reverse url namespace. So instead of taskassignment/solver/...
, I 'd use com/mycompany/taskassignment/solver/...
.