Question

Whenever I am trying to user NurseRostering Problem, OptaPlanner. Following is the error, Could you please suggest me a with a possible place of correction, or what needs to be done to rectify it. Please Note; I dont want to import the examples jar because I am trying to use the code for a different purpose.

Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: The solver configuration (/org/optaplanner/examples/nurserostering/solver/nurseRosteringSolverConfig.xml) does not exist.
    at org.optaplanner.core.config.solver.XmlSolverFactory.configure(XmlSolverFactory.java:65)
    at org.optaplanner.examples.nurserostering.app.NurseRosteringApp.createSolver(NurseRosteringApp.java:33)
    at com.nttdata.scheduling.app.CommonApp.createSolutionBusiness(CommonApp.java:101)
    at com.nttdata.scheduling.app.CommonApp.init(CommonApp.java:85)
    at com.nttdata.scheduling.app.MainApp$1.actionPerformed(MainApp.java:82)
    at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Window.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
    at java.awt.EventQueue.access$200(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.awt.EventQueue$3.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.awt.EventQueue$4.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
Était-ce utile?

La solution

OptaPlanner uses getClass().getResource("/org/optaplanner/examples/nurserostering/solver/nurseRosteringSolverConfig.xml") to retrieve that classpath resource. If it's not found, that exception is thrown.

Check if optaplanner-examples/src/main/resources is properly marked as a (resources) source path in your IDE or build.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top