Java OptaPlanner Nurserverstering示例中的异常

Java OptaPlanner Nurserverstering示例中的异常,java,file,exception,optaplanner,Java,File,Exception,Optaplanner,每当我试图解决这个问题时。以下是错误,请您建议我一个可能的纠正位置,或者需要做什么来纠正它。请注意;我不想导入示例jar,因为我正在尝试将代码用于其他目的 Exception in thread "AWT-EventQueue-0" java.lang.IllegalArgumentException: The solver configuration (/org/optaplanner/examples/nurserostering/solver/nurseRosteringSolverCon

每当我试图解决这个问题时。以下是错误,请您建议我一个可能的纠正位置,或者需要做什么来纠正它。请注意;我不想导入示例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)

OptaPlanner使用
getClass().getResource(“/org/OptaPlanner/examples/nursetrestring/solver/nursetrestringsolverconfig.xml”)
检索该类路径资源。如果找不到,则抛出该异常

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