Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Classloader changed in quarkus 2.1.0 (regression from 2.0.1) for optaplanner/drools with smallrye (but not resteasy) #19136

Closed
ge0ffrey opened this issue Jul 30, 2021 · 3 comments · Fixed by #19155
Labels
area/smallrye kind/bug Something isn't working
Milestone

Comments

@ge0ffrey
Copy link
Contributor

ge0ffrey commented Jul 30, 2021

Describe the bug

The drools ANC compiler fails in 2.1.0 (not in 2.0.1) on optaplanner's activemq-quarkus quickstart
because the classloader changed.

Before (2.0.1):
image

After (2.1.0):
image

The strange thing is, that it doesn't fail for any of the other quickstarts (those use resteasy and sometimes hibernate, this one uses smallrye).
Comparing the dependency tree between 2.0.1 and 2.1.0 shows nothing besides the quarkus version change that could explain this.

Expected behavior

A successful test with the reproducer below.

Actual behavior

2021-07-30 16:29:06,337 WARN  [org.acm.sch.mes.TimeTableMessagingHandler] (ForkJoinPool.commonPool-worker-3) Error during processing a solver request (1).: org.drools.ancompiler.CouldNotCreateAlphaNetworkCompilerException: Cannot create Compiled Alpha Network
        at org.drools.ancompiler.CompiledNetworkSource.newCompiledNetworkInstance(CompiledNetworkSource.java:80)
        at org.drools.ancompiler.CompiledNetworkSource.createInstanceAndSet(CompiledNetworkSource.java:66)
        at org.drools.ancompiler.KieBaseUpdaterANC.lambda$inMemoryUpdate$0(KieBaseUpdaterANC.java:72)
        at java.base/java.util.HashMap$Values.forEach(HashMap.java:976)
        at org.drools.ancompiler.KieBaseUpdaterANC.inMemoryUpdate(KieBaseUpdaterANC.java:70)
        at org.drools.ancompiler.KieBaseUpdaterANC.run(KieBaseUpdaterANC.java:52)
        at org.drools.ancompiler.KieBaseUpdaterANC.generateAndSetInMemoryANC(KieBaseUpdaterANC.java:99)
        at org.optaplanner.core.impl.score.stream.drools.DroolsConstraintSessionFactory.buildKieBaseFromModel(DroolsConstraintSessionFactory.java:85)
        at org.optaplanner.core.impl.score.stream.drools.DroolsConstraintSessionFactory.buildSession(DroolsConstraintSessionFactory.java:126)
        at org.optaplanner.core.impl.score.director.stream.DroolsConstraintStreamScoreDirectorFactory.newConstraintStreamingSession(DroolsConstraintStreamScoreDirectorFactory.java:50)
        at org.optaplanner.core.impl.score.director.stream.DroolsConstraintStreamScoreDirector.resetConstraintStreamingSession(DroolsConstraintStreamScoreDirector.java:75)
        at org.optaplanner.core.impl.score.director.stream.DroolsConstraintStreamScoreDirector.setWorkingSolution(DroolsConstraintStreamScoreDirector.java:67)
        at org.optaplanner.core.impl.solver.scope.SolverScope.setWorkingSolutionFromBestSolution(SolverScope.java:215)
        at org.optaplanner.core.impl.solver.AbstractSolver.solvingStarted(AbstractSolver.java:80)
        at org.optaplanner.core.impl.solver.DefaultSolver.solvingStarted(DefaultSolver.java:200)
        at org.optaplanner.core.impl.solver.DefaultSolver.solve(DefaultSolver.java:174)
        at org.acme.schooltimetabling.messaging.TimeTableMessagingHandler.lambda$solve$0(TimeTableMessagingHandler.java:79)
        at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
        at java.base/java.util.concurrent.CompletableFuture$AsyncRun.exec(CompletableFuture.java:1728)
        at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290)
        at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020)
        at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656)
        at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594)
        at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183)
Caused by: java.lang.NoSuchMethodException: org.drools.ancompiler.Compiledorg_acme_schooltimetabling_domain_LessonNetwork31008790748.<init>(org.drools.core.spi.InternalReadAccessor, java.util.Map)
        at java.base/java.lang.Class.getConstructor0(Class.java:3349)
        at java.base/java.lang.Class.getDeclaredConstructor(Class.java:2553)
        at org.drools.ancompiler.CompiledNetworkSource.newCompiledNetworkInstance(CompiledNetworkSource.java:77)
        ... 23 more

How to Reproduce?

git clone https://github.com/kiegroup/optaplanner-quickstarts.git
cd optaplanner-quickstarts
git checkout development
cd technology/java-activemq-quarkus
gedit pom.xml // Switch it to 2.1.0.Final
mvn clean install -DskipTests
cd solver
mvn test -Dtest=TimeTableMessagingHandlerTest#solve

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

Reproduced on multiple machines (Radovan, Geoffrey, Luca).
Zulip discussion: https://quarkusio.zulipchat.com/#narrow/stream/187038-dev/topic/2.2E1.2E0.20Classloading.20regressions

@ge0ffrey ge0ffrey added the kind/bug Something isn't working label Jul 30, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Jul 30, 2021

@ge0ffrey
Copy link
Contributor Author

@stuartwdouglas Did the classloader for smallrye but not resteasy change in quarkus 2.1?

@stuartwdouglas
Copy link
Member

This was caused by ae9a634

stuartwdouglas added a commit to stuartwdouglas/quarkus that referenced this issue Aug 2, 2021
@quarkus-bot quarkus-bot bot added this to the 2.2 - main milestone Aug 2, 2021
@gsmet gsmet modified the milestones: 2.2 - main, 2.1.1.Final Aug 3, 2021
gsmet pushed a commit to gsmet/quarkus that referenced this issue Aug 3, 2021
…Common ForkJoin ThreadPool"

This reverts commit ae9a634.

Fixes quarkusio#19136

(cherry picked from commit b404d4b)
gsmet pushed a commit to gsmet/quarkus that referenced this issue Aug 3, 2021
…Common ForkJoin ThreadPool"

This reverts commit ae9a634.

Fixes quarkusio#19136

(cherry picked from commit b404d4b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/smallrye kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants