打包项目后运行错误

时间:2018-07-30 07:01:33

标签: java drools optaplanner

项目在Eclipse中正常运行,但是打包并在终端中运行项目时会出现问题。应该如何解决这个问题?

  

D:> java -jar   optaplanner-examples-7.4.1.Final-jar-with-dependencies.jar   D:\ roster_450.xml 100线程“主”中的异常   java.lang.ExceptionInInitializerError           在org.kie.api.internal.utils.ServiceRegistry.getInstance(ServiceRegistry.java:27)           在org.kie.api.KieServices $ Factory $ LazyHolder。(KieServices.java:332)           在org.kie.api.KieServices $ Factory.get(KieServices.java:339)           在org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildDroolsScoreDirectorFactory(ScoreDirectorFactoryConfig.java:460)           在org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildScoreDirectorFactory(ScoreDirectorFactoryConfig.java:331)           在org.optaplanner.core.config.solver.SolverConfig.buildSolver(SolverConfig.java:220)           在org.optaplanner.core.impl.solver.AbstractSolverFactory.buildSolver(AbstractSolverFactory.java:61)           在org.optaplanner.examples.common.app.CommonApp.createSolver(CommonApp.java:105)           在org.optaplanner.examples.nurserostering.app.NurseRosteringApp.createSolutionBusiness(NurseRosteringApp.java:94)           在org.optaplanner.examples.nurserostering.app.NurseRosteringApp.init(NurseRosteringApp.java:85)           在org.optaplanner.examples.nurserostering.app.NurseRosteringApp.main(NurseRosteringApp.java:77)   引起原因:java.lang.RuntimeException:子服务   [org.kie.api.internal.assembler.KieAssemblers]没有父母           在org.kie.api.internal.utils.ServiceDiscoveryImpl.buildMap(ServiceDiscoveryImpl.java:186)           在org.kie.api.internal.utils.ServiceDiscoveryImpl.getServices(ServiceDiscoveryImpl.java:97)           在org.kie.api.internal.utils.ServiceRegistryImpl。(ServiceRegistryImpl.java:36)           在org.kie.api.internal.utils.ServiceRegistryImpl $ LazyHolder。(ServiceRegistryImpl.java:32)           ...还有11个

1 个答案:

答案 0 :(得分:0)

Drools不喜欢uber-jarring,因为几个jar都有一个META-INF目录,其中的文件名相同。所以最后一个赢。

要么不使用uber-jarring,要么不使用Drools得分计算。