Hi Kevin,<br><br>The problem is a dependancy missing on the broker example.<br><br>If you add the following to your maven dependancies you'll be OK:-<br><br><span style="font-family: courier new,monospace;"> <dependency></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> <groupId>org.drools</groupId></span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;"> <artifactId>drools-flow-compiler</artifactId></span><br style="font-family: courier new,monospace;">
<span style="font-family: courier new,monospace;"> </dependency></span><br style="font-family: courier new,monospace;"><br>If you had previously generated the Eclipse project files you'll need to re-run mvn eclipse:eclipse to add the new dependancy (or add manually).<br>
<br>If you use M2Eclipse I suspect you'll have to re-import (or fix the missing dependancy manually).<br><br>JIRA <a href="https://jira.jboss.org/browse/JBRULES-2748">https://jira.jboss.org/browse/JBRULES-2748</a> created.<br>
<br>Cheers,<br><br>Mike<br><br><div class="gmail_quote">2010/10/21 ÕÔ٩٩ <span dir="ltr"><<a href="mailto:kevin223@gmail.com" target="_blank">kevin223@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Thanks Michael, I couldn't find any XML files under the example project. It will be a great help if you can take a look at yours when you have time. <div>
<div></div><div><div><br></div><div>Best Regards,</div><div>Kevin Zhao<br><br><div class="gmail_quote">
2010/10/21 Michael Anstis <span dir="ltr"><<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Your stack trace shows:-<div><div><span style="font-family: arial,sans-serif; font-size: 13px; border-collapse: collapse;"><blockquote type="cite"><div><div><div><div>at org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:432)</div>
</div></div></div></blockquote></span></div>So a process is being built from associated XML!</div><div><br></div><div>If I get time I'll have a look at the example (when I'm at home later). I don't recall anything being copied anywhere as they're normally picked up directly from the classpath.</div>
<div><div></div><div>
<div><br><div class="gmail_quote">2010/10/21 ÕÔ٩٩ <span dir="ltr"><<a href="mailto:kevin223@gmail.com" target="_blank">kevin223@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
No, the NPE is all I've got in the console output. <div><br></div><div>Can you detail what process definition that you are referring to? I saw all the rules definition files are all copied over to the classpath after conducting the compile.</div>
<div><br></div><div>Namely, those files are borker.drl, notify.drl, position.drl, position.rf and stocktickstream.dat. All of them now exist under project-root/target/classes</div><div><br></div><div>Best Regards,</div><div>
Kevin Zhao</div><div><br></div><div><br><div class="gmail_quote">2010/10/21 Michael Anstis <span dir="ltr"><<a href="mailto:michael.anstis@gmail.com" target="_blank">michael.anstis@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Are there any errors in addition to the NPE?<div><br></div><div>The context of the stack-trace suggests the process definition being loaded is not on your classpath.<br><br><div class="gmail_quote">2010/10/21 ÕÔ٩٩ <span dir="ltr"><<a href="mailto:kevin223@gmail.com" target="_blank">kevin223@gmail.com</a>></span><div>
<div></div><div><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Thanks Bruno,<div><br></div><div>I have now fixed the NoClassDefFoundError, any ideas about the NullPointer one?</div>
<div><br></div><div>Best Regards,</div><div>Kevin Zhao<br><br><div class="gmail_quote">2010/10/20 Bruno Freudensprung <span dir="ltr"><<a href="mailto:bruno.freudensprung@temis.com" target="_blank">bruno.freudensprung@temis.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
<br>
Hello,<br>
<br>
I think you have to add the xstream jar to your classpath.<br>
Here is the Maven dependency :<br>
<br>
<pre> <dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.3.1</version>
</dependency>
</pre>
Best regards,<br>
<br>
Bruno.<br>
<br>
<br>
ÕÔ٩٩ a ¨¦crit :
<blockquote type="cite"><div><div></div><div>Hello,
<div><br>
</div>
<div>I checked out the latest source from svn repository. It compiled
OK and imported the example projects to my eclipse workspace but the
examples run with error.</div>
<div>The two example projects are namely drools-examples-drl
& drools-examples-fusion.</div>
<div><br>
</div>
<div>org.drools.examples.pacman.Main gives the errors:</div>
<div><br>
</div>
<div>
<div>Exception in thread "main" java.lang.NoClassDefFoundError:
com/thoughtworks/xstream/XStream</div>
<div><span style="white-space: pre-wrap;"> </span>at
org.drools.audit.KnowledgeRuntimeLoggerProviderImpl.newThreadedFileLogger(KnowledgeRuntimeLoggerProviderImpl.java:34)</div>
<div><span style="white-space: pre-wrap;"> </span>at
org.drools.logger.KnowledgeRuntimeLoggerFactory.newThreadedFileLogger(KnowledgeRuntimeLoggerFactory.java:69)</div>
<div><span style="white-space: pre-wrap;"> </span>at
org.drools.examples.pacman.Main.initKsession(Main.java:88)</div>
<div><span style="white-space: pre-wrap;"> </span>at
org.drools.examples.pacman.Main.main(Main.java:39)</div>
<div>Caused by: java.lang.ClassNotFoundException:
com.thoughtworks.xstream.XStream</div>
<div><span style="white-space: pre-wrap;"> </span>at
java.net.URLClassLoader$1.run(Unknown Source)</div>
<div><span style="white-space: pre-wrap;"> </span>at
java.security.AccessController.doPrivileged(Native Method)</div>
<div><span style="white-space: pre-wrap;"> </span>at
java.net.URLClassLoader.findClass(Unknown Source)</div>
<div><span style="white-space: pre-wrap;"> </span>at
java.lang.ClassLoader.loadClass(Unknown Source)</div>
<div><span style="white-space: pre-wrap;"> </span>at
sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)</div>
<div><span style="white-space: pre-wrap;"> </span>at
java.lang.ClassLoader.loadClass(Unknown Source)</div>
<div><span style="white-space: pre-wrap;"> </span>...
4 more</div>
</div>
<div><br>
</div>
<div><br>
</div>
<div>org.drools.examples.broker.Main gives the errors:</div>
<div><br>
</div>
<div>
<div>java.lang.NullPointerException</div>
<div><span style="white-space: pre-wrap;"> </span>at
org.drools.compiler.PackageBuilder.addProcessFromXml(PackageBuilder.java:432)</div>
<div><span style="white-space: pre-wrap;"> </span>at
org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:468)</div>
<div><span style="white-space: pre-wrap;"> </span>at
org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:28)</div>
<div><span style="white-space: pre-wrap;"> </span>at
org.drools.examples.broker.Broker.loadRuleBase(Broker.java:95)</div>
<div><span style="white-space: pre-wrap;"> </span>at
org.drools.examples.broker.Broker.createSession(Broker.java:80)</div>
<div><span style="white-space: pre-wrap;"> </span>at
org.drools.examples.broker.Broker.<init>(Broker.java:57)</div>
<div><span style="white-space: pre-wrap;"> </span>at
org.drools.examples.broker.Main.main(Main.java:53)</div>
</div>
<div><br>
</div>
<div>Does anyone experience the similar issues and know how to fix
that?</div>
<div><br>
</div>
<div>Best Regards,</div>
<div>Kevin</div>
</div></div><pre><hr width="90%" size="4">
_______________________________________________
rules-users mailing list
<a href="mailto:rules-users@lists.jboss.org" target="_blank">rules-users@lists.jboss.org</a>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a>
</pre>
</blockquote>
<br>
</div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div><br></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div></div></div><br></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div><br></div>
<br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org" target="_blank">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></blockquote></div><br>