OptaPlanner 8.0.0 final (Windows 10) 中的课程时间表和会议安排示例被破坏

Posted

技术标签:

【中文标题】OptaPlanner 8.0.0 final (Windows 10) 中的课程时间表和会议安排示例被破坏【英文标题】:Course timetabling and Conference scheduling examples are broken in OptaPlanner 8.0.0 final (Windows 10) 【发布时间】:2021-04-17 07:21:52 【问题描述】:

我第一次下载该项目,安装了最新的 Java jre1.8.0_271,这些示例崩溃了。有人知道哪个版本的 Java 会运行这个吗?

Exception in thread "AWT-EventQueue-0" java.lang.NullPointerException
at org.drools.compiler.commons.jci.compilers.NativeJavaCompiler.compile(NativeJavaCompiler.java:85)
at org.drools.compiler.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:49)
at org.drools.modelcompiler.builder.CanonicalModelKieProject.writeProjectOutput(CanonicalModelKieProject.java:99)
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildKieProject(KieBuilderImpl.java:285)
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:247)
at org.drools.compiler.kie.builder.impl.KieBuilderImpl.buildAll(KieBuilderImpl.java:204)
at org.optaplanner.core.impl.score.director.ScoreDirectorFactoryFactory.buildDroolsScoreDirectorFactory(ScoreDirectorFactoryFactory.java:254)
at org.optaplanner.core.impl.score.director.ScoreDirectorFactoryFactory.decideMultipleScoreDirectorFactories(ScoreDirectorFactoryFactory.java:109)
at org.optaplanner.core.impl.score.director.ScoreDirectorFactoryFactory.buildScoreDirectorFactory(ScoreDirectorFactoryFactory.java:74)
at org.optaplanner.core.impl.solver.DefaultSolverFactory.buildScoreDirectorFactory(DefaultSolverFactory.java:115)
at org.optaplanner.core.impl.solver.DefaultSolverFactory.buildSolver(DefaultSolverFactory.java:83)
at org.optaplanner.examples.common.business.SolutionBusiness.setSolver(SolutionBusiness.java:189)
at org.optaplanner.examples.common.app.CommonApp.createSolutionBusiness(CommonApp.java:128)
at org.optaplanner.examples.common.app.CommonApp.init(CommonApp.java:116)
at org.optaplanner.examples.app.OptaPlannerExamplesApp$1.actionPerformed(OptaPlannerExamplesApp.java:155)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.AWTEventMulticaster.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)

【问题讨论】:

您好,欢迎您,您执行了哪些操作?你试过什么代码?提供更多信息,以便社区更好地了解如何为您提供帮助。 【参考方案1】:

您必须使用 JDK(Java 开发工具包),而不是 JRE。您可以通过https://adoptopenjdk.net/ 获取 OpenJDK。建议使用 OpenJDK 11 或更高版本,但 OptaPlanner 8.x 也可以在 Java 8 上运行。

【讨论】:

我已提交 JIRA 以获得更好的错误消息:issues.redhat.com/browse/DROOLS-5932 谢谢

以上是关于OptaPlanner 8.0.0 final (Windows 10) 中的课程时间表和会议安排示例被破坏的主要内容,如果未能解决你的问题,请参考以下文章

Optaplanner终于支持多线程并行运行 - Multithreaded incremental solving

Optaplanner逐步学习 : 基本概念 - Optaplanner,规划问题, 约束,方

Optaplanner - 入门介绍

Optaplanner:检查链式规划变量是不是有锚

Optaplanner规划引擎的工作原理及简单示例

Optaplanner规划引擎的工作原理及简单示例