[jboss-jira] [JBoss JIRA] (JBRULES-3406) Planner: a Solution with a @PlanningEntityCollectionProperty or @PlanningEntityProperty on a method that does not return a planning entity should fail with a decent error message.
Geoffrey De Smet (JIRA)
jira-events at lists.jboss.org
Fri Mar 2 09:00:38 EST 2012
[ https://issues.jboss.org/browse/JBRULES-3406?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Geoffrey De Smet resolved JBRULES-3406.
---------------------------------------
Resolution: Done
Fixed with
{code}
java.lang.IllegalArgumentException: A planningEntity is an instance of a planningEntityImplementationClass (class org.drools.planner.examples.machinereassignment.domain.MrBalancePenalty) that is not configured as a planningEntity.
If that class (MrBalancePenalty) is not a planningEntityClass (or subclass thereof), check your Solution implementation's annotated methods.
If it is, check your solver configuration.
{code}
> Planner: a Solution with a @PlanningEntityCollectionProperty or @PlanningEntityProperty on a method that does not return a planning entity should fail with a decent error message.
> -----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: JBRULES-3406
> URL: https://issues.jboss.org/browse/JBRULES-3406
> Project: Drools
> Issue Type: Enhancement
> Security Level: Public(Everyone can see)
> Components: drools-planner
> Reporter: Geoffrey De Smet
> Assignee: Geoffrey De Smet
> Fix For: 5.4.0.CR1
>
>
> "
> I accidently denoted the wrong class with the annotator
> @PlanningEntityCollectionProperty ; a class which was NOT a planning entity.
> Apparently, Drools Planner does not attempt to check for such a possibility,
> hence I get:
> {code}
> Exception in thread "main" java.lang.NullPointerException
> at
> org.drools.planner.core.domain.solution.SolutionDescriptor.getAllFacts(SolutionDescriptor.java:135)
> at
> org.drools.planner.core.solution.director.DefaultSolutionDirector.getWorkingFacts(DefaultSolutionDirector.java:129)
> at
> org.drools.planner.core.solution.director.DefaultSolutionDirector.resetWorkingMemory(DefaultSolutionDirector.java:123)
> at
> org.drools.planner.core.solution.director.DefaultSolutionDirector.setWorkingSolution(DefaultSolutionDirector.java:97)
> at
> org.drools.planner.core.solver.DefaultSolver.setPlanningProblem(DefaultSolver.java:97)
> at in.co.technovia.examduties.ExamDutiesApp.main(ExamDutiesApp.java:47)
> {code}
> Please check for such a possibility in future versions of Drools Planner and
> emit a more meaningful error message.
> "
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.jboss.org/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list