1

我有一个 optaplanner 应用程序,我想将其导出为可运行的 jar,但是当我运行 jar 时,出现错误,我不知道为什么。

我正在使用车辆路由示例,并且我想使用没有 Eclipse 的 GUI 界面。

Exception in thread "main" java.lang.NullPointerException
    at org.kie.internal.io.ResourceFactory.newByteArrayResource(ResourceFactory.java:66)
    at org.drools.compiler.kie.builder.impl.AbstractKieModule.getResource(AbstractKieModule.java:308)
    at org.drools.compiler.kie.builder.impl.AbstractKieModule.addResourceToCompiler(AbstractKieModule.java:273)
    at org.drools.compiler.kie.builder.impl.AbstractKieModule.addResourceToCompiler(AbstractKieModule.java:268)
    at org.drools.compiler.kie.builder.impl.AbstractKieProject.buildKnowledgePackages(AbstractKieProject.java:253)
    at org.drools.compiler.kie.builder.impl.AbstractKieProject.verify(AbstractKieProject.java:74)
    at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:267)
    at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:235)
    at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:184)
    at org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildDroolsScoreDirectorFactory(ScoreDirectorFactoryConfig.java:544)
    at org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildScoreDirectorFactory(ScoreDirectorFactoryConfig.java:351)
    at org.optaplanner.core.config.solver.SolverConfig.buildSolver(SolverConfig.java:255)
    at org.optaplanner.core.impl.solver.AbstractSolverFactory.buildSolver(AbstractSolverFactory.java:61)
    at org.optaplanner.examples.common.app.CommonApp.createSolver(CommonApp.java:136)
    at org.optaplanner.examples.common.app.CommonApp.createSolutionBusiness(CommonApp.java:124)
    at org.optaplanner.examples.common.app.CommonApp.init(CommonApp.java:115)
    at org.optaplanner.examples.common.app.CommonApp.init(CommonApp.java:111)
    at org.optaplanner.examples.pmrouting.app.PMRoutingAPP.main(PMRoutingAPP.java:39)
4

1 回答 1

0

因为 Drools 与 uber jar 不兼容。如果您真的想使用 uber jar 跑步,请使用其他分数计算器...

于 2019-04-02T14:45:52.260 回答