<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body text="#000000" bgcolor="#FFFFFF">
    <div class="moz-cite-prefix">Op 24/07/2013 14:24, Davide Sottara
      schreef:<br>
    </div>
    <blockquote cite="mid:51EFC77E.50703@gmail.com" type="cite">
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <div class="moz-cite-prefix">Two clarifications first:<br>
        <br>
        1) Which version are you using?<br>
      </div>
    </blockquote>
    I am using version 5.5<br>
    <blockquote cite="mid:51EFC77E.50703@gmail.com" type="cite">
      <div class="moz-cite-prefix"> 2) Is TrackerUpdate a static class
        inside TrackerRemote? <br>
        In case, could you post the exact "import" statements you are
        using?<br>
        <br>
      </div>
    </blockquote>
    the TrackerUpdate is not static, but it's a class defined within the
    TrackerUpdate class.<br>
    <i><small>public class TrackerRemote<br>
        ....<br>
        &nbsp;public class TrackerUpdate {<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public java.util.Date msg_time;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public int sensor;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public double[] pos;<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public double[] quat;<br>
        <br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public TrackerUpdate() { /* compiled code */ }<br>
        &nbsp;&nbsp;&nbsp; }</small></i><br>
    <br>
    The full imports and rule is:<br>
    package derooms.be.testRule<br>
    import derooms.be.server.predefinedtypes.Event;<br>
    import derooms.be.test.Message;<br>
    import vrpn.TrackerRemote;<br>
    <i><small><br>
        rule "TrackerRemote.TrackerUpdate"<br>
        &nbsp;&nbsp;&nbsp; when<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; message:TrackerRemote.TrackerUpdate()<br>
        &nbsp;&nbsp;&nbsp; then<br>
        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Tracker: " + message);<br>
        end</small></i><br>
    <br>
    Sorry that I didn't sent it earlier, I actually sent this e-mail
    already but it didn't came through.<br>
    <br>
    B<br>
    <br>
    <blockquote cite="mid:51EFC77E.50703@gmail.com" type="cite">
      <div class="moz-cite-prefix"> Thanks<br>
        Davide<br>
        <br>
        On 07/24/2013 02:14 PM, De Rooms Brecht wrote:<br>
      </div>
      <blockquote cite="mid:51EFC517.1060508@vub.ac.be" type="cite">
        <meta http-equiv="content-type" content="text/html;
          charset=ISO-8859-1">
        Dear rules users,<br>
        <br>
        I am currently writing my own Drools-server since I wanted more
        control than the drools-execution server (and it never worked
        very well here) where I can send rules/facts over
        JMS/AQMP/STOMP. Rules which are sent are saved on the
        server-side in DRL files that are monitored. That way, I can
        debug easily by changing the sent files. However, when I sent
        the following code, the agent does not provide me with an error
        message at all and hangs: <br>
        <small><i><br>
          </i><i>rule "TrackerRemote.TrackerUpdate"</i><i><br>
          </i><i>&nbsp;&nbsp;&nbsp; when</i><i><br>
          </i><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; message:TrackerRemote.TrackerUpdate()</i><i><br>
          </i><i>&nbsp;&nbsp;&nbsp; then</i><i><br>
          </i><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Tracker: " + message);</i><i><br>
          </i><i>end</i></small><br>
        <br>
        at first I thought it was because TrackerRemote.TrackerUpdate is
        not in that package anymore and thus unknown so I tried to send
        the rule listed below which gives me the nice and expected
        error:<br>
        &nbsp;&nbsp;&nbsp; Unable to resolve ObjectType 'NotExistingType' : [Rule
        name='Foo']<br>
        <small><br>
          <i>rule "Foo"</i><i><br>
          </i><i>&nbsp;&nbsp;&nbsp; when </i><i><br>
          </i><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NotExistingType( bloe == "test")</i><i><br>
          </i><i>&nbsp;&nbsp;&nbsp; then</i><i><br>
          </i><i>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("this should not work");</i><i><br>
          </i><i>end</i></small><br>
        <br>
        when I compile the rule myself with a KnowledgeBuilder:<br>
        <br>
        <small>KnowledgeBuilder kbuilder =
          KnowledgeBuilderFactory.newKnowledgeBuilder();<br>
          InputStream is = new
          ByteArrayInputStream(drlstring.getBytes());<br>
          kbuilder.add(
          ResourceFactory.newInputStreamResource(is),ResourceType.DRL );</small><br>
        <br>
        I receive the error: <br>
        org.drools.rule.Rule cannot be cast to org.drools.rule.Query<br>
        which I think doesn't tell me anything about the mistake I made
        in my rule, is this a Drools bug and should I post this
        somewhere?<br>
        <br>
        Kind Regards,<br>
        De Rooms Brecht<br>
        <br>
        <br>
        Full Stack:<br>
        java.lang.ClassCastException: org.drools.rule.Rule cannot be
        cast to org.drools.rule.Query<br>
        &nbsp;&nbsp;&nbsp; at
        org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:175)<br>
        &nbsp;&nbsp;&nbsp; at
        org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:118)<br>
        &nbsp;&nbsp;&nbsp; at
org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:67)<br>
        &nbsp;&nbsp;&nbsp; at
        org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:84)<br>
        &nbsp;&nbsp;&nbsp; at
        org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:2706)<br>
        &nbsp;&nbsp;&nbsp; at
        org.drools.compiler.PackageBuilder.compileRules(PackageBuilder.java:930)<br>
        &nbsp;&nbsp;&nbsp; at
org.drools.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:839)<br>
        &nbsp;&nbsp;&nbsp; at
        org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:831)<br>
        &nbsp;&nbsp;&nbsp; at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:467)<br>
        &nbsp;&nbsp;&nbsp; at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:673)<br>
        &nbsp;&nbsp;&nbsp; at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:45)<br>
        &nbsp;&nbsp;&nbsp; at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:34)<br>
        &nbsp;&nbsp;&nbsp; at
derooms.be.server.listeners.RulesListener.processMessage(RulesListener.java:33)<br>
        &nbsp;&nbsp;&nbsp; at
derooms.be.server.listeners.AbstractListener.onMessage(AbstractListener.java:35)<br>
        &nbsp;&nbsp;&nbsp; at
org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1321)<br>
        &nbsp;&nbsp;&nbsp; at
org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131)<br>
        &nbsp;&nbsp;&nbsp; at
org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202)<br>
        &nbsp;&nbsp;&nbsp; at
org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129)<br>
        &nbsp;&nbsp;&nbsp; at
org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47)<br>
        &nbsp;&nbsp;&nbsp; at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)<br>
        &nbsp;&nbsp;&nbsp; at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)<br>
        &nbsp;&nbsp;&nbsp; at java.lang.Thread.run(Thread.java:722)<br>
        <br>
        <fieldset class="mimeAttachmentHeader"></fieldset>
        <br>
        <pre wrap="">_______________________________________________
rules-users mailing list
<a moz-do-not-send="true" class="moz-txt-link-abbreviated" href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a>
<a moz-do-not-send="true" 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>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
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>