0

I am new to the drool planner, and try to run example using runExamples.bat,but when try to import that example in exclipse and try to run following exception is getting

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)
Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
Milind B
  • 11
  • 3
  • Now I am able to import optaplanner example in eclipse,this time I get new error in drl file "The method addHardConstraintMatch(RuleContext, long) in the type HardSoftLongScoreHolder is not applicable for the arguments (RuleContext, long)" please give me solution for it. – Milind B Sep 24 '13 at 07:21

1 Answers1

1

For OptaPlanner 6.0.0.CR4, I've made that exception message clearer:

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".

As for your second question:

Are you using the eclipse drools plugin? Try disabling it. That DRL is fine, but the eclipse drools plugin might incorrectly mark it as an error. Note that Eclipse doesn't actually compile the DRL, so the only advantage of having the eclipse drools plugin enabled is syntax coloring in DRL.

Geoffrey De Smet
  • 26,223
  • 11
  • 73
  • 120
  • yes I disabled drool plugin,and now try to run CloudBalancingApp then I get following exception:- "Exception in thread "main" java.lang.IllegalStateException: The directory dataDir (D:\Drool Document\optaplanner-distribution-6.0.0.CR1\optaplanner-distribution-6.0.0.CR1\examples\sources\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 (optaplanner/optaplanner-examples) and the release zip (examples)." – Milind B Sep 24 '13 at 10:23
  • I am able to resolved that exception by just copied data folder in source and successfully run CloudBalancingApp.java – Milind B Sep 24 '13 at 13:54
  • @MilindB That copying works, but there's a better way: *In an IDE (IntelliJ, Eclipse, NetBeans), open the "Run configuration" to change the field "Working directory".* – Geoffrey De Smet Sep 24 '13 at 14:04
  • Thanks for reply. I did changes as per your suggestion and it work – Milind B Sep 25 '13 at 04:17