Bug 779537 (SOA-1914)

Summary: org.drools.RuntimeDroolsException: unable to determine ValueType for Class [class MyClass] on IBM JVM with JIT enabled
Product: [JBoss] JBoss Enterprise SOA Platform 4 Reporter: Tihomir Surdilovic <tsurdilo>
Component: JBoss RulesAssignee: Tihomir Surdilovic <tsurdilo>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: high Docs Contact:
Priority: high    
Version: 4.3 GA, 4.2 CP03, 4.3 CP01, 4.2 CP04, 4.3 CP02CC: dlesage
Target Milestone: ---   
Target Release: 4.3 CP04 ER1   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-1914
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2010-03-24 12:21:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Deadline: 2010-03-08   

Description Tihomir Surdilovic 2010-02-02 21:31:32 UTC
Date of First Response: 2010-02-04 05:07:57
Help Desk Ticket Reference: https://enterprise.redhat.com/issue-tracker/442503
project_key: SOA

On IBM JVM with JIT enabled using Drools 4.0.7 often the following exception occurs:

org.drools.RuntimeDroolsException: unable to determine ValueType for Class [class MyClass]
       at org.drools.base.ValueType.determineValueType(ValueType.java:222)
       at org.drools.base.ClassObjectType.<init>(ClassObjectType.java:56)
       at org.drools.reteoo.Rete$ClassObjectTypeConf.<init>(Rete.java:442)
       at org.drools.reteoo.Rete.assertObject(Rete.java:152)
...

We have determined that in the IBM JVN with JIT enabled, the expression "XXXX instanceof Object" fails sometimes. On the other hand expression "XXXX isAssignableFrom(YYYYYY) ... " works as expected. The code change required here is in org.drools.base.ValueType change:

...
} else if ( clazz instanceof Object ) {
return ValueType.OBJECT_TYPE;
...

to

...
else if ( Object.class.isAssignableFrom( clazz ) ) {
          return ValueType.OBJECT_TYPE;
...

Comment 1 Tihomir Surdilovic 2010-02-02 21:37:42 UTC
Link: Added: This issue depends JBRULES-2421


Comment 2 Darran Lofthouse 2010-02-04 10:07:57 UTC
Re-opening as we still need to track the component upgrade stage of Drools so that the fix is incorporated in the release.


Comment 3 Anne-Louise Tangring 2010-02-25 16:12:11 UTC
Approved but not required for SOA 4.3 CP03. If it is not resolved by Due Date, it will be moved out.

Comment 4 trev 2010-03-05 16:31:40 UTC
  fix confirmed in http://anonsvn.jboss.org/repos/labs/labs/jbossrules/soa_branches/SOA_JDK6/drools-core/src/main/java/org/drools/base/ValueType.java, will create tag and include in this release

Comment 5 David Le Sage 2010-03-15 00:20:22 UTC
Draft text for the Resolved Issues section of the Release Notes:


https://jira.jboss.org/jira/browse/JBRULES-2421

    If the user was running JBoss Rules 4.0.7 on an IBM virtual machine with JIT enabled, an
    org.drools.RuntimeDroolsException: unable to determine ValueType for
    Class exception would occur.. This was because of a problem with regard to the way in which
    XXXX instanceof Object expressions were handled.

    The code in the org.drools.base.ValueType class which handles these expressions has
    been modified. As a result, JBoss Rules can now be run on IBM virtual machines with JIT enabled,
    without it causing exceptions.


Comment 6 Martin Vecera 2010-03-24 12:21:33 UTC
Verified 4.3.CP03 ER1