[rules-users] Loading external KieModule fails with NullPointerException

Jean-Philippe Steinmetz caskater47 at gmail.com
Mon Mar 31 18:28:01 EDT 2014


Hello,

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.

Here is my code...

    KieServices kieServices = KieServices.Factory.get();
    ReleaseId releaseId = kieServices.newReleaseId("com.mycompany",
"mymodule", "1.0-SNAPSHOT");
    KieContainer kContainer = kieServices.newKieContainer(releaseId);

And here is the output I get...

[pool-1-thread-1] INFO
com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of
application's worked threads is 16
[pool-3-thread-1] INFO
com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of
application's worked threads is 16
[pool-5-thread-1] INFO
com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of
application's worked threads is 16
[pool-7-thread-1] INFO
com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of
application's worked threads is 16
[pool-9-thread-1] INFO
com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of
application's worked threads is 16
[pool-11-thread-1] INFO
com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of
application's worked threads is 16
[pool-13-thread-1] INFO
com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of
application's worked threads is 16
[pool-15-thread-1] INFO
com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of
application's worked threads is 16
[pool-17-thread-1] INFO
com.ning.http.client.providers.netty.NettyAsyncHttpProvider - Number of
application's worked threads is 16
Disconnected from the target VM, address: '127.0.0.1:51890', transport:
'socket'
Exception in thread "main" java.lang.NullPointerException
 at
org.kie.scanner.KieRepositoryScannerImpl.addDependencies(KieRepositoryScannerImpl.java:128)
at
org.kie.scanner.KieRepositoryScannerImpl.buildArtifact(KieRepositoryScannerImpl.java:119)
 at
org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:90)
at
org.kie.scanner.KieRepositoryScannerImpl.loadArtifact(KieRepositoryScannerImpl.java:83)
 at
org.drools.compiler.kie.builder.impl.KieRepositoryImpl.loadKieModuleFromMavenRepo(KieRepositoryImpl.java:113)
at
org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:99)
 at
org.drools.compiler.kie.builder.impl.KieRepositoryImpl.getKieModule(KieRepositoryImpl.java:76)
at
org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:84)

The module has the following dependencies listed in the pom.xml.

<dependencies>
    <!-- Drools -->
      <dependency>
          <groupId>org.drools</groupId>
          <artifactId>drools-core</artifactId>
          <version>${drools.version}</version>
          <scope>compile</scope>
      </dependency>
      <dependency>
          <groupId>org.drools</groupId>
          <artifactId>drools-compiler</artifactId>
          <version>${drools.version}</version>
          <scope>compile</scope>
      </dependency>
      <dependency>
          <groupId>org.drools</groupId>
          <artifactId>drools-decisiontables</artifactId>
          <version>${drools.version}</version>
          <scope>compile</scope>
      </dependency>
      <dependency>
          <groupId>org.drools</groupId>
          <artifactId>drools-persistence-jpa</artifactId>
          <version>${drools.version}</version>
          <scope>compile</scope>
      </dependency>
      <!-- Misc -->
      <dependency>
  <groupId>org.slf4j</groupId>
  <artifactId>slf4j-api</artifactId>
  <version>1.7.6</version>
</dependency>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>
</dependencies>

I have tried searching for help on this but am unable to find anything
related. Any help here is appreciated.

Thanks!

Jean-Philippe Steinmetz
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20140331/b6229aad/attachment.html 


More information about the rules-users mailing list