<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
The consequence will be null if the java you used is invalid. When you
create the Package check the errors before adding it to the rule base
as you can get a lot more info. In fact thats good "best practice"
always verify that the package errors are emtpy before attempting to
use the package.<br>
<br>
Mark<br>
Manukyan, Sergey wrote:
<blockquote
 cite="mid:4E03EDD62CB1CB4599E6BD71DBEDFD20027E3A7A@usmitry-exm1.corp.lear.com"
 type="cite">
  <meta http-equiv="Content-Type" content="text/html; ">
  <meta name="Generator" content="Microsoft Word 11 (filtered)">
  <style>
<!--
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
p
        {margin-right:0in;
        margin-left:0in;
        font-size:12.0pt;
        font-family:"Times New Roman";}
span.EmailStyle17
        {font-family:Arial;
        color:windowtext;}
span.EmailStyle19
        {font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
  </style>
  <div class="Section1">
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Hi,</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">I am using
JBoss Rules 4.0.0.11754MR2 in
an RAD 7.0 (Eclipse 3.2) environment.</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Cannot make
it work, even examples&#8230;</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Here is a
message produces on all rules:</span></font><font color="red"
 face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;"> The
rule called </span></font><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&lt;here
goes rule name&gt;</span></font><font color="red" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;"> is
not valid. Check for compile errors reported.</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Here is a
full stack trace:</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>
  <p class="MsoNormal" style=""><font color="red" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">Exception
in thread "main" </span></font><u><font color="navy" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: navy;">java.lang.IllegalArgumentException</span></font></u><font
 color="red" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">: The
rule called Hello World is not valid. Check for compile errors
reported.</span></font></p>
  <p class="MsoNormal" style=""><font color="red" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
at
org.drools.common.AbstractRuleBase.addRule(</span></font><u><font
 color="navy" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: navy;">AbstractRuleBase.java:363</span></font></u><font
 color="red" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">)</span></font></p>
  <p class="MsoNormal" style=""><font color="red" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
at
org.drools.reteoo.ReteooRuleBase.addRule(</span></font><u><font
 color="navy" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: navy;">ReteooRuleBase.java:263</span></font></u><font
 color="red" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">)</span></font></p>
  <p class="MsoNormal" style=""><font color="red" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
at
org.drools.common.AbstractRuleBase.addPackage(</span></font><u><font
 color="navy" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: navy;">AbstractRuleBase.java:293</span></font></u><font
 color="red" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">)</span></font></p>
  <p class="MsoNormal" style=""><font color="red" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
at
org.drools.examples.HelloWorldExample.readRule(</span></font><u><font
 color="navy" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: navy;">HelloWorldExample.java:72</span></font></u><font
 color="red" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">)</span></font></p>
  <p class="MsoNormal" style=""><font color="red" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
at
org.drools.examples.HelloWorldExample.main(</span></font><u><font
 color="navy" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: navy;">HelloWorldExample.java:21</span></font></u><font
 color="red" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: red;">)</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">After
digging it further I found that in
Rule class method isValid is being called defiend as followes:</span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;</span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#7f0055" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">public</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><b><font
 color="#7f0055" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">boolean</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> <span
 style="background: silver none repeat scroll 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;">isValid</span>()
{</span></font></p>
  <p class="MsoNormal" style=""><font face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;</span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#7f0055" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">if</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> ( </span></font><b><font
 color="#7f0055" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">this</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.</span></font><font
 color="#0000c0" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">consequence</span></font><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> ==
  </span></font><b><font color="#7f0055" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">null</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> ||
!isSemanticallyValid() ) {</span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#7f0055" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">return</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><b><font
 color="#7f0055" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">false</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
}</span></font></p>
  <p class="MsoNormal" style=""><font face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;;">&nbsp;</span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  </span></font><b><font color="#7f0055" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">return</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;"> </span></font><b><font
 color="#7f0055" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">true</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">;</span></font></p>
  <p class="MsoNormal" style=""><font color="black" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">&nbsp;&nbsp;&nbsp;
}</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">The debugger
shows that </span></font><b><font color="#7f0055" face="Courier New"
 size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(127, 0, 85); font-weight: bold;">this</span></font></b><font
 color="black" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: black;">.</span></font><font
 color="#0000c0" face="Courier New" size="2"><span
 style="font-size: 10pt; font-family: &quot;Courier New&quot;; color: rgb(0, 0, 192);">consequence
  </span></font><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">is null
always! So rules
are always not valid.</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Anyone saw
this problem? Any idea how to
resolve it?</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">Thanks a lot!</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">-Sergey</span></font></p>
  <p class="MsoNormal"><font color="navy" face="Arial" size="2"><span
 style="font-size: 10pt; font-family: Arial; color: navy;">&nbsp;</span></font></p>
  </div>
  <table>
    <tbody>
      <tr>
        <td bgcolor="#ffffff"><font color="#000000">**********************<br>
** LEGAL DISCLAIMER **<br>
**********************<br>
        <br>
This E-mail message and any attachments may contain <br>
legally privileged, confidential or proprietary <br>
information. If you are not the intended recipient(s),<br>
or the employee or agent responsible for delivery of <br>
this message to the intended recipient(s), you are <br>
hereby notified that any dissemination, distribution <br>
or copying of this E-mail message is strictly <br>
prohibited. If you have received this message in <br>
error, please immediately notify the sender and <br>
delete this E-mail message from your computer.<br>
        </font></td>
      </tr>
    </tbody>
  </table>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-users">https://lists.jboss.org/mailman/listinfo/rules-users</a>
  </pre>
</blockquote>
<br>
</body>
</html>