<div dir="ltr">Matt,<div><br></div><div>Try these notes - they are ONLY my notes, not a step by step on how to do it but it should give you some inspiration on how to tackle the issue. If it&#39;s still a problem, let me know and I&#39;ll do a step by step for you from scratch.</div>
<div><br></div><div>-matt</div><div><br></div><div><div>Drools Examples Porting Project Notes:</div><div><br></div><div><br></div><div>Notes:</div><div>This project is to take the stock V6 Drools examples and port them over to MyDroolsExamples Project for inclusion in my GitHub Repository.</div>
<div>This assumes you are using Eclipse with the Maven and Drools 6.x plugins installed, and you are at the point where you can run a Drools 6X hello world example app.</div><div><br></div><div>First - Create an stock Drools V6 Project w/Hello World Example, add in the external JAR: slf4j-jdk14-1.7.5.jar (<a href="http://www.slf4j.org/download.html">http://www.slf4j.org/download.html</a>) to get the logging working correctly, test run as Java Application, and then convert to Maven project.  Drools V6 is inherently Maven so this is a critical step, creates the important pom.xml file. </div>
<div><br></div><div>kModule.xml &lt;== Find this file!!!</div><div>This is the file that tells drools where to find the Rules and how to name the XML references that load them Think Injection style IoC (Spring Like) infrastructure. It can also be done programatically.  </div>
<div><br></div><div>The kmodule you need to use is located in the src/main/resources/META-INF directory</div><div><br></div><div>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</div><div>&lt;kmodule xmlns=&quot;<a href="http://jboss.org/kie/6.0.0/kmodule">http://jboss.org/kie/6.0.0/kmodule</a>&quot;&gt;</div>
<div>    &lt;kbase name=&quot;rules&quot; packages=&quot;rules&quot;&gt;</div><div>        &lt;ksession name=&quot;ksession-rules&quot;/&gt;</div><div>    &lt;/kbase&gt;</div><div>&lt;/kmodule&gt;</div><div><br></div><div>
<br></div><div><br></div><div>First Port</div><div>org.drools.examples.fibonacci</div><div><br></div><div>1. Clone the Packages for the Java and the Rules, copy over the Java Class and the DRL file in their respective places, and ammend the kmodule.xml file to be:</div>
<div><br></div><div>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</div><div>&lt;kmodule xmlns=&quot;<a href="http://jboss.org/kie/6.0.0/kmodule">http://jboss.org/kie/6.0.0/kmodule</a>&quot;&gt;</div><div>
    &lt;kbase name=&quot;rules&quot; packages=&quot;rules&quot;&gt;</div><div>        &lt;ksession name=&quot;ksession-rules&quot;/&gt;</div><div>    &lt;/kbase&gt;</div><div>    &lt;kbase name=&quot;org.drools.examples.fibonacci&quot; packages=&quot;org.drools.examples.fibonacci&quot;&gt;</div>
<div>        &lt;ksession name=&quot;FibonacciKS&quot;/&gt;</div><div>    &lt;/kbase&gt;</div><div>&lt;/kmodule&gt;</div><div><br></div><div><br></div><div><br></div><div>Adding the KIE plugin to a Maven pom.xml -&gt; A Source of problems</div>
<div><br></div><div>THIS:</div><div>      &lt;plugin&gt;</div><div>        &lt;groupId&gt;org.kie&lt;/groupId&gt;</div><div>        &lt;artifactId&gt;kie-maven-plugin&lt;/artifactId&gt;</div><div>        &lt;version&gt;${project.version}&lt;/version&gt;</div>
<div>        &lt;extensions&gt;true&lt;/extensions&gt;</div><div>      &lt;/plugin&gt;</div><div><br></div><div>BECOMES THIS:</div><div>      &lt;plugin&gt;</div><div>        &lt;groupId&gt;org.kie&lt;/groupId&gt;</div><div>
        &lt;artifactId&gt;kie-maven-plugin&lt;/artifactId&gt;</div><div>        &lt;version&gt;6.0.1.Final&lt;/version&gt;</div><div>        &lt;extensions&gt;true&lt;/extensions&gt;</div><div>      &lt;/plugin&gt;  </div>
<div><br></div><div>AFTER LOOKING HERE:</div><div><a href="http://mvnrepository.com/artifact/org.kie/kie-maven-plugin/6.0.1.Final">http://mvnrepository.com/artifact/org.kie/kie-maven-plugin/6.0.1.Final</a></div><div>... and changing this: 6.0.1.Final</div>
<div><br></div><div>***&gt; and then doing a Maven: Update Project execution</div><div>This is an important step to do often if you get wierd errors since it forces a refresh to the project.</div><div><br></div><div><br></div>
<div><br></div><div>Running the Java class gives me this:</div><div>SEVERE: Unknown KieSession name: FibonacciKS</div><div>Exception in thread &quot;main&quot; java.lang.NullPointerException</div><div><span class="" style="white-space:pre">        </span>at org.drools.examples.fibonacci.FibonacciExample.main(FibonacciExample.java:31)</div>
<div><br></div><div>Therefore the kmodule.xml is incorrect ....</div><div><br></div><div>Researching Here: </div><div><a href="http://stackoverflow.com/questions/20315910/getting-null-pointer-exception-while-running-helloworld-in-drools">http://stackoverflow.com/questions/20315910/getting-null-pointer-exception-while-running-helloworld-in-drools</a></div>
<div><a href="http://stackoverflow.com/questions/21466716/unknown-kiesession-name-in-drools-6-0-while-trying-to-add-drools-to-existing-ma">http://stackoverflow.com/questions/21466716/unknown-kiesession-name-in-drools-6-0-while-trying-to-add-drools-to-existing-ma</a></div>
<div><br></div><div><br></div><div>This doc talks about the various ways a KBase can be built, and there are many ....</div><div><a href="http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/KIEChapter.html#KIEExamplesSection">http://docs.jboss.org/drools/release/6.0.1.Final/drools-docs/html/KIEChapter.html#KIEExamplesSection</a></div>
<div><br></div><div><br></div><div>This is the code base for the examples....</div><div><a href="https://github.com/droolsjbpm/drools/tree/master/drools-examples-api">https://github.com/droolsjbpm/drools/tree/master/drools-examples-api</a></div>
<div><br></div><div><br></div><div><br></div><div><br></div><div>SOLUTION:</div><div><br></div><div>This kmodule.xml is found under src/main/resources/META-INF/kmodule.xml</div><div>... once I added the highlighted XML extry it worked like a charm. The &quot;kbase name&quot; is the location of the RULES DRL,</div>
<div>the &quot;ksession name&quot; is the Java Class location. </div><div><br></div><div>So in this case it would be: </div><div><br></div><div><br></div><div>kbase name=&quot;org.drools.examples.fibonacci&quot;<span class="" style="white-space:pre">        </span>src/main/resources/org.drools.examples.fibonacci</div>
<div>ksession name=&quot;FibonacciKS&quot;<span class="" style="white-space:pre">                                </span>src/main/java/org.drools.examples.fibonacci</div><div><br></div><div><br></div><div><br></div><div>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</div>
<div>&lt;kmodule xmlns=&quot;<a href="http://jboss.org/kie/6.0.0/kmodule">http://jboss.org/kie/6.0.0/kmodule</a>&quot;&gt;</div><div>    &lt;kbase name=&quot;rules&quot; packages=&quot;rules&quot;&gt;</div><div>        &lt;ksession name=&quot;ksession-rules&quot;/&gt;</div>
<div>    &lt;/kbase&gt;</div><div>    &lt;kbase name=&quot;org.drools.examples.fibonacci&quot; packages=&quot;org.drools.examples.fibonacci&quot;&gt;</div><div>        &lt;ksession name=&quot;FibonacciKS&quot;/&gt;</div><div>
    &lt;/kbase&gt; </div><div>    &lt;kbase name=&quot;org.drools.examples.backwardchaining&quot; packages=&quot;org.drools.examples.backwardchaining&quot;&gt;</div><div>        &lt;ksession name=&quot;HouseOfDoomKS&quot;/&gt;</div>
<div>    &lt;/kbase&gt; </div><div>    &lt;kbase name=&quot;org.drools.examples.honestpolitician&quot; packages=&quot;org.drools.examples.honestpolitician&quot;&gt;</div><div>        &lt;ksession name=&quot;HonestPoliticianKS&quot;/&gt;</div>
<div>    &lt;/kbase&gt;  </div><div>    &lt;kbase name=&quot;org.drools.examples.golfing&quot; packages=&quot;org.drools.examples.golfing&quot;&gt;</div><div>        &lt;ksession name=&quot;GolfingKS&quot;/&gt;</div><div>
    &lt;/kbase&gt;  </div><div>    &lt;kbase name=&quot;org.drools.examples.shopping&quot; packages=&quot;org.drools.examples.shopping&quot;&gt;</div><div>        &lt;ksession name=&quot;ShoppingKS&quot;/&gt;</div><div>    &lt;/kbase&gt;   </div>
<div>    &lt;kbase name=&quot;StateSalienceKB&quot; packages=&quot;org.drools.examples.state.salience&quot;&gt;</div><div>        &lt;ksession name=&quot;StateSalienceKS&quot;/&gt;</div><div>    &lt;/kbase&gt;</div><div>    &lt;kbase name=&quot;StateAgendaGroupKB&quot; packages=&quot;org.drools.examples.state.agendagroup&quot;&gt;</div>
<div>        &lt;ksession name=&quot;StateAgendaGroupKS&quot;/&gt;</div><div>    &lt;/kbase&gt;   </div><div>    &lt;kbase name=&quot;org.drools.examples.cashflow&quot; packages=&quot;org.drools.examples.cashflow&quot;&gt;</div>
<div>        &lt;ksession name=&quot;CashFlowKS&quot;/&gt;</div><div>    &lt;/kbase&gt;  </div><div>&lt;/kmodule&gt;</div></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Feb 25, 2014 at 12:30 PM, mattmadhavan <span dir="ltr">&lt;<a href="mailto:mmadhavan@facs.org" target="_blank">mmadhavan@facs.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">HI Matt,<br>
I have downloaded your examples and want to try them out. But I having<br>
building -ANY- 6.x examples - not just your examples. Maven is not able to<br>
resolve any 6.x repositories.<br>
<br>
Any ideas please? When I tired to build your examples I am getting the<br>
following errors.<br>
<br>
<br>
<br>
Please note that I have no problem with drools 5.x aritfacts.<br>
<br>
Any idea please?<br>
<br>
Thanks in advance!<br>
<br>
Matt&#39;M<br>
<br>
<br>
<br>
<br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Drools-6-x-Stand-alone-Examples-tp4028219p4028313.html" target="_blank">http://drools.46999.n3.nabble.com/Drools-6-x-Stand-alone-Examples-tp4028219p4028313.html</a><br>

Sent from the Drools: User forum mailing list archive at Nabble.com.<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>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">#########################################################<br>Matthew R. Versaggi, President &amp; CEO<br>Versaggi Information Systems, Inc.<br>Adjunct Professor of eBusiness DePaul University<br>
Email: mailto:<a href="mailto:matt@versaggi.com" target="_blank">matt@versaggi.com</a>, <a href="mailto:ProfVersaggi@gmail.com" target="_blank">ProfVersaggi@gmail.com</a><br>M: 630-292-8422 <br>LinkedIn:  <a href="http://www.linkedin.com/in/versaggi" target="_blank">http://www.linkedin.com/in/versaggi</a><br>
######################################################### <br></div>
</div>