<br clear="all"><font face="Tahoma" size="2">
<div>I meet working a simple example to interiorize with jboss rules and I obtain the following error:</div>
<div> </div>
<div><font color="#ff0000" size="2">
<p align="left">Exception in thread "main" org.drools.rule.InvalidRulePackage: Unable to create Field Extractor for 'CantSegundos' : [Rule name=Valida Duracion nula, agendaGroup=MAIN, salience=0, no-loop=false]
</p>
<p align="left"></p></font><u><font color="#000080" size="2">org.drools.RuntimeDroolsException</font></u></div></font><font color="#ff0000" size="2">: </font><u><font color="#000080" size="2">org.drools.RuntimeDroolsException
</font></u><font color="#ff0000" size="2">: java.lang.NullPointerExceptionUnable to create Field Extractor for 'CantSegundos' : [Rule name=valida Duracion , agendaGroup=MAIN, salience=0, no-loop=false]</font><u><font color="#000080" size="2">
<p align="left">org.drools.RuntimeDroolsException</p></font></u><font color="#ff0000" size="2">: </font><u><font color="#000080" size="2">org.drools.RuntimeDroolsException</font></u><font color="#ff0000" size="2">: </font>
<u><font color="#000080" size="2">java.lang.NullPointerException</font></u><font color="#ff0000" size="2">
<p align="left">at org.drools.rule.Package.checkValidity(</p></font><u><font color="#000080" size="2">Package.java:408</font></u><font color="#ff0000" size="2">)
<p align="left">at org.drools.common.AbstractRuleBase.addPackage(</p></font><u><font color="#000080" size="2">AbstractRuleBase.java:288</font></u><font color="#ff0000" size="2">)
<p align="left">at prototipo.Prueba.main(</p></font><u><font color="#000080" size="2">Prueba.java:27</font></u><font color="#ff0000" size="2">)</font>
<p align="left"><font color="#ff0000" size="2"><font color="#000000">the class main is:</font></font></p><font color="#ff0000" size="2"><font color="#000000"><b><font color="#7f0055" size="2">
<p align="left">public</p></font></b></font><font size="2"> </font><b><font color="#7f0055" size="2">static</font></b></font><font size="2"> </font><b><font color="#7f0055" size="2">final</font></b><font size="2"> </font>
<b><font color="#7f0055" size="2">void</font></b><font size="2"> main(String[] args) </font><b><font color="#7f0055" size="2">throws</font></b><font size="2"> Exception {
<p align="left"></p></font><b><font color="#7f0055" size="2"> final</font></b><font size="2"> PackageBuilder builder = </font><b><font color="#7f0055" size="2">new</font></b><font size="2"> PackageBuilder();
<p align="left"><strong> </strong>builder.addPackageFromDrl( </p></font><b><font color="#7f0055" size="2">new</font></b><font size="2"> InputStreamReader( Prueba.</font><b><font color="#7f0055" size="2">class</font>
</b><font size="2">.getResourceAsStream( </font><font color="#2a00ff" size="2">"regla.drl"</font><font size="2"> ) ) );</font><font size="2">
<p align="left"></p>
<p align="left"></p></font><b><font color="#7f0055" size="2"> final</font></b><font size="2"> RuleBase ruleBase = RuleBaseFactory.<i>newRuleBase</i>();
<p align="left"><strong> ruleBase</strong>.addPackage( builder.getPackage() );</p>
<p align="left"></p>
<p align="left"></p></font><b><font color="#7f0055" size="2"> final</font></b><font size="2"> StatefulSession session = ruleBase.newStatefulSession();
<p align="left"></p>
<p align="left"><strong> </strong>Integer segundos = </p></font><b><font color="#7f0055" size="2">new</font></b><font size="2"> Integer(5);
<p align="left"></p>
<p align="left"><strong> </strong>validaciones valida = </p></font><b><font color="#7f0055" size="2">new</font></b><font size="2"> validaciones();
<p align="left"><strong> </strong>valida.setCantSegundos(segundos);</p>
<p align="left"><strong> </strong>session.insert( valida);</p>
<p align="left"><strong> </strong>session.fireAllRules();</p>
<p align="left"><strong>in the rules is:</strong></p><strong><b><font color="#960000" size="2">
<p align="left">package</p></font></b></strong></font><font size="2"> prototipo
<p align="left"></p>
<p align="left"></p></font><b><font color="#960000" size="2">import</font></b><font size="2"> prototipo.validaciones;
<p align="left"></p>
<p align="left"></p></font><b><font color="#960000" size="2">rule</font></b><font size="2"> </font><font color="#008000" size="2">"Valida Duracion nula"
<p align="left"></p></font><b><font color="#960000" size="2">when
<p align="left"></p></font></b><font size="2"> v : validaciones(CantSegundos == 0)
<p align="left"></p>
<p align="left"></p></font><b><font color="#960000" size="2">then</font></b><font size="2">
<p align="left"> v.setResultado(</p></font><font color="#008000" size="2">"I"</font><font size="2">);
<p align="left"> System.out.println( </p></font><font color="#008000" size="2">"obtenemos"</font><font size="2"> + v.getResultado() );
<p align="left"></p>
<p align="left"></p></font><b><font color="#960000" size="2">end
<p align="left"></p></font></b><b><font color="#960000" size="2">rule</font></b><font size="2"> </font><font color="#008000" size="2">"valida Duracion "</font><font size="2"></font><b><font color="#960000" size="2">
when
<p align="left"></p></font></b><font size="2"> v : validaciones(CantSegundos > 0)
<p align="left"></p></font><b><font color="#960000" size="2">then</font></b><font size="2">
<p align="left"> v.setResultado(</p></font><font color="#008000" size="2">"S"</font><font size="2">);
<p align="left"> System.out.println( </p></font><font color="#008000" size="2">"obtenemos"</font><font size="2"> + v.getResultado());
<p align="left"></p>
<p align="left"></p></font><b><font color="#960000" size="2">end</font></b><strong><font face="Tahoma" size="2"><font face="Tahoma" size="2">
<p>Thank you for helping me.</p></font>
<p align="left"></p></font></strong><font color="#3f7f5f" size="2"><strong></strong></font><font size="2">
<p align="left"></p>
<p align="left"></p></font>
<p align="left"><font color="#ff0000" size="2"><font color="#000000"><strong></strong></font></font> </p>
<p align="left"><font color="#ff0000" size="2"><font color="#000000"></font> </font></p>