BTW, the errors thrown by the code generator aren't very helpful for
figuring out which rule has blown up. It would be really nice if they
gave the rule name in the message.
I'm now carrying the attached patch to track down all my line break
problems. Feel free to apply it.
On 2025-10-16 11:18, Harold Campbell wrote:
This seems to be a line break problem. This works:
rule "blah"
when
$myVar: /myEntity/terminatingLinks
then
// stuff
end
This does not:
rule "blah"
when
$myVar: /myEntity
/terminatingLinks
then
// stuff
end
The line break version DOES work in 8.44.
Are the line break rules documented somewhere? I have some pretty long
traversals in my rules. Forcing them onto a single line is not good for
readability.
On 2025-10-08 15:59, Harold Campbell wrote:
I thought I'd try to work around this while waiting for a 10.2.0
release by hiding everything that triggers it in SingletonStore<>, but
now I've run into another problem.
[ERROR] Caused by: java.lang.IllegalArgumentException: Unknown
declaration: terminatingLinks
[ERROR] at
org.drools.model.codegen.execmodel.util.PatternUtil.findPatternType(PatternUtil.java:75)
The rule looks something vaguely like
rule "blah"
when
$myVar: /myEntity/terminatingLinks
then
// stuff
end
Now, myEntity is of a class type which is NOT defined directly in the
application. It's in a dependency. So it's not exactly the same as
what I already reported, but it has a similar flavor. I wonder if it
is actually the same bug or something similar enough that it can be
found without me working up another reproducer.
As before, this is from rules which work just fine in Drools 8.
On 2025-09-17 10:11, Alex Porcelli wrote:
This has been merged to main [1], it should be fixed in the next
release (which we don't have a date yet).
[1] -
https://github.com/apache/incubator-kie-drools/commit/d7d5971d1f0e31e4669624d7c16955d58712b13e
On Mon, Sep 15, 2025 at 6:22 PM Alex Porcelli <[email protected]>
wrote:
Thank you, Harold, for reaching out and for sharing the issue and
the
reproducer.
It does look like a regression. I’ve just opened an issue to track
it:
https://github.com/apache/incubator-kie-issues/issues/2100
-
Alex
On Mon, Sep 15, 2025 at 2:09 PM Harold Campbell <[email protected]>
wrote:
>
> Hello!
>
> I'm trying to port a couple projects from Drools 8 to 10, and I've run
> into a roadblock. My RuleUnitData classes contain non-DataSource fields
> of types defined in the application. This works great in 8.44. In 10 I
> get a ClassNotFoundException. E.g.
>
>
> [ERROR] Caused by: java.lang.ClassNotFoundException:
> org.drools.quarkus.quickstart.test.OtherBean
> [ERROR] at
>
org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass(SelfFirstStrategy.java:42)
> [ERROR] at
>
org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass(ClassRealm.java:225)
> [ERROR] at
>
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:210)
> [ERROR] at
>
org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass(ClassRealm.java:205)
> [ERROR] at
>
io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:565)
> [ERROR] at
>
io.quarkus.bootstrap.classloading.QuarkusClassLoader.loadClass(QuarkusClassLoader.java:513)
> [ERROR] at
>
org.drools.ruleunits.impl.SimpleRuleUnitVariable.<init>(SimpleRuleUnitVariable.java:55)
>
> The above is what I get when building the attached reproducer. This
> reproducer is based on drools-quarkus-quickstart-test from
> incubator-kie-drools. Other than making the module buildable outside the
> incubator project, the only change is adding that OtherBean type and a
> reference to it in HomeRuleUnitData. Note: It's the getter/setter pair
> which actually causes the problem. A field with no accessors builds
> fine.
>
> So...is this a drools 10 bug, or am I totally off base in what I'm
> trying to do?
>
> --
> Harold Campbell <[email protected]>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--
Harold Campbell <[email protected]>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--
Harold Campbell <[email protected]>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
--
Harold Campbell <[email protected]>
From 620e92971a82eae049ead3c6ec777a4d4cd6bddd Mon Sep 17 00:00:00 2001
From: Harold Campbell <[email protected]>
Date: Thu, 16 Oct 2025 12:44:15 -0500
Subject: [PATCH] mode-codegen PatternUtil#findPatternType: Include the rule
name in the exception message.
---
.../org/drools/model/codegen/execmodel/util/PatternUtil.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/util/PatternUtil.java b/drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/util/PatternUtil.java
index 7e960088db..8fd978e259 100644
--- a/drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/util/PatternUtil.java
+++ b/drools-model/drools-model-codegen/src/main/java/org/drools/model/codegen/execmodel/util/PatternUtil.java
@@ -72,7 +72,7 @@ public class PatternUtil {
Class<?> ruleUnitVarType = context.getRuleUnitVarType(firstPart.getField());
if (ruleUnitVarType == null) {
- throw new IllegalArgumentException("Unknown declaration: " + firstPart.getField());
+ throw new IllegalArgumentException("Error compiling '" + context.getRuleName() + "': Unknown declaration: " + firstPart.getField());
}
return ruleUnitVarType.getCanonicalName();
}
--
2.51.0
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]