Error when executing KieServices.Factory.get()

Posted on

Hi.

We have a jar file that performs the following code:

try
   {
         System.err.println("Before factory init....");
         KieServices kservices = KieServices.Factory.get();
        System.err.println("After factory init....");
   }
catch (Exception e)
   {
       System.err.println("Error factory init....");
   }

However, when executing, a core dump is launched after a few seconds. When reviewing the log traces in the terminal, only the trace "Before factory init...." is shown. Checking out the DROOLS 7.44 documentation (https://docs.jboss.org/drools/release/7.44.0.Final/drools-docs/html_single/#_building_and_running_drools_in_a_fat_jar), the error could be caused because of the lack of the "kie.conf" file in our .jar file. We build this jar with "ant" so we do not know how to include this conf file in the "build.xml" and the content of the "kie.conf".

For information, in the "build.xml" file we are including all DROOLS runtime jars:

    <target name="compile" depends="init">
        <javac srcdir="${src.dir}" destdir="${build.dir}"  debug="${debug}" includeantruntime="false">
            <compilerarg line="-nowarn" />
            <classpath>
                <fileset dir="${env.DROOLS_RUNTIME}" includes="*.jar" />
                <pathelement path="${java.class.path}/" />
            </classpath>
        </javac>
    </target>

Best regards.

Responses