I recognise the docs say “17+” but I wonder if Java 21 is part of the test 
suite.


Drools 10.1.0 rule compilation fails on Java 21 (OpenJDK) with an 
UnsupportedOperationException during parallel rule compilation when creating a 
KieSession from a KJAR.

Environment
Java: OpenJDK 21
Drools: 10.1.0
OS: Windows
Maven: 3.x

Steps to Reproduce
1. Build a KJAR with Drools 10.1.0
2. Load via KieServices.Factory.get().getKieClasspathContainer() and create a 
KieSession from a KJAR
3. Trigger parallel rule compilation

Error Details
java.lang.RuntimeException: Rules compilation failed or interrupted at 
org.drools.compiler.builder.impl.processors.ImmutableRuleCompilationPhase.compileRulesLevel(ImmutableRuleCompilationPhase.java:285)
... (parallel execution stack trace using atomic primitives)

Root cause:
java.lang.UnsupportedOperationException: null
at 
org.drools.compiler.rule.builder.ConstraintBuilder$DummyConstraintBuilder.setExprInputs(ConstraintBuilder.java:210)

Stack Trace Highlights
The failure occurs in parallel execution via ForkJoinPool:
at java.base/java.util.stream.ForEachOps$ForEachOp.evaluateParallel
at 
org.drools.compiler.builder.impl.processors.ImmutableRuleCompilationPhase.lambda$compileRulesLevel$4

Indicates a failure during parallel compilation using Java 21's stream 
framework.

Workarounds Attempted (None Successful)
1. System.setProperty("drools.parallelExecutionAllowed", "false") – not honored 
in 10.x
2. System.setProperty("drools.multithreadEvaluation", "false") – no effect
3. Downgrade to Drools 8.44 – DRL incompatibility with 10.x-compiled rules
4. -Djdk.reflect.useDirectMethodHandle=false – still fails with native 
reflection

Expected Behavior
Rules compile and execute successfully on Java 21 without errors.



[Perforce Software]



Douglas Whitfield | Enterprise Architect, OpenLogic

Perforce Software<https://www.perforce.com>

P +1 612.517.2100

Visit Us On: LinkedIn<https://www.linkedin.com/company/perforce> | 
YouTube<https://www.youtube.com/user/perforcesoftware>




This e-mail may contain information that is privileged or confidential. If you 
are not the intended recipient, please delete the e-mail and any attachments 
and notify us immediately.

Reply via email to