]
Mark Proctor updated JBRULES-1433:
----------------------------------
Summary: ClassCastException comparing BigDecimals - MVEL is narrowing the numeric
value (was: java.lang.ClassCastException comparing BigDecimals (compareTo))
ClassCastException comparing BigDecimals - MVEL is narrowing the
numeric value
------------------------------------------------------------------------------
Key: JBRULES-1433
URL:
http://jira.jboss.com/jira/browse/JBRULES-1433
Project: JBoss Drools
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Reteoo, Rule Assemply/SPI
Affects Versions: 4.0.4, 4.0.3
Environment: java.runtime.name = Java(TM) SE Runtime Environment
sun.boot.library.path = C:\Archivos de programa\Java\jre1.6.0_03\bin
java.vm.version = 1.6.0_03-b05
java.vm.vendor = Sun Microsystems Inc.
java.vendor.url =
http://java.sun.com/
path.separator = ;
java.vm.name = Java HotSpot(TM) Client VM
file.encoding.pkg = sun.io
user.country = ES
sun.java.launcher = SUN_STANDARD
sun.os.patch.level = Service Pack 2
java.vm.specification.name = Java Virtual Machine Specification
java.runtime.version = 1.6.0_03-b05
java.awt.graphicsenv = sun.awt.Win32GraphicsEnvironment
java.endorsed.dirs = C:\Archivos de programa\Java\jre1.6.0_03\lib\endorsed
os.arch = x86
java.io.tmpdir = C:\DOCUME~1\Tito\CONFIG~1\Temp\
line.separator =
java.vm.specification.vendor = Sun Microsystems Inc.
user.variant =
os.name = Windows XP
sun.jnu.encoding = Cp1252
java.library.path = C:\Archivos de
programa\Java\jre1.6.0_03\bin;.;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Archivos
de programa\Java\jre1.6.0_03\bin\client;C:\Archivos de
programa\Java\jre1.6.0_03\bin;C:\Archivos de
programa\Java\jre1.6.0_03\bin\client;C:\Archivos de
programa\Java\jre1.6.0_03\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Archivos
de programa\ATI Technologies\ATI Control Panel;C:\Java\maven-2.0.8\bin;C:\Archivos de
programa\Java\jdk1.6.0_03\bin;c:\Archivos de programa\Microsoft SQL
Server\90\Tools\binn\;C:\Archivos de programa\Microsoft SQL
Server\80\Tools\BINN;C:\UnixUtils\usr\local\wbin;C:\Archivos de programa\MySQL\MySQL
Server 5.0\bin
java.specification.name = Java Platform API Specification
java.class.version = 50.0
sun.management.compiler = HotSpot Client Compiler
os.version = 5.1
user.home = C:\Documents and Settings\Tito
user.timezone =
java.awt.printerjob = sun.awt.windows.WPrinterJob
file.encoding = Cp1252
java.specification.version = 1.6
user.name = Tito
java.class.path = D:\workspaces\ruleTest\target\classes;C:\Documents and
Settings\Tito\.m2\repository\org\drools\drools-compiler\4.0.4\drools-compiler-4.0.4.jar;C:\Documents
and
Settings\Tito\.m2\repository\org\drools\drools-core\4.0.4\drools-core-4.0.4.jar;C:\Documents
and Settings\Tito\.m2\repository\org\mvel\mvel14\1.2.21\mvel14-1.2.21.jar;C:\Documents and
Settings\Tito\.m2\repository\org\antlr\antlr-runtime\3.0\antlr-runtime-3.0.jar;C:\Documents
and
Settings\Tito\.m2\repository\org\eclipse\jdt\core\3.2.3.v_686_R32x\core-3.2.3.v_686_R32x.jar;C:\Documents
and Settings\Tito\.m2\repository\janino\janino\2.5.10\janino-2.5.10.jar;C:\Documents and
Settings\Tito\.m2\repository\xml-apis\xml-apis\1.0.b2\xml-apis-1.0.b2.jar;C:\Documents and
Settings\Tito\.m2\repository\xerces\xercesImpl\2.4.0\xercesImpl-2.4.0.jar
java.vm.specification.version = 1.0
sun.arch.data.model = 32
java.home = C:\Archivos de programa\Java\jre1.6.0_03
java.specification.vendor = Sun Microsystems Inc.
user.language = es
awt.toolkit = sun.awt.windows.WToolkit
java.vm.info = mixed mode, sharing
java.version = 1.6.0_03
java.ext.dirs = C:\Archivos de
programa\Java\jre1.6.0_03\lib\ext;C:\WINDOWS\Sun\Java\lib\ext
sun.boot.class.path = C:\Archivos de
programa\Java\jre1.6.0_03\lib\resources.jar;C:\Archivos de
programa\Java\jre1.6.0_03\lib\rt.jar;C:\Archivos de
programa\Java\jre1.6.0_03\lib\sunrsasign.jar;C:\Archivos de
programa\Java\jre1.6.0_03\lib\jsse.jar;C:\Archivos de
programa\Java\jre1.6.0_03\lib\jce.jar;C:\Archivos de
programa\Java\jre1.6.0_03\lib\charsets.jar;C:\Archivos de
programa\Java\jre1.6.0_03\classes
java.vendor = Sun Microsystems Inc.
file.separator = \
java.vendor.url.bug =
http://java.sun.com/cgi-bin/bugreport.cgi
sun.cpu.endian = little
sun.io.unicode.encoding = UnicodeLittle
sun.desktop = windows
sun.cpu.isalist = pentium_pro+mmx pentium_pro pentium+mmx pentium i486 i386 i86
Reporter: José Arrarte
Assigned To: Mark Proctor
Fix For: 5.0.0-M1
Attachments: ruleTest.zip
Firing this rule:
rule "Test Rule"
when
$dec : java.math.BigDecimal() from java.math.BigDecimal.TEN;
eval( $dec.compareTo(java.math.BigDecimal.ONE) > 0 )
then
System.out.println("OK!");
end
Returns this error:
org.drools.RuntimeDroolsException: java.lang.ClassCastException: java.lang.Integer cannot
be cast to java.math.BigDecimal
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:76)
at org.drools.reteoo.EvalConditionNode.assertTuple(EvalConditionNode.java:145)
at
org.drools.reteoo.SingleTupleSinkAdapter.propagateAssertTuple(SingleTupleSinkAdapter.java:20)
at org.drools.reteoo.FromNode.assertTuple(FromNode.java:90)
at
org.drools.reteoo.SingleTupleSinkAdapter.createAndPropagateAssertTuple(SingleTupleSinkAdapter.java:55)
at org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:116)
at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:22)
at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:153)
at org.drools.reteoo.Rete.assertObject(Rete.java:175)
at org.drools.reteoo.ReteooRuleBase.assertObject(ReteooRuleBase.java:192)
at
org.drools.reteoo.ReteooWorkingMemory$WorkingMemoryReteAssertAction.execute(ReteooWorkingMemory.java:179)
at
org.drools.common.AbstractWorkingMemory.executeQueuedActions(AbstractWorkingMemory.java:1315)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:462)
at org.drools.common.AbstractWorkingMemory.fireAllRules(AbstractWorkingMemory.java:433)
at com.sample.DroolsTest.main(DroolsTest.java:33)
Caused by: java.lang.ClassCastException: java.lang.Integer cannot be cast to
java.math.BigDecimal
at
com.sample.Rule_Test_Rule_0Eval0Invoker.evaluate(Rule_Test_Rule_0Eval0Invoker.java:12)
at org.drools.rule.EvalCondition.isAllowed(EvalCondition.java:72)
... 14 more
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: