<br> Carl,<br><br> Drools 4.0.x is indeed JDK 1.4+ compatible.<br><br> Can you please share your complete stack trace?<br> The snippet you showed:<br><br>
Caused by: java.lang.NoSuchMethodError: java.lang.Integer.valueOf(I<div id="1fgk" class="ArwC7c ckChnd">)Ljava/lang/Integer;<br>
at AL_Calculation.Rule_ setSelecte_10_0.consequence(Unknown Source)<br><br> Says that the problem is happening the consequence of a rule called something like:<br><br>"setSelecte_10_0"<br>
</div><br> Where _ is any non-valid character for classnames.<br><br> That is not the rule you showed before.<br><br> []s<br> Edson<br><br><br><div class="gmail_quote">2008/5/8 Cabou, Carl <<a href="mailto:Carl.Cabou@prima-solutions.com">Carl.Cabou@prima-solutions.com</a>>:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">So Does anybody know how I can make Drools 4 API works in JAVA1.4 ??<br>
<br>
Carl<br>
<br>
-----Message d'origine-----<br>
De : <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>] De la part de Cabou, Carl<br>
Envoyé : jeudi 8 mai 2008 10:41<br>
<div><div></div><div class="Wj3C7c">À : Rules Users List<br>
Objet : RE: [rules-users] Newbie question / NoSuchMethodError error<br>
<br>
Thomas,<br>
<br>
I can not move the headings since I do receive "0 - 50" as a String and then I have to return an Integer.<br>
<br>
I've made a little program beside this to test my rule, I've launched it using java5, it worked fine, but it does crash using java1.4.<br>
I just found out the Integer.valueOf(int) is a new feature of java5.<br>
<br>
So I guess I must try to run my web application using java5.<br>
<br>
Carl.<br>
<br>
-----Message d'origine-----<br>
De : <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a> [mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>] De la part de Hehl, Thomas<br>
Envoyé : jeudi 8 mai 2008 10:20<br>
À : 'Rules Users List'<br>
Objet : RE: [rules-users] Newbie question / NoSuchMethodError error<br>
<br>
No, really, java uses the valueOf methods internally to try to convert the<br>
object specified (a String) into an Integer so it can do the comparison. You<br>
can't do selected == "0 - 50" because "0 - 50" is a String and you cant<br>
compare it to an Integer.<br>
<br>
So what are you trying to do? If you want selected to be in the range<br>
between 0 and 50 inclusive, then you need to change the heading in your<br>
decision table. Here's an example:<br>
<br>
daysBeforeSummons >= $1, daysBeforeSummons <= $2<br>
<br>
and then you specify the data in your column as 0,50.<br>
<br>
Good luck!<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>] On Behalf Of Cabou, Carl<br>
Sent: Thursday, May 08, 2008 10:12 AM<br>
To: Rules Users List<br>
Subject: RE: [rules-users] Newbie question / NoSuchMethodError error<br>
<br>
Thank you for answering Thomas.<br>
<br>
Here is the code below, nothing fancy:<br>
<br>
<br>
public void setSelected (Integer calculatedSetSelected)<br>
{<br>
this. calculatedSetSelected = calculatedSetSelected;<br>
}<br>
<br>
In fact, the problem IS that it is taking an Integer and some Drools<br>
Internal method want to convert it using Integer.valueOf, but there is no<br>
Integer.valueOf taking Integer.<br>
<br>
There is something weird, in the stack trace, I get :<br>
<br>
Caused by: java.lang.NoSuchMethodError:<br>
java.lang.Integer.valueOf(I)Ljava/lang/Integer;<br>
at AL_Calculation.Rule_ setSelecte_10_0.consequence(Unknown Source)<br>
<br>
There is a missing "d" before "_10" ...<br>
<br>
Carl<br>
<br>
<br>
-----Message d'origine-----<br>
De : <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>] De la part de Hehl, Thomas<br>
Envoyé : jeudi 8 mai 2008 09:35<br>
À : 'Rules Users List'<br>
Objet : RE: [rules-users] Newbie question / NoSuchMethodError error<br>
<br>
Yep. Post the code for setSelected(). I'm guessing it takes an Integer or<br>
int and you're passing it a String.<br>
<br>
-----Original Message-----<br>
From: <a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a><br>
[mailto:<a href="mailto:rules-users-bounces@lists.jboss.org">rules-users-bounces@lists.jboss.org</a>] On Behalf Of Cabou, Carl<br>
Sent: Thursday, May 08, 2008 9:23 AM<br>
To: <a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
Subject: [rules-users] Newbie question / NoSuchMethodError error<br>
<br>
Greetings,<br>
<br>
I'm new to Drools and I've written a decision table based rule using excel.<br>
The rule validates ok and I've deployed my package fine.<br>
<br>
I've written a piece of code to test my rules, I want to set the<br>
calculatedRate to 125 when I get selected field equal to "0 - 50" :<br>
<br>
...<br>
StatelessSession statelessSession = rb.newStatelessSession(); Data data=new<br>
Data(); data.setSelected("0 - 50"); statelessSession.execute(data); // set<br>
private Integer field ...<br>
<br>
When I run the code I get a exeption :<br>
<br>
java.lang.NoSuchMethodError: java.lang.Integer.valueOf(I)Ljava/lang/Integer;<br>
<br>
I don't understand why Drools tries to convert to Integer something which is<br>
already Integer !!!!<br>
<br>
-----------<br>
Here is the rules code.<br>
<br>
<br>
rule "setCalculateRate_11"<br>
<br>
salience 65525<br>
when<br>
Data(selected == "0 - 50")<br>
then<br>
object.setCalculatedRate(125);<br>
end<br>
<br>
<br>
--------------<br>
The CalculatedRate field is a java.lang.Integer object.<br>
<br>
Does anybody has an idea ??<br>
<br>
Regards,<br>
Carl.<br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
<br>
<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br> Edson Tirelli<br> JBoss Drools Core Development<br> Office: +55 11 3529-6000<br> Mobile: +55 11 9287-5646<br> JBoss, a division of Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a>