4

I am developing an application using Drools 6.1.0. I create a stateless session:

KieServices kieServices = KieServices.Factory.get();
KieContainer kContainer = kieServices.getKieClasspathContainer();
kSession = kContainer.newStatelessKieSession();

Also I got a default kmodule.xml:

<?xml version="1.0" encoding="UTF-8"?> <kmodule xmlns="http://jboss.org/kie/6.0.0/kmodule"> </kmodule>

It could be found at META-INF/kmodule.xml

When I run the application on Eclipse it works perfectly. I am trying to pack the app in a runnable jar file. However when I run the jar file the kmodule.xml can't be found.

How can I indicate to my application wheres is the kmodule.xml file? Is there any other alternative than using the classpath?

Thank you!

Luisetelo
  • 106
  • 2
  • 9

1 Answers1

1

Are you using a maven structure? the kmodule.xml file needs to be inside the src/main/resources/META-INF/ directory as far as I remember.

salaboy
  • 4,123
  • 1
  • 14
  • 15
  • You remember correctly. :) I can also confirm that this does work in an executable jar/uber-jar. – Steve Feb 23 '15 at 09:11
  • 1
    Yes it is. Exporting the project with maven plugins works perfectly. I followed the instructions from http://crunchify.com/how-to-create-build-java-project-including-all-dependencies-using-maven-maven-resources-maven-dependency-maven-jar-plugin-tutorial/ Thank you! – Luisetelo Feb 23 '15 at 09:23