Hi,
I am new to Drools in general so please excuse my noobness with some of the
concepts. I am in the process of creating a maintenance scheduling system.
As Geoffrey suggested, I have based my application heavily on the curriculum
course example included in the solver (planner) examples. I have created
most of the classes used by the example and will be implementing my gui.
I use an XmlSolverConfigurer to read the configuration from xml. The solver
config xml path is correct as I get another exception due to the file not
being found when I change the path. When the solver tries to load the xml
configuration the following exception occurs:
Exception in thread "AWT-EventQueue-0"
com.thoughtworks.xstream.converters.ConversionException: environmentMode :
environmentMode : environmentMode : environmentMode
---- Debugging information ----
message : environmentMode : environmentMode
cause-exception :
com.thoughtworks.xstream.mapper.CannotResolveClassException
cause-message : environmentMode : environmentMode
class :
org.drools.solver.config.localsearch.LocalSearchSolverConfig
required-type :
org.drools.solver.config.localsearch.LocalSearchSolverConfig
line number : 12
-------------------------------
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:89)
at
com.thoughtworks.xstream.core.AbstractReferenceUnmarshaller.convert(AbstractReferenceUnmarshaller.java:63)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:76)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convertAnother(TreeUnmarshaller.java:60)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.start(TreeUnmarshaller.java:137)
at
com.thoughtworks.xstream.core.AbstractTreeMarshallingStrategy.unmarshal(AbstractTreeMarshallingStrategy.java:33)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:923)
at com.thoughtworks.xstream.XStream.unmarshal(XStream.java:909)
at com.thoughtworks.xstream.XStream.fromXML(XStream.java:853)
at
org.drools.solver.config.XmlSolverConfigurer.configure(XmlSolverConfigurer.java:68)
at
org.drools.solver.config.XmlSolverConfigurer.configure(XmlSolverConfigurer.java:59)
at
org.drools.solver.config.XmlSolverConfigurer.configure(XmlSolverConfigurer.java:52)
at
za.co.rgems.projects.imms.swing.gui.ImmsGui.createSolver(ImmsGui.java:95)
at
za.co.rgems.projects.imms.swing.gui.ImmsGui.createSolutionBusiness(ImmsGui.java:103)
at
za.co.rgems.projects.imms.swing.gui.ImmsGui.btnSolveActionPerformed(ImmsGui.java:76)
at
za.co.rgems.projects.imms.swing.gui.ImmsGui.access$000(ImmsGui.java:23)
at
za.co.rgems.projects.imms.swing.gui.ImmsGui$1.actionPerformed(ImmsGui.java:50)
at
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:1995)
at
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2318)
at
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
at
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
at
javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:236)
at java.awt.Component.processMouseEvent(Component.java:6263)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3267)
at java.awt.Component.processEvent(Component.java:6028)
at java.awt.Container.processEvent(Container.java:2041)
at java.awt.Component.dispatchEventImpl(Component.java:4630)
at java.awt.Container.dispatchEventImpl(Container.java:2099)
at java.awt.Component.dispatchEvent(Component.java:4460)
at
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4574)
at
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4238)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4168)
at java.awt.Container.dispatchEventImpl(Container.java:2085)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4460)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:599)
at
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
at
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
at
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
at
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Caused by: com.thoughtworks.xstream.mapper.CannotResolveClassException:
environmentMode : environmentMode
at
com.thoughtworks.xstream.mapper.DefaultMapper.realClass(DefaultMapper.java:68)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.DynamicProxyMapper.realClass(DynamicProxyMapper.java:71)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.PackageAliasingMapper.realClass(PackageAliasingMapper.java:88)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.ClassAliasingMapper.realClass(ClassAliasingMapper.java:86)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.ArrayMapper.realClass(ArrayMapper.java:96)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.MapperWrapper.realClass(MapperWrapper.java:38)
at
com.thoughtworks.xstream.mapper.CachingMapper.realClass(CachingMapper.java:52)
at
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.determineType(AbstractReflectionConverter.java:347)
at
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.doUnmarshal(AbstractReflectionConverter.java:208)
at
com.thoughtworks.xstream.converters.reflection.AbstractReflectionConverter.unmarshal(AbstractReflectionConverter.java:162)
at
com.thoughtworks.xstream.core.TreeUnmarshaller.convert(TreeUnmarshaller.java:82)
... 41 more
Here is the contents of my XML configuration file:
<?xml version="1.0" encoding="UTF-8"?>
<localSearchSolver>
<environmentMode>REPRODUCIBLE</environmentMode>
<scoreDrl>/za/co/rgems/projects/imms/drl/immsRules.drl</scoreDrl>
<scoreDefinition>
<scoreDefinitionType>HARD_AND_SOFT</scoreDefinitionType>
</scoreDefinition>
<termination>
<scoreAttained>0hard/-5000soft</scoreAttained>
</termination>
<startingSolutionInitializerClass>za.co.rgems.projects.imms.solution.initialiser.ImmsStartingSolutionInitialiser</startingSolutionInitializerClass>
<finish>
<maximumSecondsSpend>300</maximumSecondsSpend>
</finish>
<selector>
<selector>
<topSize>10</topSize>
</selector>
<selector>
<moveFactoryClass>za.co.rgems.projects.imms.move.factory.MaintenanceSlotMoveFactory</moveFactoryClass>
<relativeSelection>0.002</relativeSelection>
</selector>
<selector>
<moveFactoryClass>za.co.rgems.projects.imms.move.factory.MaintenanceTaskSwitchFactory</moveFactoryClass>
<relativeSelection>0.002</relativeSelection>
</selector>
<selector>
<moveFactoryClass>za.co.rgems.projects.imms.move.factory.MaintenanceTechnicianChangeMoveFactory</moveFactoryClass>
<relativeSelection>0.002</relativeSelection>
</selector>
<selector>
<moveFactoryClass>za.co.rgems.projects.imms.move.factory.MotorChangeMoveFactory</moveFactoryClass>
<relativeSelection>0.002</relativeSelection>
</selector>
</selector>
<accepter>
<completePropertyTabuSize>10</completePropertyTabuSize>
<completeSolutionTabuSize>1500</completeSolutionTabuSize>
</accepter>
<forager>
<foragerType>MAX_SCORE_OF_ALL</foragerType>
</forager>
</localSearchSolver>
I am not sure why this occurs and I have also searched the forums/mailing
list to no avail. I have been through the documentation on the configuration
file as well as several of the example applications' config files, but fail
to see what is the cause.
Thank you in advance!
Regards,
De Ville Weppenaar
--
View this message in context:
http://n3.nabble.com/Drools-Planner-Exception-on-createSolver-method-tp71...
Sent from the Drools - User mailing list archive at
Nabble.com.