config(ValueSelectorConfig(null))没有为entityClass配置variableName(null)

时间:2018-01-30 08:28:20

标签: java benchmarking optaplanner

我想做一个基准但它在基准测试开始后返回此异常。我看到了一个关于这个的话题,但它与EntitySelectorConfig有关,但这是关于ValueSelectorConfig的,我无法在其他benchmark.xml文件中找到解决方案。这对我来说更重要,如果有人能帮助我,这对我来说是件好事。提前致谢

var str = "{\"321\":{\"online_status\":true,\"basic_info\":{\"status\":\"Recharged\",\"group_name\":\"IRN-UV002-M01\",\"isp_name\":\"Main\",\"creation_date\":\"2017-09-05 08:19:32\",\"recharge_deposit\":0.0,\"user_id\":321,\"nearest_exp_date\":\"2018-02-22 10:21:00\",\"credit\":20387.775145462037,\"deposit\":0.0,\"isp_id\":0,\"group_id\":72},\"user_repr\":\"10001168-2100104f4Y8-FTTH\"}}";
var obj = JObject.Parse(str);
var userId = obj["321"]["basic_info"]["user_id"].ToString();

我的benchmark.xml是:

java.lang.IllegalArgumentException: The config (ValueSelectorConfig(null)) has no configured variableName (null) for entityClass (class org.optaplanner.examples.opnext.domain.Action) and because there are multiple variableNames ([employee, machine, period]), it can not be deduced automatically.
    at org.optaplanner.core.config.AbstractConfig.deduceVariableDescriptor(AbstractConfig.java:114) ~[classes/:na]
    at org.optaplanner.core.config.heuristic.selector.value.ValueSelectorConfig.buildValueSelector(ValueSelectorConfig.java:273) ~[classes/:na]
    at org.optaplanner.core.config.heuristic.selector.move.generic.PillarChangeMoveSelectorConfig.buildBaseMoveSelector(PillarChangeMoveSelectorConfig.java:75) ~[classes/:na]
    at org.optaplanner.core.config.heuristic.selector.move.MoveSelectorConfig.buildMoveSelector(MoveSelectorConfig.java:194) ~[classes/:na]
    at org.optaplanner.core.config.heuristic.selector.move.composite.UnionMoveSelectorConfig.buildBaseMoveSelector(UnionMoveSelectorConfig.java:77) ~[classes/:na]
    at org.optaplanner.core.config.heuristic.selector.move.MoveSelectorConfig.buildMoveSelector(MoveSelectorConfig.java:194) ~[classes/:na]
    at org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig.buildMoveSelector(LocalSearchPhaseConfig.java:237) ~[classes/:na]
    at org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig.buildDecider(LocalSearchPhaseConfig.java:128) ~[classes/:na]
    at org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig.buildPhase(LocalSearchPhaseConfig.java:114) ~[classes/:na]
    at org.optaplanner.core.config.localsearch.LocalSearchPhaseConfig.buildPhase(LocalSearchPhaseConfig.java:51) ~[classes/:na]
    at org.optaplanner.core.config.solver.SolverConfig.buildPhaseList(SolverConfig.java:297) ~[classes/:na]
    at org.optaplanner.core.config.solver.SolverConfig.buildSolver(SolverConfig.java:233) ~[classes/:na]
    at org.optaplanner.benchmark.impl.SubSingleBenchmarkRunner.call(SubSingleBenchmarkRunner.java:99) ~[classes/:na]
    at org.optaplanner.benchmark.impl.SubSingleBenchmarkRunner.call(SubSingleBenchmarkRunner.java:34) ~[classes/:na]
    at java.util.concurrent.FutureTask.run$$$capture(FutureTask.java:266) ~[na:1.8.0_152]
    at java.util.concurrent.FutureTask.run(FutureTask.java) ~[na:1.8.0_152]
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149) ~[na:1.8.0_152]
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624) ~[na:1.8.0_152]
    at java.lang.Thread.run(Thread.java:748) ~[na:1.8.0_152]

如果你能提供一些关于基准的细节,那也很不错。

0 个答案:

没有答案