-
Bug
-
Resolution: Cannot Reproduce
-
Minor
-
6.2.0.Final
-
None
-
None
The variable "firstStandstill" is the anchor root of the chain. In previous releases we computed the value in our code, the new OptaPlanner release has the annotation @AnchorShadowVariable to do this automatically.
When we set the annotation, we get java.lang.NullPointerException: null
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0_71] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0_71] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0_71] at java.lang.reflect.Method.invoke(Method.java:606) ~[na:1.7.0_71] at org.optaplanner.core.impl.domain.common.ReflectionPropertyAccessor.executeGetter(ReflectionPropertyAccessor.java:62) ~[optaplanner-core-6.2.0.Final.jar:6.2.0.Final] at org.optaplanner.core.impl.domain.solution.descriptor.SolutionDescriptor.extractEntityCollection(SolutionDescriptor.java:543) ~[optaplanner-core-6.2.0.Final.jar:6.2.0.Final] at org.optaplanner.core.impl.domain.solution.descriptor.SolutionDescriptor.getEntityListByEntityClass(SolutionDescriptor.java:390) ~[optaplanner-core-6.2.0.Final.jar:6.2.0.Final] at org.optaplanner.core.impl.domain.entity.descriptor.EntityDescriptor.extractEntities(EntityDescriptor.java:401) ~[optaplanner-core-6.2.0.Final.jar:6.2.0.Final] at org.optaplanner.core.impl.domain.variable.inverserelation.ExternalizedSingletonInverseVariableSupply.resetWorkingSolution(ExternalizedSingletonInverseVariableSupply.java:50) ~[optaplanner-core-6.2.0.Final.jar:6.2.0.Final] at org.optaplanner.core.impl.domain.variable.listener.VariableListenerSupport.demand(VariableListenerSupport.java:83) ~[optaplanner-core-6.2.0.Final.jar:6.2.0.Final] at org.optaplanner.core.impl.domain.variable.anchor.AnchorShadowVariableDescriptor.buildVariableListener(AnchorShadowVariableDescriptor.java:86) ~[optaplanner-core-6.2.0.Final.jar:6.2.0.Final] at org.optaplanner.core.impl.domain.variable.listener.VariableListenerSupport.buildVariableListeners(VariableListenerSupport.java:69) ~[optaplanner-core-6.2.0.Final.jar:6.2.0.Final] at org.optaplanner.core.impl.domain.variable.listener.VariableListenerSupport.linkVariableListeners(VariableListenerSupport.java:54) ~[optaplanner-core-6.2.0.Final.jar:6.2.0.Final] at org.optaplanner.core.impl.score.director.AbstractScoreDirector.<init>(AbstractScoreDirector.java:76) ~[optaplanner-core-6.2.0.Final.jar:6.2.0.Final] at org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector.<init>(DroolsScoreDirector.java:47) ~[optaplanner-core-6.2.0.Final.jar:6.2.0.Final] at org.optaplanner.core.impl.score.director.drools.DroolsScoreDirector.buildScoreDirector(DroolsScoreDirectorFactory.java:20) ~[classes/:6.2.0.Final]
when calling solver.getScoreDirectorFactory().buildScoreDirector() during initialization when the solution of the solver is still null. (solver not yet started, no solution set yet).
So we decided not to use @AnchorShadowVariable yet.
Suggestion: fix this, so that you can create a scoreDirector before starting the solver the first time.
- is caused by
-
PLANNER-252 VariableListeners for shadow variables that are triggered on other shadow variables should be triggered predictably in a smart order
- Resolved