<br>&nbsp;&nbsp; Carl,<br><br>&nbsp;&nbsp; Drools 4.0.x is indeed JDK 1.4+ compatible.<br><br>&nbsp;&nbsp; Can you please share your complete stack trace?<br>&nbsp;&nbsp; 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>
 &nbsp; &nbsp;at AL_Calculation.Rule_ setSelecte_10_0.consequence(Unknown Source)<br><br>&nbsp;&nbsp; Says that the problem is happening the consequence of a rule called something like:<br><br>&quot;setSelecte_10_0&quot;<br>

</div><br>&nbsp;&nbsp; Where _ is any non-valid character for classnames.<br><br>&nbsp;&nbsp; That is not the rule you showed before.<br><br>&nbsp;&nbsp; []s<br>&nbsp;&nbsp; Edson<br><br><br><div class="gmail_quote">2008/5/8 Cabou, Carl &lt;<a href="mailto:Carl.Cabou@prima-solutions.com">Carl.Cabou@prima-solutions.com</a>&gt;:<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&#39;origine-----<br>
De&nbsp;: <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é&nbsp;: jeudi 8 mai 2008 10:41<br>
<div><div></div><div class="Wj3C7c">À&nbsp;: Rules Users List<br>
Objet&nbsp;: RE: [rules-users] Newbie question / NoSuchMethodError error<br>
<br>
Thomas,<br>
<br>
I can not move the headings since I do receive &quot;0 - 50&quot; as a String and then I have to return an Integer.<br>
<br>
I&#39;ve made a little program beside this to test my rule, I&#39;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&#39;origine-----<br>
De&nbsp;: <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é&nbsp;: jeudi 8 mai 2008 10:20<br>
À&nbsp;: &#39;Rules Users List&#39;<br>
Objet&nbsp;: 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&#39;t do selected == &quot;0 - 50&quot; because &quot;0 - 50&quot; 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&#39;s an example:<br>
<br>
daysBeforeSummons &gt;= $1, daysBeforeSummons &lt;= $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>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;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>
 &nbsp; &nbsp;at AL_Calculation.Rule_ setSelecte_10_0.consequence(Unknown Source)<br>
<br>
There is a missing &quot;d&quot; before &quot;_10&quot; ...<br>
<br>
Carl<br>
<br>
<br>
-----Message d&#39;origine-----<br>
De&nbsp;: <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é&nbsp;: jeudi 8 mai 2008 09:35<br>
À&nbsp;: &#39;Rules Users List&#39;<br>
Objet&nbsp;: RE: [rules-users] Newbie question / NoSuchMethodError error<br>
<br>
Yep. Post the code for setSelected(). I&#39;m guessing it takes an Integer or<br>
int and you&#39;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&#39;m new to Drools and I&#39;ve written a decision table based rule using excel.<br>
The rule validates ok and I&#39;ve deployed my package fine.<br>
<br>
I&#39;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 &quot;0 - 50&quot;&nbsp;:<br>
<br>
...<br>
StatelessSession statelessSession = rb.newStatelessSession(); Data data=new<br>
Data(); data.setSelected(&quot;0 - 50&quot;); 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&#39;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 &quot;setCalculateRate_11&quot;<br>
<br>
 &nbsp; &nbsp; &nbsp; &nbsp;salience 65525<br>
 &nbsp; &nbsp; &nbsp; &nbsp;when<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Data(selected == &quot;0 - 50&quot;)<br>
 &nbsp; &nbsp; &nbsp; &nbsp;then<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;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>