在drool planner 5.5中运行示例

时间:2013-09-23 14:30:00

标签: drools-planner optaplanner

我是drool规划师的新手,并尝试使用runExamples.bat运行示例,但是当尝试在exclipse中导入该示例并尝试运行以下异常时获取

Exception in thread "main" java.lang.IllegalStateException: The directory dataDir (D:\OfficeWork\Eclipse_work\Cloudbalancing2\data\cloudbalancing) does not exist. The working directory should be set to the directory that contains the data directory. This is different in a git clone (drools-planner/drools-planner-examples) and the release zip (examples).
    at org.drools.planner.examples.common.business.SolutionBusiness.updateDataDirs(SolutionBusiness.java:101)
    at org.drools.planner.examples.common.app.CommonApp.createSolutionBusiness(CommonApp.java:55)
    at org.drools.planner.examples.common.app.CommonApp.<init>(CommonApp.java:35)
    at org.drools.planner.examples.cloudbalancing.app.CloudBalancingApp.<init>(CloudBalancingApp.java:27)
    at org.drools.planner.examples.cloudbalancing.app.CloudBalancingApp.main(CloudBalancingApp.java:33)

1 个答案:

答案 0 :(得分:1)

对于OptaPlanner 6.0.0.CR4,我使该异常消息更加清晰:

java.lang.IllegalStateException: The directory dataDir (...) does not exist.
 The working directory should be set to the directory that contains the data directory (which is not the data directory itself).
 The working directory is different in a git clone (optaplanner/optaplanner-examples) and the release zip (examples).
 In an IDE (IntelliJ, Eclipse, NetBeans), open the "Run configuration" to change the field "Working directory".

至于你的第二个问题:

您使用的是eclipse drools插件吗?尝试禁用它。 DRL很好,但是eclipse drools插件可能会错误地将其标记为错误。请注意,Eclipse实际上并不编译DRL,因此启用eclipse drools插件的唯一优势是DRL中的语法着色。