<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
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> when</i><i><br>
</i><i> message:TrackerRemote.TrackerUpdate()</i><i><br>
</i><i> then</i><i><br>
</i><i> 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>
Unable to resolve ObjectType 'NotExistingType' : [Rule
name='Foo']<br>
<small><br>
<i>rule "Foo"</i><i><br>
</i><i> when </i><i><br>
</i><i> NotExistingType( bloe == "test")</i><i><br>
</i><i> then</i><i><br>
</i><i> 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>
at
org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:175)<br>
at
org.drools.rule.builder.PatternBuilder.build(PatternBuilder.java:118)<br>
at
org.drools.rule.builder.GroupElementBuilder.build(GroupElementBuilder.java:67)<br>
at
org.drools.rule.builder.RuleBuilder.build(RuleBuilder.java:84)<br>
at
org.drools.compiler.PackageBuilder.addRule(PackageBuilder.java:2706)<br>
at
org.drools.compiler.PackageBuilder.compileRules(PackageBuilder.java:930)<br>
at
org.drools.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:839)<br>
at
org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:831)<br>
at
org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:467)<br>
at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:673)<br>
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:45)<br>
at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:34)<br>
at
derooms.be.server.listeners.RulesListener.processMessage(RulesListener.java:33)<br>
at
derooms.be.server.listeners.AbstractListener.onMessage(AbstractListener.java:35)<br>
at
org.apache.activemq.ActiveMQMessageConsumer.dispatch(ActiveMQMessageConsumer.java:1321)<br>
at
org.apache.activemq.ActiveMQSessionExecutor.dispatch(ActiveMQSessionExecutor.java:131)<br>
at
org.apache.activemq.ActiveMQSessionExecutor.iterate(ActiveMQSessionExecutor.java:202)<br>
at
org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:129)<br>
at
org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:47)<br>
at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)<br>
at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)<br>
at java.lang.Thread.run(Thread.java:722)<br>
</body>
</html>