Uploaded image for project: 'OptaPlanner'
  1. OptaPlanner
  2. PLANNER-381

Automatic annotation scanning should reorder entityClasses based on inheritance to avoid a fail-fast

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.3.0.CR1
    • 6.3.0.Beta2
    • optaplanner-core
    • None
    • NEW
    • NEW

      When using

      <scanAnnotatedClasses>

      on vehicle routing, I get this exception:

      java.lang.IllegalArgumentException: An earlier entityClass (class org.optaplanner.examples.vehiclerouting.domain.Customer) should not be a subclass of a later entityClass (interface org.optaplanner.examples.vehiclerouting.domain.Standstill). Switch their declaration so superclasses are defined earlier.
      	at org.optaplanner.core.impl.domain.solution.descriptor.SolutionDescriptor.addEntityDescriptor(SolutionDescriptor.java:111)
      	at org.optaplanner.core.impl.domain.solution.descriptor.SolutionDescriptor.buildSolutionDescriptor(SolutionDescriptor.java:75)
      	at org.optaplanner.core.config.domain.ScanAnnotatedClassesConfig.buildSolutionDescriptor(ScanAnnotatedClassesConfig.java:73)
      	at org.optaplanner.core.config.solver.SolverConfig.buildSolutionDescriptor(SolverConfig.java:228)
      	at org.optaplanner.core.config.solver.SolverConfig.buildSolver(SolverConfig.java:179)
      	at org.optaplanner.core.impl.solver.XStreamXmlSolverFactory.buildSolver(XStreamXmlSolverFactory.java:141)
      	at org.optaplanner.examples.common.app.SolverPerformanceTest.solve(SolverPerformanceTest.java:78)
      	at org.optaplanner.examples.common.app.SolverPerformanceTest.runSpeedTest(SolverPerformanceTest.java:63)
      	at org.optaplanner.examples.common.app.SolverPerformanceTest.runSpeedTest(SolverPerformanceTest.java:58)
      	at org.optaplanner.examples.vehiclerouting.app.VehicleRoutingPerformanceTest.solveModel_cvrp_32customers(VehicleRoutingPerformanceTest.java:46)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)
      	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
      	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
      	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
      	at org.junit.internal.runners.statements.FailOnTimeout$StatementThread.run(FailOnTimeout.java:74)
      

              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              gdesmet@redhat.com Geoffrey De Smet (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: