2013-09-23 29 views
0

我是新来的口水规划师,并尝试使用runExamples.bat运行例子,但是当试图导入exclipse这个例子,并尝试以下异常运行越来越运行例如5.5

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) 
+0

现在我能够导入optaplanner例如在eclipse,这次我在DRL文件中获取新的错误 “在类型的方法addHardConstraintMatch(RuleContext,长)HardSoftLongScoreHolder是不适用的参数(RuleContext,长)” 请给我解决方案。 –

回答

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插件流口水?尝试禁用它。 DRL很好,但eclipse drools插件可能会错误地将它标记为错误。请注意,Eclipse实际上并未编译DRL,因此启用eclipse drools插件的唯一优势是DRL中的语法着色。

+0

是的,我禁用了drool插件,现在尝试运行CloudBalancingApp,然后出现以下异常: - “线程中的异常”main“java.lang.IllegalStateException:目录dataDir(D:\ Drool Document \ optaplanner-distribution-6.0.0 .c1 \ optaplanner-distribution-6.0.0.CR1 \ examples \ sources \ data \ cloudbalancing)不存在。工作目录应该设置为包含数据目录的目录,这在git克隆中是不同的(optaplanner/optaplanner-examples)和发布zip(示例)。“ –

+0

我能够通过在源代码中复制数据文件夹解决该异常,并成功运行CloudBalancingApp.java –

+0

@MilindB这种复制工作方式,但有更好的方法:*在IDE(IntelliJ,Eclipse,NetBeans)中,打开“Run配置“更改字段”工作目录“。* –