<div dir="ltr">Hello,<div><br></div><div>I am trying to set up a simple Drools (6.0.1.Final) application that pulls a kmodule from an external jar that is installed in the local Maven repository. Unfortunately when my code executes the newKieContainer method it crashes with a NullPointerException.</div>
<div><br></div><div>Here is my code...</div><div><br></div><div><div> KieServices kieServices = KieServices.Factory.get();</div><div> ReleaseId releaseId = kieServices.newReleaseId("com.mycompany", "mymodule", "1.0-SNAPSHOT");</div>
<div> KieContainer kContainer = kieServices.newKieContainer(releaseId);</div></div><div><br></div><div>And here is the output I get...</div><div><br></div><div><div>[pool-1-thread-1] INFO com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of application's worked threads is 16</div>
<div>[pool-3-thread-1] INFO com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of application's worked threads is 16</div><div>[pool-5-thread-1] INFO com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of application's worked threads is 16</div>
<div>[pool-7-thread-1] INFO com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of application's worked threads is 16</div><div>[pool-9-thread-1] INFO com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of application's worked threads is 16</div>
<div>[pool-11-thread-1] INFO com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of application's worked threads is 16</div><div>[pool-13-thread-1] INFO com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of application's worked threads is 16</div>
<div>[pool-15-thread-1] INFO com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of application's worked threads is 16</div><div>[pool-17-thread-1] INFO com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of application's worked threads is 16</div>
<div>Disconnected from the target VM, address: '<a href="http://127.0.0.1:51890">127.0.0.1:51890</a>', transport: 'socket'</div><div>Exception in thread "main" java.lang.NullPointerException</div>
<div><span class="" style="white-space:pre">        </span>at org.kie.scanner.KieRepositoryScannerImpl.addDependencies(KieRepositoryScannerImpl.java:128)</div><div><span class="" style="white-space:pre">        </span>at org.kie.scanner.KieRepositoryScannerImpl.buildArtifact(KieRepositoryScannerImpl.java:119)</div>
<div><span class="" style="white-space:pre">        </span>at org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:90)</div><div><span class="" style="white-space:pre">        </span>at org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:83)</div>
<div><span class="" style="white-space:pre">        </span>at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.loadKieModuleFromMavenRepo(KieRepositoryImpl.java:113)</div><div><span class="" style="white-space:pre">        </span>at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:99)</div>
<div><span class="" style="white-space:pre">        </span>at org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:76)</div><div><span class="" style="white-space:pre">        </span>at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:84)</div>
</div><div><br></div><div>The module has the following dependencies listed in the pom.xml.</div><div><br></div><div><dependencies></div><div> <!-- Drools --></div><div> <dependency></div><div> <groupId>org.drools</groupId></div>
<div> <artifactId>drools-core</artifactId></div><div> <version>${drools.version}</version></div><div> <scope>compile</scope></div><div> </dependency></div>
<div> <dependency></div><div> <groupId>org.drools</groupId></div><div> <artifactId>drools-compiler</artifactId></div><div> <version>${drools.version}</version></div>
<div> <scope>compile</scope></div><div> </dependency></div><div> <dependency></div><div> <groupId>org.drools</groupId></div><div> <artifactId>drools-decisiontables</artifactId></div>
<div> <version>${drools.version}</version></div><div> <scope>compile</scope></div><div> </dependency></div><div> <dependency></div><div> <groupId>org.drools</groupId></div>
<div> <artifactId>drools-persistence-jpa</artifactId></div><div> <version>${drools.version}</version></div><div> <scope>compile</scope></div><div> </dependency></div>
<div> <!-- Misc --></div><div> <dependency></div><div><span class="" style="white-space:pre">        </span> <groupId>org.slf4j</groupId></div><div><span class="" style="white-space:pre">        </span> <artifactId>slf4j-api</artifactId></div>
<div><span class="" style="white-space:pre">        </span> <version>1.7.6</version></div><div><span class="" style="white-space:pre">        </span></dependency></div><div> <dependency></div><div> <groupId>junit</groupId></div>
<div> <artifactId>junit</artifactId></div><div> <version>3.8.1</version></div><div> <scope>test</scope></div><div> </dependency></div><div></dependencies></div>
<div><br></div><div>I have tried searching for help on this but am unable to find anything related. Any help here is appreciated.</div><div><br></div><div>Thanks!</div><div><br></div><div>Jean-Philippe Steinmetz</div></div>