This is a JDT classpath problem. Either you have the wrong JDT version in your classpath, or you have multiple clashing versions. Either fix it, or switch to use JANINO as your compiler.<div><br></div><div>   Edson<br><br>
<div class="gmail_quote">2010/6/29 Jean-Philippe Steinmetz <span dir="ltr">&lt;<a href="mailto:jeanphilippe@trilogystudios.com">jeanphilippe@trilogystudios.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div lang="EN-US" link="blue" vlink="purple"><div><p class="MsoNormal">Hello everyone,</p><p class="MsoNormal"> </p><p class="MsoNormal">I’m fairly new to Drools, having only worked with a basic setup for a little while now. I’ve successfully gotten a Drools 5.0.1 runtime working with an app running under JBoss 5 but now I need Drools to run under a standalone application. I’ve more or less copied all of the set up that I used in the JBoss app but am experiencing weird compilation problems.</p>
<p class="MsoNormal"> </p><p class="MsoNormal">My application code looks like the following…</p><p class="MsoNormal"> </p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">KnowledgeAgent kagent = KnowledgeAgentFactory.<i>newKnowledgeAgent</i>(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF">&quot;MyAgenda&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">);</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">kagent.applyChangeSet(ResourceFactory.<i>newClassPathResource</i>(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#2A00FF">&quot;my_rules.xml&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">));</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">KnowledgeBase </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#0000C0">kbase</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> = kagent.getKnowledgeBase();</span></p>
<p class="MsoNormal"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">final</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> StatefulKnowledgeSession ksession = </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#0000C0">kbase</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">.newStatefulKnowledgeSession();</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">ksession.addEventListener(</span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> DebugAgendaEventListener());</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">ksession.addEventListener(</span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#7F0055">new</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> <span style="background:silver">DebugWorkingMemoryEventListener</span>());</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">KnowledgeRuntimeLogger krlogger = KnowledgeRuntimeLoggerFactory.<i>newConsoleLogger</i>(ksession);</span></p><p class="MsoNormal">
<span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">ksession.insert(myObject);</span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">ksession.fireAllRules();</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p><p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">krlogger.close();</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">ksession.dispose();</span></p><p class="MsoNormal"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span></p>
<p class="MsoNormal">and my rules file looks like…</p><p class="MsoNormal"> </p><p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">package</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> mypackage</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"> </span></p><p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">rule</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black"> </span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;test&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">    </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">when</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">        Object()</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">    </span><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">then</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal" style="text-autospace:none"><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">        System.out.println(</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:green">&quot;Hello World!&quot;</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:black">);</span><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal" style="text-autospace:none"><b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;;color:#960000">end</span></b><span style="font-size:10.0pt;font-family:&quot;Courier New&quot;"></span></p>
<p class="MsoNormal"> </p><p class="MsoNormal">Finally this is the output I am seeing from my application…</p><p class="MsoNormal"> </p><p>[2010:06:180 18:06:144:info] ResourceChangeNotification created</p><p>[2010:06:180 18:06:147:info] ResourceChangeScanner created with default interval=60</p>
<p>[2010:06:180 18:06:147:debug] ResourceChangeNotification monitor added monitor=org.drools.io.impl.ResourceChangeScannerImpl@7d0b8078</p><p>[2010:06:180 18:06:149:info] KnowledgAgent created, with configuration:</p><p>monitorChangeSetEvents=true scanResources=true scanDirectories=true</p>
<p>[2010:06:180 18:06:149:info] KnowledegAgent has started listening for ChangeSet notifications</p><p>(null: 3, 78): SchemaLocation: schemaLocation value = &#39;<a href="http://drools.org/drools-5.0/change-set.xsd" target="_blank">http://drools.org/drools-5.0/change-set.xsd</a>&#39; must have even number of URI&#39;s.</p>
<p>(null: 3, 78): cvc-elt.1: Cannot find the declaration of element &#39;change-set&#39;.</p><p>[2010:06:180 18:06:181:info] KnowledgAgent applying ChangeSet</p><p>[2010:06:180 18:06:182:debug] KnowledgeAgent subscribing to resource=[ClassPathResource path=&#39;TestRules.drl&#39;]</p>
<p>[2010:06:180 18:06:182:debug] ResourceChangeNotification subscribing listener=org.drools.agent.impl.KnowledgeAgentImpl@61176350 to resource=[ClassPath</p><p>Resource path=&#39;TestRules.drl&#39;]</p><p>[2010:06:180 18:06:185:debug] ResourceChangeScanner subcribing notifier=org.drools.io.impl.ResourceChangeNotifierImpl@46794afc to resource=[ClassPathR</p>
<p>esource path=&#39;TestRules.drl&#39;]</p><p>[2010:06:180 18:06:187:debug] KnowledgeAgent ChangeSet requires KnowledgeBuilder</p><p>[2010:06:180 18:06:187:debug] KnowledgeAgent rebuilding KnowledgeBase using ChangeSet</p>
<p>[2010:06:180 18:06:315:debug] KnowledgeAgent building resource=[ClassPathResource path=&#39;TestRules.drl&#39;]</p><p>java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/CategorizedProblem;</p>
<p>        at org.drools.commons.jci.compilers.EclipseJavaCompiler$3.acceptResult(EclipseJavaCompiler.java:321)</p><p>        at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:335)</p><p>        at org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:351)</p>
<p>        at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:51)</p><p>        at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:389)</p><p>        at org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:56)</p>
<p>        at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:74)</p><p>        at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:690)</p><p>        at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:653)</p>
<p>        at org.drools.compiler.PackageBuilder.addPackageFromDrl(PackageBuilder.java:290)</p><p>        at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:488)</p><p>        at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:25)</p>
<p>        at org.drools.agent.impl.KnowledgeAgentImpl.rebuildResources(KnowledgeAgentImpl.java:386)</p><p>        at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:120)</p><p>        at org.drools.agent.impl.KnowledgeAgentImpl.applyChangeSet(KnowledgeAgentImpl.java:109)</p>
<p class="MsoNormal"> </p><p class="MsoNormal">Now I’ve checked all of the maven dependencies to make sure the they are all there and I can doubly confirm everything is fine. In fact, I even went so far to make sure the jars included in my app contained the org.eclipse.jdt.core.compiler.CategorizedProblem.class file. The only difference I’ve been able to think of so far is that my standalone application uses the Java service wrapper where JBoss does not.</p>
<p class="MsoNormal"> </p><p class="MsoNormal">Any help is greatly appreciated.</p><p class="MsoNormal"> </p><p class="MsoNormal">Cheers,</p><p class="MsoNormal"> </p><font color="#888888"><p class="MsoNormal">Jean-Philippe Steinmetz</p>
</font></div></div><br>_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">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><br clear="all"><br>-- <br>  Edson Tirelli<br>  JBoss Drools Core Development<br>  JBoss by Red Hat @ <a href="http://www.jboss.com">www.jboss.com</a><br>
</div>