0

每当我尝试使用 NurseRostering 问题时,OptaPlanner。以下是错误,您能否建议我一个可能更正的地方,或者需要做些什么来纠正它。请注意; 我不想导入示例 jar,因为我试图将代码用于不同的目的。

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)
4

1 回答 1

0

OptaPlanner 用于getClass().getResource("/org/optaplanner/examples/nurserostering/solver/nurseRosteringSolverConfig.xml")检索该类路径资源。如果未找到,则抛出该异常。

检查是否optaplanner-examples/src/main/resources在您的 IDE 或构建中正确标记为(资源)源路径。

于 2014-01-28T16:40:50.157 回答