[JBoss JIRA] (WFCORE-5022) The /subsystem=elytron/policy=* can be simplified a lot further
by Darran Lofthouse (Jira)
Darran Lofthouse created WFCORE-5022:
----------------------------------------
Summary: The /subsystem=elytron/policy=* can be simplified a lot further
Key: WFCORE-5022
URL: https://issues.redhat.com/browse/WFCORE-5022
Project: WildFly Core
Issue Type: Enhancement
Components: Security
Affects Versions: 12.0.1.Final
Reporter: Darran Lofthouse
Assignee: Darran Lofthouse
Fix For: 13.0.0.Beta1
At the moment this resource is quite verbose but the tasks it performs are very simple.
{code}
[standalone@localhost:9990 /] /subsystem=elytron/policy=*:read-resource-description
{
"outcome" => "success",
"result" => [{
"address" => [
("subsystem" => "elytron"),
("policy" => "*")
],
"outcome" => "success",
"result" => {
"description" => "A definition that sets up a policy provider.",
"max-occurs" => 1,
"capabilities" => [{
"name" => "org.wildfly.security.policy",
"dynamic" => false
}],
"access-constraints" => {
"sensitive" => {"elytron-security" => {"type" => "elytron"}},
"application" => {"elytron-security" => {"type" => "elytron"}}
},
"attributes" => {
"custom-policy" => {
"type" => OBJECT,
"description" => "A custom policy provider definition.",
"expressions-allowed" => false,
"required" => true,
"nillable" => true,
"alternatives" => ["jacc-policy"],
"value-type" => {
"class-name" => {
"type" => STRING,
"description" => "The name of a java.security.Policy implementation referencing a policy provider.",
"expressions-allowed" => false,
"required" => true,
"nillable" => false,
"min-length" => 1L,
"max-length" => 2147483647L
},
"module" => {
"type" => STRING,
"description" => "The name of the module to load the provider from.",
"expressions-allowed" => false,
"required" => false,
"nillable" => true,
"min-length" => 1L,
"max-length" => 2147483647L
}
},
"access-type" => "read-write",
"storage" => "configuration",
"restart-required" => "no-services"
},
"default-policy" => {
"type" => STRING,
"description" => "Not used.",
"expressions-allowed" => false,
"required" => false,
"nillable" => true,
"min-length" => 1L,
"max-length" => 2147483647L,
"deprecated" => {
"since" => "1.2.0",
"reason" => "The 'default-policy' attribute is ignored, as a policy resource should be configured with only one policy."
},
"access-type" => "read-write",
"storage" => "configuration",
"restart-required" => "no-services"
},
"jacc-policy" => {
"type" => OBJECT,
"description" => "A policy provider definition that sets up JACC and related services.",
"expressions-allowed" => false,
"required" => true,
"nillable" => true,
"alternatives" => ["custom-policy"],
"value-type" => {
"policy" => {
"type" => STRING,
"description" => "The name of a java.security.Policy implementation referencing a policy provider.",
"expressions-allowed" => false,
"required" => false,
"nillable" => true,
"default" => "org.wildfly.security.authz.jacc.JaccDelegatingPolicy",
"min-length" => 1L,
"max-length" => 2147483647L
},
"configuration-factory" => {
"type" => STRING,
"description" => "The name of a javax.security.jacc.PolicyConfigurationFactory implementation referencing a policy configuration factory provider.",
"expressions-allowed" => false,
"required" => false,
"nillable" => true,
"default" => "org.wildfly.security.authz.jacc.ElytronPolicyConfigurationFactory",
"min-length" => 1L,
"max-length" => 2147483647L
},
"module" => {
"type" => STRING,
"description" => "The name of the module to load the provider from.",
"expressions-allowed" => false,
"required" => false,
"nillable" => true,
"min-length" => 1L,
"max-length" => 2147483647L
}
},
"access-type" => "read-write",
"storage" => "configuration",
"restart-required" => "no-services"
}
},
"operations" => undefined,
"notifications" => undefined,
"children" => {}
}
}]
}
{code}
Firstly it only makes sense to have a single policy defined, the outcome of this resource is JVM wide registration so multiple definitions would lead to undefined behaviour.
Secondly this provides two primary functions.
1. Instantation of https://docs.oracle.com/javase/8/docs/api/java/security/Policy.html and registration via a call to https://docs.oracle.com/javase/8/docs/api/java/security/Policy.html#setPo...
This first point needs a class name for the policy as well as a module.
2. Registration of the JVM wide https://jakarta.ee/specifications/platform/8/apidocs/javax/security/jacc/... again needing a classname and module.
This is also not working correctly but the immediate bug is being addressed under WFCORE-5020
The JACC APIs don't actually provide a nice way to register this so maybe this is something we should also propose via the spec, but this piece is effectively a class name and module name.
We have ended up with custom and jacc variants as alternatives. Really both variants are optional but if the resource is defined at least one must be set.
It may make sense for JACC to move to it's own subsystem for a couple of reasons.
The JVM wide policy will likely need to be possible in both subsystems but use a capability to ensure it is defined in only one. We probably should move it's registration into the boot operations so registration is complete before DUPs begin.
The PolicyConfigurationFactory would then be in a JACC subsystem only. Again handling during a boot operation may be preferable otherwise we see issues like WFLY-13615 but failing that ensuring the deployment depend upon the registration happening may be sufficient.
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 6 months
[JBoss JIRA] (DROOLS-5449) ClassCastException upon unreferenced declare update
by Mario Fusco (Jira)
[ https://issues.redhat.com/browse/DROOLS-5449?page=com.atlassian.jira.plug... ]
Mario Fusco updated DROOLS-5449:
--------------------------------
Sprint: 2020 Week 25-27 (from Jun 15)
> ClassCastException upon unreferenced declare update
> ---------------------------------------------------
>
> Key: DROOLS-5449
> URL: https://issues.redhat.com/browse/DROOLS-5449
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.38.0.Final
> Reporter: Matteo Casalino
> Assignee: Mario Fusco
> Priority: Major
> Attachments: class-cast-exception-on-unreferenced-declare-update.zip
>
>
> After updating a declared type that is not referenced in the rules with _updateToVersion()_,
> running _fireAllRules()_ many times in a loop throws _ClassCastException_.
> E.g., when the following DRL:
> {noformat}
> declare UnreferencedType
> x : int
> end
> declare ReferencedType
> str : String
> end
>
> rule "example rule"
> when
> ReferencedType( str == "A" )
> then
> end{noformat}
> is updated to:
> {noformat}
> declare UnreferencedType
> x : int
> newField : String
> end
> declare ReferencedType
> str : String
> end
>
> rule "example rule"
> when
> ReferencedType( str == "A" )
> then
> end{noformat}
> the following exception it thrown by _fireAllRules()_:
> {noformat}
> java.lang.RuntimeException: Error evaluating constraint 'str == "A"' in [Rule "example rule" in org/example/rules.drl]
> at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:277)
> at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:225)
> at org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:139)
> ...
> Caused by: java.lang.ClassCastException: class org.example.ReferencedType cannot be cast to class org.example.ReferencedType (org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @46292372; org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @23b8d9f3)
> at ConditionEvaluator7ed8b2c57cad4e74b856fdba30554aa1.evaluate(Unknown Source)
> at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:275)
> ... 43 more{noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 6 months
[JBoss JIRA] (DROOLS-5450) [DMN Designer] ClassCastException while saving an existing DMN file in Kogito
by Valentino Pellegrino (Jira)
Valentino Pellegrino created DROOLS-5450:
--------------------------------------------
Summary: [DMN Designer] ClassCastException while saving an existing DMN file in Kogito
Key: DROOLS-5450
URL: https://issues.redhat.com/browse/DROOLS-5450
Project: Drools
Issue Type: Bug
Components: DMN Editor
Affects Versions: 7.40.0.Final
Reporter: Valentino Pellegrino
Assignee: Guilherme Gomes
Attachments: fraud.dmn
With the attached [^fraud.dmn] it is not possible to perform the *save* operation on kogito webapp.
This is the error:
{code:java}
{{Error: java.lang.ClassCastException
at qcf_g$.aHb_g$ [as createError_0_g$] (Throwable.java:120)
at qcf_g$.kHb_g$ [as initializeBackingError_0_g$] (Throwable.java:112)
at qcf_g$.VGb_g$ (Throwable.java:66)
at qcf_g$.zHb_g$ (Exception.java:29)
at qcf_g$.pLc_g$ (RuntimeException.java:29)
at new qcf_g$ (ClassCastException.java:27)
at Dzm_g$ (InternalPreconditions.java:154)
at Pzm_g$ (InternalPreconditions.java:138)
at Ozm_g$ (InternalPreconditions.java:133)
at Y6h_g$ (Cast.java:155)
at c4M_g$ (UnaryTestsPropertyConverter.java:76)
at v1M_g$ (ItemDefinitionPropertyConverter.java:129)
at X61_g$ (DefinitionsConverter.java:164)
at eEw_g$.kEw_g$ [as marshall_0_g$] (DMNMarshallerKogitoMarshaller.java:150)
at oEw_g$.yEw_g$ [as marshall_0_g$] (Type_factory__o_k_w_c_d_w_k_c_c_c_DMNMarshallerKogitoMarshaller_quals_j_e_i_Any_j_e_i_Default.java:67)
at kMw_g$.tMw_g$ [as marshall_1_g$] (DMNClientDiagramServiceImpl.java:234)
at kMw_g$.M01_g$ [as lambda$2_166_g$] (DMNClientDiagramServiceImpl.java:202)
at Function.t71_g$ (DMNClientDiagramServiceImpl.java:199)
at lambda_0_g$ (Runtime.java:166)
at new Promise (<anonymous>)
at dQU_g$.hQU_g$ [as create_77_g$] (Promises.java:200)
at kMw_g$.wMw_g$ [as transform_28_g$] (DMNClientDiagramServiceImpl.java:199)
at AMw_g$.QMw_g$ [as transform_28_g$] (Type_factory__o_k_w_c_d_w_k_c_c_s_DMNClientDiagramServiceImpl_quals_j_e_i_Any_j_e_i_Default.java:83)
at M21_g$.AOM_g$ [as getContent_5_g$] (AbstractDMNDiagramEditor.java:403)
at M21_g$.mPM_g$ [as doSave_2_g$] (DMNDiagramEditor.java:234)
at CPM_g$.DPM_g$ [as execute_3_g$] (DMNDiagramEditor.java:185)
at s0U_g$ (ListBarWidgetImpl.java:466)
at G1U_g$.H1U_g$ [as onClick_6_g$] (ListBarWidgetImpl.java:466)
at qCh_g$.rCh_g$ [as dispatch_46_g$] (ClickEvent.java:56)
at qCh_g$.sCh_g$ [as dispatch_2_g$] (ClickEvent.java:55)
at qCh_g$.Ju_g$ [as dispatch_1_g$] (GwtEvent.java:76)
at vMh_g$ (EventBus.java:40)
at XMh_g$.GMh_g$ [as doFire_0_g$] (SimpleEventBus.java:193)
at XMh_g$.MMh_g$ [as fireEvent_4_g$] (SimpleEventBus.java:88)
at kMh_g$.nMh_g$ [as fireEvent_1_g$] (HandlerManager.java:127)
at lMn_g$.wPc_g$ [as fireEvent_1_g$] (Widget.java:129)
at qBh_g$ (DomEvent.java:125)
at lMn_g$.EPc_g$ [as onBrowserEvent_0_g$] (Widget.java:177)
at IRi_g$ (DOM.java:1481)
at HRi_g$ (DOM.java:1420)
at HTMLButtonElement.ZXi_g$ (DOMImplStandard.java:317)
at jag_g$ (Impl.java:309)
at mag_g$ (Impl.java:361)
at HTMLButtonElement.<anonymous> (Impl.java:78)}}{code}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 6 months
[JBoss JIRA] (DROOLS-5449) ClassCastException upon unreferenced declare update
by Matteo Casalino (Jira)
[ https://issues.redhat.com/browse/DROOLS-5449?page=com.atlassian.jira.plug... ]
Matteo Casalino updated DROOLS-5449:
------------------------------------
Description:
After updating a declared type that is not referenced in the rules with _updateToVersion()_,
running _fireAllRules()_ many times in a loop throws _ClassCastException_.
E.g., when the following DRL:
{noformat}
declare UnreferencedType
x : int
end
declare ReferencedType
str : String
end
rule "example rule"
when
ReferencedType( str == "A" )
then
end{noformat}
is updated to:
{noformat}
declare UnreferencedType
x : int
newField : String
end
declare ReferencedType
str : String
end
rule "example rule"
when
ReferencedType( str == "A" )
then
end{noformat}
the following exception it thrown by _fireAllRules()_:
{noformat}
java.lang.RuntimeException: Error evaluating constraint 'str == "A"' in [Rule "example rule" in org/example/rules.drl]
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:277)
at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:225)
at org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:139)
...
Caused by: java.lang.ClassCastException: class org.example.ReferencedType cannot be cast to class org.example.ReferencedType (org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @46292372; org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @23b8d9f3)
at ConditionEvaluator7ed8b2c57cad4e74b856fdba30554aa1.evaluate(Unknown Source)
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:275)
... 43 more{noformat}
was:
After updating a declared type that is not referenced in the rules with _updateToVersion()_,
running _fireAllRules()_ many times in a loop throws _ClassCastException_.
E.g., when the following DRL:
{noformat}
declare UnreferencedType
x : int
end
declare ReferencedType
str : String
end
rule "example rule"
when
ReferencedType( str == \"A\" )
then
end{noformat}
is updated to:
{noformat}
declare UnreferencedType
x : int
newField : String
end
declare ReferencedType
str : String
end
rule "example rule"
when
ReferencedType( str == \"A\" )
then
end{noformat}
the following exception it thrown by _fireAllRules()_:
{noformat}
java.lang.RuntimeException: Error evaluating constraint 'str == "A"' in [Rule "example rule" in org/example/rules.drl]
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:277)
at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:225)
at org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:139)
...
Caused by: java.lang.ClassCastException: class org.example.ReferencedType cannot be cast to class org.example.ReferencedType (org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @46292372; org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @23b8d9f3)
at ConditionEvaluator7ed8b2c57cad4e74b856fdba30554aa1.evaluate(Unknown Source)
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:275)
... 43 more{noformat}
> ClassCastException upon unreferenced declare update
> ---------------------------------------------------
>
> Key: DROOLS-5449
> URL: https://issues.redhat.com/browse/DROOLS-5449
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.38.0.Final
> Reporter: Matteo Casalino
> Assignee: Mario Fusco
> Priority: Major
> Attachments: class-cast-exception-on-unreferenced-declare-update.zip
>
>
> After updating a declared type that is not referenced in the rules with _updateToVersion()_,
> running _fireAllRules()_ many times in a loop throws _ClassCastException_.
> E.g., when the following DRL:
> {noformat}
> declare UnreferencedType
> x : int
> end
> declare ReferencedType
> str : String
> end
>
> rule "example rule"
> when
> ReferencedType( str == "A" )
> then
> end{noformat}
> is updated to:
> {noformat}
> declare UnreferencedType
> x : int
> newField : String
> end
> declare ReferencedType
> str : String
> end
>
> rule "example rule"
> when
> ReferencedType( str == "A" )
> then
> end{noformat}
> the following exception it thrown by _fireAllRules()_:
> {noformat}
> java.lang.RuntimeException: Error evaluating constraint 'str == "A"' in [Rule "example rule" in org/example/rules.drl]
> at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:277)
> at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:225)
> at org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:139)
> ...
> Caused by: java.lang.ClassCastException: class org.example.ReferencedType cannot be cast to class org.example.ReferencedType (org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @46292372; org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @23b8d9f3)
> at ConditionEvaluator7ed8b2c57cad4e74b856fdba30554aa1.evaluate(Unknown Source)
> at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:275)
> ... 43 more{noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 6 months
[JBoss JIRA] (DROOLS-5449) ClassCastException upon unreferenced declare update
by Matteo Casalino (Jira)
Matteo Casalino created DROOLS-5449:
---------------------------------------
Summary: ClassCastException upon unreferenced declare update
Key: DROOLS-5449
URL: https://issues.redhat.com/browse/DROOLS-5449
Project: Drools
Issue Type: Bug
Components: core engine
Affects Versions: 7.38.0.Final
Reporter: Matteo Casalino
Assignee: Mario Fusco
Attachments: class-cast-exception-on-unreferenced-declare-update.zip
After updating a declared type that is not referenced in the rules with _updateToVersion()_,
running _fireAllRules()_ many times in a loop throws _ClassCastException_.
E.g., when the following DRL:
{noformat}
declare UnreferencedType
x : int
end
declare ReferencedType
str : String
end
rule "example rule"
when
ReferencedType( str == \"A\" )
then
end{noformat}
is updated to:
{noformat}
declare UnreferencedType
x : int
newField : String
end
declare ReferencedType
str : String
end
rule "example rule"
when
ReferencedType( str == \"A\" )
then
end{noformat}
the following exception it thrown by _fireAllRules()_:
{noformat}
java.lang.RuntimeException: Error evaluating constraint 'str == "A"' in [Rule "example rule" in org/example/rules.drl]
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:277)
at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:225)
at org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:139)
...
Caused by: java.lang.ClassCastException: class org.example.ReferencedType cannot be cast to class org.example.ReferencedType (org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @46292372; org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @23b8d9f3)
at ConditionEvaluator7ed8b2c57cad4e74b856fdba30554aa1.evaluate(Unknown Source)
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:275)
... 43 more{noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 6 months
[JBoss JIRA] (DROOLS-5449) ClassCastException upon unreferenced declare update
by Matteo Casalino (Jira)
[ https://issues.redhat.com/browse/DROOLS-5449?page=com.atlassian.jira.plug... ]
Matteo Casalino updated DROOLS-5449:
------------------------------------
Description:
After updating a declared type that is not referenced in the rules with _updateToVersion()_,
running _fireAllRules()_ many times in a loop throws _ClassCastException_.
E.g., when the following DRL:
{noformat}
declare UnreferencedType
x : int
end
declare ReferencedType
str : String
end
rule "example rule"
when
ReferencedType( str == \"A\" )
then
end{noformat}
is updated to:
{noformat}
declare UnreferencedType
x : int
newField : String
end
declare ReferencedType
str : String
end
rule "example rule"
when
ReferencedType( str == \"A\" )
then
end{noformat}
the following exception it thrown by _fireAllRules()_:
{noformat}
java.lang.RuntimeException: Error evaluating constraint 'str == "A"' in [Rule "example rule" in org/example/rules.drl]
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:277)
at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:225)
at org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:139)
...
Caused by: java.lang.ClassCastException: class org.example.ReferencedType cannot be cast to class org.example.ReferencedType (org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @46292372; org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @23b8d9f3)
at ConditionEvaluator7ed8b2c57cad4e74b856fdba30554aa1.evaluate(Unknown Source)
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:275)
... 43 more{noformat}
was:
After updating a declared type that is not referenced in the rules with _updateToVersion()_,
running _fireAllRules()_ many times in a loop throws _ClassCastException_.
E.g., when the following DRL:
{noformat}
declare UnreferencedType
x : int
end
declare ReferencedType
str : String
end
rule "example rule"
when
ReferencedType( str == \"A\" )
then
end{noformat}
is updated to:
{noformat}
declare UnreferencedType
x : int
newField : String
end
declare ReferencedType
str : String
end
rule "example rule"
when
ReferencedType( str == \"A\" )
then
end{noformat}
the following exception it thrown by _fireAllRules()_:
{noformat}
java.lang.RuntimeException: Error evaluating constraint 'str == "A"' in [Rule "example rule" in org/example/rules.drl]
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:277)
at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:225)
at org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:139)
...
Caused by: java.lang.ClassCastException: class org.example.ReferencedType cannot be cast to class org.example.ReferencedType (org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @46292372; org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @23b8d9f3)
at ConditionEvaluator7ed8b2c57cad4e74b856fdba30554aa1.evaluate(Unknown Source)
at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:275)
... 43 more{noformat}
> ClassCastException upon unreferenced declare update
> ---------------------------------------------------
>
> Key: DROOLS-5449
> URL: https://issues.redhat.com/browse/DROOLS-5449
> Project: Drools
> Issue Type: Bug
> Components: core engine
> Affects Versions: 7.38.0.Final
> Reporter: Matteo Casalino
> Assignee: Mario Fusco
> Priority: Major
> Attachments: class-cast-exception-on-unreferenced-declare-update.zip
>
>
> After updating a declared type that is not referenced in the rules with _updateToVersion()_,
> running _fireAllRules()_ many times in a loop throws _ClassCastException_.
> E.g., when the following DRL:
> {noformat}
> declare UnreferencedType
> x : int
> end
> declare ReferencedType
> str : String
> end
>
> rule "example rule"
> when
> ReferencedType( str == \"A\" )
> then
> end{noformat}
> is updated to:
> {noformat}
> declare UnreferencedType
> x : int
> newField : String
> end
> declare ReferencedType
> str : String
> end
>
> rule "example rule"
> when
> ReferencedType( str == \"A\" )
> then
> end{noformat}
> the following exception it thrown by _fireAllRules()_:
> {noformat}
> java.lang.RuntimeException: Error evaluating constraint 'str == "A"' in [Rule "example rule" in org/example/rules.drl]
> at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:277)
> at org.drools.core.rule.constraint.MvelConstraint.isAllowed(MvelConstraint.java:225)
> at org.drools.core.reteoo.AlphaNode.assertObject(AlphaNode.java:139)
> ...
> Caused by: java.lang.ClassCastException: class org.example.ReferencedType cannot be cast to class org.example.ReferencedType (org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @46292372; org.example.ReferencedType is in unnamed module of loader org.drools.dynamic.DynamicProjectClassLoader$DefaultInternalTypesClassLoader @23b8d9f3)
> at ConditionEvaluator7ed8b2c57cad4e74b856fdba30554aa1.evaluate(Unknown Source)
> at org.drools.core.rule.constraint.MvelConstraint.evaluate(MvelConstraint.java:275)
> ... 43 more{noformat}
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
4 years, 6 months