Exception in thread "main" java.lang.RuntimeException: Cannot find KieModule

1,144 views
Skip to first unread message

pisan...@gmail.com

unread,
Feb 19, 2018, 11:03:35 PM2/19/18
to Drools Usage
Hi,

I facing the error as per subject above. 

As per the example i found the internet the jar file been deployed suppose to be located at http://ip:8080/drools-wb/maven2wb/... but i can't access the jar. So i moved to C:\tomcatDrools2\webapps\drools\repo\Test-1.0.0.jar

The jar file is accessible via localhost:8080/drools/repo/Test-1.0.0.jar

Below is my code and i faced the error as subject refers. Appreciate if there is any response here.

package com.javacodegeeks.drools;

public class TestDrools {

public static void main(String[] args) {
// TODO Auto-generated method stub

    ReleaseIdImpl releaseId = new ReleaseIdImpl("com.myteam", "Test", "1.0.0");

    KieServices ks = KieServices.Factory.get();

    ks.getResources().newUrlResource(url);
   KieContainer kieContainer = ks.newKieContainer(releaseId);
}

}


The jar file was compiled and deployed successfully as per console below
Feb 20, 2018 11:42:33 AM org.drools.compiler.kie.builder.impl.KieRepositoryImpl addKieModule
INFO: KieModule was added: MemoryKieModule[releaseId=com.myteam:Test:1.0.0]
Feb 20, 2018 11:42:35 AM org.uberfire.ext.metadata.io.BatchIndex logInformation 

Below are the error in details
Exception in thread "main" java.lang.RuntimeException: Cannot find KieModule: com.myteam:Test:1.0
at org.drools.compiler.kie.builder.impl.KieServicesImpl.newKieContainer(KieServicesImpl.java:97)
at com.javacodegeeks.drools.TestDrools.main(TestDrools.java:27)

Michael Anstis

unread,
Feb 20, 2018, 4:46:39 AM2/20/18
to Drools Usage
Runtime will use Maven to resolve JARs.

So, it'll first check it's "local" repository (.m2), then any configured "remote" repositories.

I suspect c:\tomcatDrools2\.... is not configured as a "remote"?

--
You received this message because you are subscribed to the Google Groups "Drools Usage" group.
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage+unsubscribe@googlegroups.com.
To post to this group, send email to drools...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/drools-usage/12de706c-22ee-4f86-86a1-4897b6de0ee4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Message has been deleted

pisan...@gmail.com

unread,
Feb 22, 2018, 10:13:10 AM2/22/18
to Drools Usage
Hi ,


>>Runtime will use Maven to resolve JARs.
Means i need to configure my pom file to resolve the JARS from eclipse?
 But from the source code it's pointing to an URL so i don't understand why need maven to resolve the JARS as below

          ReleaseIdImpl releaseId = new ReleaseIdImpl("com.myteam", "Test", "1.0.0");
          KieServices ks = KieServices.Factory.get();
            ks.getResources().newUrlResource(url);
           KieContainer kieContainer = ks.newKieContainer(releaseId);

>>I suspect c:\tomcatDrools2\.... is not configured as a "remote"?
I am not sure how to configure it as remote. Below is the whole contain for c:\tomcatDrools2\ in case you need to check some setting? Can advise on how to configure it?

Below is the pom.xml configuration

    <modelVersion>4.0.0</modelVersion>
    <groupId>com.javacodegeeks.drools</groupId>
    <artifactId>droolsHelloWorld</artifactId>
    <version>0.0.1-SNAPSHOT</version>

    <dependencies>
        <!-- <dependency> <groupId>org.drools</groupId> <artifactId>knowledge-api</artifactId>
            <version>${drools.version}</version> </dependency> <dependency> <groupId>org.drools</groupId>
            <artifactId>drools-core</artifactId> <version>${drools.version}</version>
            </dependency> -->
        <dependency>
            <groupId>org.drools</groupId>
            <artifactId>drools-compiler</artifactId>
            <version>${drools.version}</version>
        </dependency>


       
        <!-- <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-flow</artifactId>
            <version>${jbpm.version}</version> </dependency> <dependency> <groupId>org.jbpm</groupId>
            <artifactId>jbpm-flow-builder</artifactId> <version>${jbpm.version}</version>
            </dependency> <dependency> <groupId>org.jbpm</groupId> <artifactId>jbpm-bpmn2</artifactId>
            <version>${jbpm.version}</version> </dependency> -->
    </dependencies>
    <properties>
        <drools.version>6.2.0.Final</drools.version>
        <jbpm.version>6.2.0.Final</jbpm.version>
    </properties>
</project>
- show quoted text -
To unsubscribe from this group and stop receiving emails from it, send an email to drools-usage...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages