Bug 724700 (BRMS-579)

Summary: Unable to build expression for 'from' if used generic types on collections
Product: [JBoss] JBoss Enterprise BRMS Platform 5 Reporter: Alessandro Lazarotti <alazarot>
Component: BRE (Expert, Fusion)Assignee: Nobody <nobody>
Status: VERIFIED --- QA Contact: Lukáš Petrovický <lpetrovi>
Severity: medium Docs Contact:
Priority: medium    
Version: 5.1.0 GACC: alazarot, atangrin, miroslaw.kobylanski, rwagner, trikkola
Target Milestone: ---   
Target Release: BRMS 5.3.0.GA   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/BRMS-579
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Building expressions for 'from' did not work when using generic types with collections in BRMS 5.2.0. This issue is not present in BRMS 5.3.0.
Story Points: ---
Clone Of: Environment:
BRMS 5.1, JDK 1.6 sun/oracle, Fedora 12
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Alessandro Lazarotti 2011-04-11 20:43:48 UTC
Help Desk Ticket Reference: https://c.na7.visual.force.com/apex/Case_View?id=500A00000078xLk&sfdc.override=1
Steps to Reproduce: Run the project attached with BRMS 5.1 runtime
Workaround Description:  - Define as system property drools.dialect.mvel.strict=false
securitylevel_name: Public

Unable to build expression for 'from' if used generic types on collections.
The exception (below) is fired:

"Unable to build expression for 'from' : sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.Class 'input.payrollComponentsForNiLetter.entrySet' : [Rule name='Basic Pay for NI aggregation']

java.lang.IllegalArgumentException: Could not parse knowledge.
	at com.sample.DroolsTest.readKnowledgeBase(DroolsTest.java:68)
	at com.sample.DroolsTest.main(DroolsTest.java:31)"

The attached project demonstrates the error.
The same is working on Drools 5.1.1 community

Comment 1 Alessandro Lazarotti 2011-04-11 20:46:46 UTC
Adding drools-clips.jar (like made in drools-5.1.1 community)into classpath it works.

Comment 2 Alessandro Lazarotti 2011-04-11 20:49:49 UTC
Additional note: I don't know why, but putting drools-clips above drools-compiler in classpath order, the project uses drools-clips and work fine, but if you put drools-compiler above drools-clips in classpath order, you have the exception

Comment 3 Tihomir Surdilovic 2011-04-11 21:49:25 UTC
The only thing I can think of why drools-clips would make any difference here is that it brings in a different version of mvel with it that gets loaded before the one in the classpath already. Can you please verify?

Comment 4 Alessandro Lazarotti 2011-04-11 22:01:17 UTC
No, there is not a differente mvel version. I see the problem, drools-clips sets in classpath:
"drools.dialect.mvel.strict = false" (look the MANIFEST/drools.default.packagebuilder.conf on drools-clips.jar)

Adding drools.dialect.mvel.strict = false as system properties the sample attached works without drools-clips.jar in classpath. I think it would be better if it working out-of-box(strict false by default?)




Comment 5 Tihomir Surdilovic 2011-04-11 22:55:04 UTC
we want to enforce static typing (because it equals less errors) as such having drools.dialect.mvel.strict set to true by default is the correct way to go. 

Comment 6 Alessandro Lazarotti 2011-04-12 00:36:48 UTC
Workaround Description: Removed: Remove the generic types Added:  - Define as system property drools.dialect.mvel.strict=false


Comment 7 Alessandro Lazarotti 2011-04-12 00:37:36 UTC
ok, for now I updated the workaround to "Define as system property drools.dialect.mvel.strict=false"

Comment 8 Tihomir Surdilovic 2011-04-12 00:53:19 UTC
Don't think there are any code changes necessary for this Jira. I do see a need to document this, so if you want please change it to a documentation Jira, assign to Darrin Mison with description of what should be added to docs for BRMS 5.2 (let me know if you need help with that). Otherwise I think this can be closed.

Comment 9 Anne-Louise Tangring 2011-05-31 19:14:30 UTC
Tiho, Please provide contents and then hand over to Lee C. for doc.

Comment 10 Rick Wagner 2011-08-25 18:16:58 UTC
GSS prioritizes this 'medium'.  Customer is slow to respond, it's an old case.

Comment 11 lcarlon 2011-09-15 03:39:26 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
Building expressions for 'from' does not working when using generic types with collections. The workaround is to define as system property drools.dialect.mvel.strict=false". This issue will be resolved in a future release.

Comment 12 lcarlon 2011-09-30 03:07:55 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Building expressions for 'from' does not working when using generic types with collections. The workaround is to define as system property drools.dialect.mvel.strict=false". This issue will be resolved in a future release.+Building expressions for 'from' does not working when using generic types with collections. The workaround is to define as system property drools.dialect.mvel.strict=false".

Comment 13 lcarlon 2011-10-05 03:08:20 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Building expressions for 'from' does not working when using generic types with collections. The workaround is to define as system property drools.dialect.mvel.strict=false".+Building expressions for 'from' does not working when using generic types with collections. The workaround is to define a system property drools.dialect.mvel.strict=false".

Comment 14 lcarlon 2011-10-05 04:22:03 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Building expressions for 'from' does not working when using generic types with collections. The workaround is to define a system property drools.dialect.mvel.strict=false".+Building expressions for 'from' does not work when using generic types with collections. The workaround is to define a system property drools.dialect.mvel.strict=false".

Comment 19 lcarlon 2012-05-30 05:48:44 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1 +1 @@
-Building expressions for 'from' does not work when using generic types with collections. The workaround is to define a system property drools.dialect.mvel.strict=false".+Building expressions for 'from' did not work when using generic types with collections in BRMS 5.2.0. This issue is not present in BRMS 5.3.0.