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

Quarkus ConstraintVerifier: running tests together succeeds, running a test alone throws UnsatisfiedResolutionException

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Do
    • Icon: Major Major
    • None
    • None
    • optaplanner-quarkus
    • None
    • Undefined
    • NEW
    • NEW

      To reproduce:

      go to optaplanner-quickstarts
      cd technology/java-activemq-quarkus
      mvn clean install -DskipTests
      cd solver
      mvn test -Dtest=TimeTableMessagingHandlerTest#solve
      

      Gives this error:

      [INFO] -------------------------------------------------------
      [INFO]  T E S T S
      [INFO] -------------------------------------------------------
      [INFO] Running org.acme.schooltimetabling.TimeTableMessagingHandlerTest
      2021-07-30 11:17:01,450 WARN  [org.opt.qua.dep.OptaPlannerProcessor] (build-8) Skipping OptaPlanner extension because there are no @PlanningSolution or @PlanningEntity annotated classes.
      If your domain classes are located in a dependency of this project, maybe try generating the Jandex index by using the jandex-maven-plugin in that dependency, or by addingapplication.properties entries (quarkus.index-dependency.<name>.group-id and quarkus.index-dependency.<name>.artifact-id).
      [ERROR] Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 1.543 s <<< FAILURE! - in org.acme.schooltimetabling.TimeTableMessagingHandlerTest
      [ERROR] org.acme.schooltimetabling.TimeTableMessagingHandlerTest.solve  Time elapsed: 0.008 s  <<< ERROR!
      java.lang.RuntimeException: 
      java.lang.RuntimeException: io.quarkus.builder.BuildException: Build failure: Build failed due to errors
              [error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: Found 2 deployment problems: 
      [1] Unsatisfied dependency for type org.optaplanner.core.api.solver.SolverFactory<org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.messaging.TimeTableMessagingHandler#<init>()
              - declared on CLASS bean [types=[java.lang.Object, org.acme.schooltimetabling.messaging.TimeTableMessagingHandler], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.messaging.TimeTableMessagingHandler]
      [2] Unsatisfied dependency for type org.optaplanner.test.api.score.stream.ConstraintVerifier<org.acme.schooltimetabling.solver.TimeTableConstraintProvider, org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest#constraintVerifier
              - declared on CLASS bean [types=[org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest, java.lang.Object], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest]
              at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:1102)
              at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:259)
              at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:129)
              at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:418)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820)
              at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
              at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
              at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2442)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1476)
              at java.base/java.lang.Thread.run(Thread.java:834)
              at org.jboss.threads.JBossThread.run(JBossThread.java:501)
              Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.optaplanner.core.api.solver.SolverFactory<org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.messaging.TimeTableMessagingHandler#<init>()
              - declared on CLASS bean [types=[java.lang.Object, org.acme.schooltimetabling.messaging.TimeTableMessagingHandler], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.messaging.TimeTableMessagingHandler]
                      at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:492)
                      at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:463)
                      at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:247)
                      ... 13 more
              Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.optaplanner.test.api.score.stream.ConstraintVerifier<org.acme.schooltimetabling.solver.TimeTableConstraintProvider, org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest#constraintVerifier
              - declared on CLASS bean [types=[org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest, java.lang.Object], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest]
                      at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:492)
                      at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:463)
                      at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:247)
                      ... 13 more
      
      Caused by: java.lang.RuntimeException: 
      io.quarkus.builder.BuildException: Build failure: Build failed due to errors
              [error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: Found 2 deployment problems: 
      [1] Unsatisfied dependency for type org.optaplanner.core.api.solver.SolverFactory<org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.messaging.TimeTableMessagingHandler#<init>()
              - declared on CLASS bean [types=[java.lang.Object, org.acme.schooltimetabling.messaging.TimeTableMessagingHandler], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.messaging.TimeTableMessagingHandler]
      [2] Unsatisfied dependency for type org.optaplanner.test.api.score.stream.ConstraintVerifier<org.acme.schooltimetabling.solver.TimeTableConstraintProvider, org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest#constraintVerifier
              - declared on CLASS bean [types=[org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest, java.lang.Object], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest]
              at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:1102)
              at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:259)
              at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:129)
              at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:418)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820)
              at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
              at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
              at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2442)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1476)
              at java.base/java.lang.Thread.run(Thread.java:834)
              at org.jboss.threads.JBossThread.run(JBossThread.java:501)
              Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.optaplanner.core.api.solver.SolverFactory<org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.messaging.TimeTableMessagingHandler#<init>()
              - declared on CLASS bean [types=[java.lang.Object, org.acme.schooltimetabling.messaging.TimeTableMessagingHandler], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.messaging.TimeTableMessagingHandler]
                      at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:492)
                      at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:463)
                      at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:247)
                      ... 13 more
              Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.optaplanner.test.api.score.stream.ConstraintVerifier<org.acme.schooltimetabling.solver.TimeTableConstraintProvider, org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest#constraintVerifier
              - declared on CLASS bean [types=[org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest, java.lang.Object], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest]
                      at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:492)
                      at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:463)
                      at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:247)
                      ... 13 more
      
      Caused by: io.quarkus.builder.BuildException: 
      Build failure: Build failed due to errors
              [error]: Build step io.quarkus.arc.deployment.ArcProcessor#validate threw an exception: javax.enterprise.inject.spi.DeploymentException: Found 2 deployment problems: 
      [1] Unsatisfied dependency for type org.optaplanner.core.api.solver.SolverFactory<org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.messaging.TimeTableMessagingHandler#<init>()
              - declared on CLASS bean [types=[java.lang.Object, org.acme.schooltimetabling.messaging.TimeTableMessagingHandler], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.messaging.TimeTableMessagingHandler]
      [2] Unsatisfied dependency for type org.optaplanner.test.api.score.stream.ConstraintVerifier<org.acme.schooltimetabling.solver.TimeTableConstraintProvider, org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest#constraintVerifier
              - declared on CLASS bean [types=[org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest, java.lang.Object], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest]
              at io.quarkus.arc.processor.BeanDeployment.processErrors(BeanDeployment.java:1102)
              at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:259)
              at io.quarkus.arc.processor.BeanProcessor.initialize(BeanProcessor.java:129)
              at io.quarkus.arc.deployment.ArcProcessor.validate(ArcProcessor.java:418)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
              at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
              at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
              at java.base/java.lang.reflect.Method.invoke(Method.java:566)
              at io.quarkus.deployment.ExtensionLoader$2.execute(ExtensionLoader.java:820)
              at io.quarkus.builder.BuildContext.run(BuildContext.java:277)
              at org.jboss.threads.ContextHandler$1.runWith(ContextHandler.java:18)
              at org.jboss.threads.EnhancedQueueExecutor$Task.run(EnhancedQueueExecutor.java:2442)
              at org.jboss.threads.EnhancedQueueExecutor$ThreadBody.run(EnhancedQueueExecutor.java:1476)
              at java.base/java.lang.Thread.run(Thread.java:834)
              at org.jboss.threads.JBossThread.run(JBossThread.java:501)
              Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.optaplanner.core.api.solver.SolverFactory<org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.messaging.TimeTableMessagingHandler#<init>()
              - declared on CLASS bean [types=[java.lang.Object, org.acme.schooltimetabling.messaging.TimeTableMessagingHandler], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.messaging.TimeTableMessagingHandler]
                      at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:492)
                      at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:463)
                      at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:247)
                      ... 13 more
              Suppressed: javax.enterprise.inject.UnsatisfiedResolutionException: Unsatisfied dependency for type org.optaplanner.test.api.score.stream.ConstraintVerifier<org.acme.schooltimetabling.solver.TimeTableConstraintProvider, org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest#constraintVerifier
              - declared on CLASS bean [types=[org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest, java.lang.Object], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest]
                      at io.quarkus.arc.processor.Beans.resolveInjectionPoint(Beans.java:492)
                      at io.quarkus.arc.processor.BeanInfo.init(BeanInfo.java:463)
                      at io.quarkus.arc.processor.BeanDeployment.init(BeanDeployment.java:247)
                      ... 13 more
      
      Caused by: javax.enterprise.inject.spi.DeploymentException: 
      Found 2 deployment problems: 
      [1] Unsatisfied dependency for type org.optaplanner.core.api.solver.SolverFactory<org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.messaging.TimeTableMessagingHandler#<init>()
              - declared on CLASS bean [types=[java.lang.Object, org.acme.schooltimetabling.messaging.TimeTableMessagingHandler], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.messaging.TimeTableMessagingHandler]
      [2] Unsatisfied dependency for type org.optaplanner.test.api.score.stream.ConstraintVerifier<org.acme.schooltimetabling.solver.TimeTableConstraintProvider, org.acme.schooltimetabling.domain.TimeTable> and qualifiers [@Default]
              - java member: org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest#constraintVerifier
              - declared on CLASS bean [types=[org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest, java.lang.Object], qualifiers=[@Default, @Any], target=org.acme.schooltimetabling.solver.TimeTableConstraintProviderTest]
      
      

              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: