java - Optaplanner - 网站资源不存在

标签 java optaplanner

我正在为我的项目制作一个可运行的 jar,当它开始生成基准报告时,我不断收到此错误:

Exception in thread "main" java.lang.IllegalStateException: The websiteResource (twitterbootstrap/css/bootstrap-responsive.css) does not exist.
    at org.optaplanner.benchmark.impl.report.WebsiteResourceUtils.copyResource(WebsiteR esourceUtils.java:57)
    at org.optaplanner.benchmark.impl.report.WebsiteResourceUtils.copyResourcesTo(WebsiteResourceUtils.java:33)
    at org.optaplanner.benchmark.impl.report.BenchmarkReport.writeHtmlOverviewFile(BenchmarkReport.java:738)
    at org.optaplanner.benchmark.impl.report.BenchmarkReport.writeReport(BenchmarkReport.java:287)
    at org.optaplanner.benchmark.impl.DefaultPlannerBenchmark.benchmarkingEnded(DefaultPlannerBenchmark.java:315)
    at org.optaplanner.benchmark.impl.DefaultPlannerBenchmark.benchmark(DefaultPlannerBenchmark.java:109)

自从我在 drools 和 benchmarkConfig 路径前面添加了 "resources/" 后,其他一切都工作正常。

由于还有一些仅用于基准测试的资源,我可能也需要为它们做同样的事情。

我如何才能访问基准测试资源?

最佳答案

听起来您正在使用 IDE (Eclipse/IntelliJ/NetBeans/...) 从源代码进行构建,并且您的项目未正确设置为将 *.css 文件复制为类路径资源(因此它在某处对 css 有特定的排除)。

使用现代 IntelliJ IDEA 版本,打开 pom.xml 文件,这绝对不会发生。对于现代 Eclipse/NetBeans 版本,我认为也是如此。

关于java - Optaplanner - 网站资源不存在,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40049576/

相关文章:

java - 使用 Glide Image Load setDataSource 运行时异常失败 : status =

parallel-processing - 在集群上部署 optaplanner

java - 如何使用 OptaPlanner 和 Spring Boot 降低 SoftScore?

java - 光规划器 : Planning entity and Planning variable at the same time?

java - Google服务无法初始化,状态:10

java - 有效地解决填字游戏

java - Bluemix Liberty server.xml MySQL 数据源配置

java - Hibernate UserType 将@Formula 结果映射到非实体自定义对象

使用 optaplanner 和 drools 的 Grails 依赖项

java - Optaplanner项目作业调度: weekends and holidays