Optaplanner 7.13.0 cant be executed from a jar file











up vote
0
down vote

favorite












I am building a project using optaplanner jar to solve a vehicle routing problem. After building the jar, I am unable to invoke the main class and this is the error I get:



513 [main] INFO org.kie.api.internal.utils.ServiceDiscoveryImpl - Loading kie.conf from  jar:file:/Users/meena/Documents/SourceCode/Comma_code/comma_code/sources/target/comma-1.0-SNAPSHOT-jar-with-dependencies.jar!/META-INF/kie.conf in classloader sun.misc.Launcher$AppClassLoader@55f96302
515 [main] INFO org.kie.api.internal.utils.ServiceDiscoveryImpl - Adding Service +org.optaplanner.core.impl.solver.kie.KieSolverAssemblerService

Exception in thread "main" java.lang.ExceptionInInitializerError
at org.kie.api.internal.utils.ServiceRegistry.getInstance(ServiceRegistry.java:27)
at org.kie.api.KieServices$Factory$LazyHolder.<clinit>(KieServices.java:332)
at org.kie.api.KieServices$Factory.get(KieServices.java:339)
at org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildDroolsScoreDirectorFactory(ScoreDirectorFactoryConfig.java:499)
at org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildScoreDirectorFactory(ScoreDirectorFactoryConfig.java:350)
at org.optaplanner.core.config.solver.SolverConfig.buildSolver(SolverConfig.java:255)
at org.optaplanner.core.impl.solver.AbstractSolverFactory.buildSolver(AbstractSolverFactory.java:61)
at com.abc.planner.app.UavRoutingApp.<init>(UavRoutingApp.java:57)
at com.abc.planner.app.UavRoutingApp.main(UavRoutingApp.java:110)
Caused by: java.lang.RuntimeException: Child services [org.kie.api.internal.assembler.KieAssemblers] have no parent
at org.kie.api.internal.utils.ServiceDiscoveryImpl.buildMap(ServiceDiscoveryImpl.java:180)
at org.kie.api.internal.utils.ServiceDiscoveryImpl.getServices(ServiceDiscoveryImpl.java:97)
at org.kie.api.internal.utils.ServiceRegistryImpl.<init>(ServiceRegistryImpl.java:36)
at org.kie.api.internal.utils.ServiceRegistryImpl$LazyHolder.<clinit>(ServiceRegistryImpl.java:32)
... 9 more


I have looked into Stackoverflow questions but was unable to find a solution that resolved it.



Here is a copy of my POM file.



<?xml version="1.0" encoding="UTF-8"?>

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.abc</groupId>
<artifactId>proj_xyz</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>

<name>comma</name>
<url>http://www.barnstormresearch.com</url>

<!-- see https://www.optaplanner.org/download/download.html for planner version and mvn dependency
-->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.optaplanner</groupId>
<artifactId>optaplanner-core</artifactId>
<version>7.13.0.Final</version>
</dependency>
<!--dependency>
<groupId>org.optaplanner</groupId>
<artifactId>optaplanner-persistence-common</artifactId>
<version>7.13.0.Final</version>
</dependency-->
<dependency><!-- Most examples use the XStream integration -->
<groupId>org.optaplanner</groupId>
<artifactId>optaplanner-persistence-xstream</artifactId>
<version>7.13.0.Final</version>
</dependency>
<!--dependency>
<groupId>org.optaplanner</groupId>
<artifactId>optaplanner-benchmark</artifactId>
<version>7.13.0.Final</version>
</dependency-->
<!--dependency>
<groupId>org.kie</groupId>
<artifactId>kie-api</artifactId>
<version>7.12.0.Final</version>
</dependency>
<dependency>
<groupId>org.drools</groupId>
<artifactId>drools-decisiontables</artifactId>
<version>7.12.0.Final</version>
<scope>runtime</scope>
</dependency-->
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>20.0</version>
</dependency>
<!-- Logging -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.6.4</version>
</dependency>
</dependencies>

<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
</resources>
<sourceDirectory>src/main/java</sourceDirectory>

<plugins>
<plugin>
<artifactId>maven-clean-plugin</artifactId>
<version>3.0.0</version>
</plugin>
<!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<artifactId>maven-resources-plugin</artifactId>
<version>3.0.2</version>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.7.0</version>
<!-- set the java version -->
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.20.1</version>
</plugin>
<!--plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
</plugin-->
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>3.1.0</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>
com.abc.planner.app.UavRoutingApp
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
</configuration>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>



It is executing from the IDE. I have extracted the jar files and found only 1 META_INF/kie.conf



Any ideas are really appreciated.



Thanks










share|improve this question




























    up vote
    0
    down vote

    favorite












    I am building a project using optaplanner jar to solve a vehicle routing problem. After building the jar, I am unable to invoke the main class and this is the error I get:



    513 [main] INFO org.kie.api.internal.utils.ServiceDiscoveryImpl - Loading kie.conf from  jar:file:/Users/meena/Documents/SourceCode/Comma_code/comma_code/sources/target/comma-1.0-SNAPSHOT-jar-with-dependencies.jar!/META-INF/kie.conf in classloader sun.misc.Launcher$AppClassLoader@55f96302
    515 [main] INFO org.kie.api.internal.utils.ServiceDiscoveryImpl - Adding Service +org.optaplanner.core.impl.solver.kie.KieSolverAssemblerService

    Exception in thread "main" java.lang.ExceptionInInitializerError
    at org.kie.api.internal.utils.ServiceRegistry.getInstance(ServiceRegistry.java:27)
    at org.kie.api.KieServices$Factory$LazyHolder.<clinit>(KieServices.java:332)
    at org.kie.api.KieServices$Factory.get(KieServices.java:339)
    at org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildDroolsScoreDirectorFactory(ScoreDirectorFactoryConfig.java:499)
    at org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildScoreDirectorFactory(ScoreDirectorFactoryConfig.java:350)
    at org.optaplanner.core.config.solver.SolverConfig.buildSolver(SolverConfig.java:255)
    at org.optaplanner.core.impl.solver.AbstractSolverFactory.buildSolver(AbstractSolverFactory.java:61)
    at com.abc.planner.app.UavRoutingApp.<init>(UavRoutingApp.java:57)
    at com.abc.planner.app.UavRoutingApp.main(UavRoutingApp.java:110)
    Caused by: java.lang.RuntimeException: Child services [org.kie.api.internal.assembler.KieAssemblers] have no parent
    at org.kie.api.internal.utils.ServiceDiscoveryImpl.buildMap(ServiceDiscoveryImpl.java:180)
    at org.kie.api.internal.utils.ServiceDiscoveryImpl.getServices(ServiceDiscoveryImpl.java:97)
    at org.kie.api.internal.utils.ServiceRegistryImpl.<init>(ServiceRegistryImpl.java:36)
    at org.kie.api.internal.utils.ServiceRegistryImpl$LazyHolder.<clinit>(ServiceRegistryImpl.java:32)
    ... 9 more


    I have looked into Stackoverflow questions but was unable to find a solution that resolved it.



    Here is a copy of my POM file.



    <?xml version="1.0" encoding="UTF-8"?>

    <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>com.abc</groupId>
    <artifactId>proj_xyz</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>comma</name>
    <url>http://www.barnstormresearch.com</url>

    <!-- see https://www.optaplanner.org/download/download.html for planner version and mvn dependency
    -->
    <dependencies>
    <dependency>
    <groupId>junit</groupId>
    <artifactId>junit</artifactId>
    <version>4.11</version>
    <scope>test</scope>
    </dependency>
    <dependency>
    <groupId>org.optaplanner</groupId>
    <artifactId>optaplanner-core</artifactId>
    <version>7.13.0.Final</version>
    </dependency>
    <!--dependency>
    <groupId>org.optaplanner</groupId>
    <artifactId>optaplanner-persistence-common</artifactId>
    <version>7.13.0.Final</version>
    </dependency-->
    <dependency><!-- Most examples use the XStream integration -->
    <groupId>org.optaplanner</groupId>
    <artifactId>optaplanner-persistence-xstream</artifactId>
    <version>7.13.0.Final</version>
    </dependency>
    <!--dependency>
    <groupId>org.optaplanner</groupId>
    <artifactId>optaplanner-benchmark</artifactId>
    <version>7.13.0.Final</version>
    </dependency-->
    <!--dependency>
    <groupId>org.kie</groupId>
    <artifactId>kie-api</artifactId>
    <version>7.12.0.Final</version>
    </dependency>
    <dependency>
    <groupId>org.drools</groupId>
    <artifactId>drools-decisiontables</artifactId>
    <version>7.12.0.Final</version>
    <scope>runtime</scope>
    </dependency-->
    <dependency>
    <groupId>commons-io</groupId>
    <artifactId>commons-io</artifactId>
    <version>2.6</version>
    </dependency>
    <dependency>
    <groupId>com.google.guava</groupId>
    <artifactId>guava</artifactId>
    <version>20.0</version>
    </dependency>
    <!-- Logging -->
    <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-api</artifactId>
    <version>1.7.25</version>
    </dependency>
    <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>1.6.4</version>
    </dependency>
    </dependencies>

    <build>
    <resources>
    <resource>
    <directory>src/main/resources</directory>
    <includes>
    <include>**/*</include>
    </includes>
    </resource>
    </resources>
    <sourceDirectory>src/main/java</sourceDirectory>

    <plugins>
    <plugin>
    <artifactId>maven-clean-plugin</artifactId>
    <version>3.0.0</version>
    </plugin>
    <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
    <plugin>
    <artifactId>maven-resources-plugin</artifactId>
    <version>3.0.2</version>
    </plugin>
    <plugin>
    <artifactId>maven-compiler-plugin</artifactId>
    <version>3.7.0</version>
    <!-- set the java version -->
    <configuration>
    <source>1.8</source>
    <target>1.8</target>
    </configuration>
    </plugin>
    <plugin>
    <artifactId>maven-surefire-plugin</artifactId>
    <version>2.20.1</version>
    </plugin>
    <!--plugin>
    <artifactId>maven-jar-plugin</artifactId>
    <version>3.0.2</version>
    </plugin-->
    <plugin>
    <artifactId>maven-install-plugin</artifactId>
    <version>2.5.2</version>
    </plugin>
    <plugin>
    <artifactId>maven-deploy-plugin</artifactId>
    <version>2.8.2</version>
    </plugin>
    <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>3.1.0</version>
    <configuration>
    <archive>
    <manifest>
    <addClasspath>true</addClasspath>
    <mainClass>
    com.abc.planner.app.UavRoutingApp
    </mainClass>
    </manifest>
    </archive>
    <descriptorRefs>
    <descriptorRef>jar-with-dependencies</descriptorRef>
    </descriptorRefs>
    </configuration>
    <executions>
    <execution>
    <id>make-assembly</id>
    <phase>package</phase>
    <goals>
    <goal>single</goal>
    </goals>
    </execution>
    </executions>
    </plugin>
    </plugins>
    </build>



    It is executing from the IDE. I have extracted the jar files and found only 1 META_INF/kie.conf



    Any ideas are really appreciated.



    Thanks










    share|improve this question


























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I am building a project using optaplanner jar to solve a vehicle routing problem. After building the jar, I am unable to invoke the main class and this is the error I get:



      513 [main] INFO org.kie.api.internal.utils.ServiceDiscoveryImpl - Loading kie.conf from  jar:file:/Users/meena/Documents/SourceCode/Comma_code/comma_code/sources/target/comma-1.0-SNAPSHOT-jar-with-dependencies.jar!/META-INF/kie.conf in classloader sun.misc.Launcher$AppClassLoader@55f96302
      515 [main] INFO org.kie.api.internal.utils.ServiceDiscoveryImpl - Adding Service +org.optaplanner.core.impl.solver.kie.KieSolverAssemblerService

      Exception in thread "main" java.lang.ExceptionInInitializerError
      at org.kie.api.internal.utils.ServiceRegistry.getInstance(ServiceRegistry.java:27)
      at org.kie.api.KieServices$Factory$LazyHolder.<clinit>(KieServices.java:332)
      at org.kie.api.KieServices$Factory.get(KieServices.java:339)
      at org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildDroolsScoreDirectorFactory(ScoreDirectorFactoryConfig.java:499)
      at org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildScoreDirectorFactory(ScoreDirectorFactoryConfig.java:350)
      at org.optaplanner.core.config.solver.SolverConfig.buildSolver(SolverConfig.java:255)
      at org.optaplanner.core.impl.solver.AbstractSolverFactory.buildSolver(AbstractSolverFactory.java:61)
      at com.abc.planner.app.UavRoutingApp.<init>(UavRoutingApp.java:57)
      at com.abc.planner.app.UavRoutingApp.main(UavRoutingApp.java:110)
      Caused by: java.lang.RuntimeException: Child services [org.kie.api.internal.assembler.KieAssemblers] have no parent
      at org.kie.api.internal.utils.ServiceDiscoveryImpl.buildMap(ServiceDiscoveryImpl.java:180)
      at org.kie.api.internal.utils.ServiceDiscoveryImpl.getServices(ServiceDiscoveryImpl.java:97)
      at org.kie.api.internal.utils.ServiceRegistryImpl.<init>(ServiceRegistryImpl.java:36)
      at org.kie.api.internal.utils.ServiceRegistryImpl$LazyHolder.<clinit>(ServiceRegistryImpl.java:32)
      ... 9 more


      I have looked into Stackoverflow questions but was unable to find a solution that resolved it.



      Here is a copy of my POM file.



      <?xml version="1.0" encoding="UTF-8"?>

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>

      <groupId>com.abc</groupId>
      <artifactId>proj_xyz</artifactId>
      <version>1.0-SNAPSHOT</version>
      <packaging>jar</packaging>

      <name>comma</name>
      <url>http://www.barnstormresearch.com</url>

      <!-- see https://www.optaplanner.org/download/download.html for planner version and mvn dependency
      -->
      <dependencies>
      <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-core</artifactId>
      <version>7.13.0.Final</version>
      </dependency>
      <!--dependency>
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-persistence-common</artifactId>
      <version>7.13.0.Final</version>
      </dependency-->
      <dependency><!-- Most examples use the XStream integration -->
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-persistence-xstream</artifactId>
      <version>7.13.0.Final</version>
      </dependency>
      <!--dependency>
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-benchmark</artifactId>
      <version>7.13.0.Final</version>
      </dependency-->
      <!--dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-api</artifactId>
      <version>7.12.0.Final</version>
      </dependency>
      <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-decisiontables</artifactId>
      <version>7.12.0.Final</version>
      <scope>runtime</scope>
      </dependency-->
      <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.6</version>
      </dependency>
      <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>20.0</version>
      </dependency>
      <!-- Logging -->
      <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.25</version>
      </dependency>
      <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.6.4</version>
      </dependency>
      </dependencies>

      <build>
      <resources>
      <resource>
      <directory>src/main/resources</directory>
      <includes>
      <include>**/*</include>
      </includes>
      </resource>
      </resources>
      <sourceDirectory>src/main/java</sourceDirectory>

      <plugins>
      <plugin>
      <artifactId>maven-clean-plugin</artifactId>
      <version>3.0.0</version>
      </plugin>
      <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
      <plugin>
      <artifactId>maven-resources-plugin</artifactId>
      <version>3.0.2</version>
      </plugin>
      <plugin>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.7.0</version>
      <!-- set the java version -->
      <configuration>
      <source>1.8</source>
      <target>1.8</target>
      </configuration>
      </plugin>
      <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.20.1</version>
      </plugin>
      <!--plugin>
      <artifactId>maven-jar-plugin</artifactId>
      <version>3.0.2</version>
      </plugin-->
      <plugin>
      <artifactId>maven-install-plugin</artifactId>
      <version>2.5.2</version>
      </plugin>
      <plugin>
      <artifactId>maven-deploy-plugin</artifactId>
      <version>2.8.2</version>
      </plugin>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-assembly-plugin</artifactId>
      <version>3.1.0</version>
      <configuration>
      <archive>
      <manifest>
      <addClasspath>true</addClasspath>
      <mainClass>
      com.abc.planner.app.UavRoutingApp
      </mainClass>
      </manifest>
      </archive>
      <descriptorRefs>
      <descriptorRef>jar-with-dependencies</descriptorRef>
      </descriptorRefs>
      </configuration>
      <executions>
      <execution>
      <id>make-assembly</id>
      <phase>package</phase>
      <goals>
      <goal>single</goal>
      </goals>
      </execution>
      </executions>
      </plugin>
      </plugins>
      </build>



      It is executing from the IDE. I have extracted the jar files and found only 1 META_INF/kie.conf



      Any ideas are really appreciated.



      Thanks










      share|improve this question















      I am building a project using optaplanner jar to solve a vehicle routing problem. After building the jar, I am unable to invoke the main class and this is the error I get:



      513 [main] INFO org.kie.api.internal.utils.ServiceDiscoveryImpl - Loading kie.conf from  jar:file:/Users/meena/Documents/SourceCode/Comma_code/comma_code/sources/target/comma-1.0-SNAPSHOT-jar-with-dependencies.jar!/META-INF/kie.conf in classloader sun.misc.Launcher$AppClassLoader@55f96302
      515 [main] INFO org.kie.api.internal.utils.ServiceDiscoveryImpl - Adding Service +org.optaplanner.core.impl.solver.kie.KieSolverAssemblerService

      Exception in thread "main" java.lang.ExceptionInInitializerError
      at org.kie.api.internal.utils.ServiceRegistry.getInstance(ServiceRegistry.java:27)
      at org.kie.api.KieServices$Factory$LazyHolder.<clinit>(KieServices.java:332)
      at org.kie.api.KieServices$Factory.get(KieServices.java:339)
      at org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildDroolsScoreDirectorFactory(ScoreDirectorFactoryConfig.java:499)
      at org.optaplanner.core.config.score.director.ScoreDirectorFactoryConfig.buildScoreDirectorFactory(ScoreDirectorFactoryConfig.java:350)
      at org.optaplanner.core.config.solver.SolverConfig.buildSolver(SolverConfig.java:255)
      at org.optaplanner.core.impl.solver.AbstractSolverFactory.buildSolver(AbstractSolverFactory.java:61)
      at com.abc.planner.app.UavRoutingApp.<init>(UavRoutingApp.java:57)
      at com.abc.planner.app.UavRoutingApp.main(UavRoutingApp.java:110)
      Caused by: java.lang.RuntimeException: Child services [org.kie.api.internal.assembler.KieAssemblers] have no parent
      at org.kie.api.internal.utils.ServiceDiscoveryImpl.buildMap(ServiceDiscoveryImpl.java:180)
      at org.kie.api.internal.utils.ServiceDiscoveryImpl.getServices(ServiceDiscoveryImpl.java:97)
      at org.kie.api.internal.utils.ServiceRegistryImpl.<init>(ServiceRegistryImpl.java:36)
      at org.kie.api.internal.utils.ServiceRegistryImpl$LazyHolder.<clinit>(ServiceRegistryImpl.java:32)
      ... 9 more


      I have looked into Stackoverflow questions but was unable to find a solution that resolved it.



      Here is a copy of my POM file.



      <?xml version="1.0" encoding="UTF-8"?>

      <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
      <modelVersion>4.0.0</modelVersion>

      <groupId>com.abc</groupId>
      <artifactId>proj_xyz</artifactId>
      <version>1.0-SNAPSHOT</version>
      <packaging>jar</packaging>

      <name>comma</name>
      <url>http://www.barnstormresearch.com</url>

      <!-- see https://www.optaplanner.org/download/download.html for planner version and mvn dependency
      -->
      <dependencies>
      <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>4.11</version>
      <scope>test</scope>
      </dependency>
      <dependency>
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-core</artifactId>
      <version>7.13.0.Final</version>
      </dependency>
      <!--dependency>
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-persistence-common</artifactId>
      <version>7.13.0.Final</version>
      </dependency-->
      <dependency><!-- Most examples use the XStream integration -->
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-persistence-xstream</artifactId>
      <version>7.13.0.Final</version>
      </dependency>
      <!--dependency>
      <groupId>org.optaplanner</groupId>
      <artifactId>optaplanner-benchmark</artifactId>
      <version>7.13.0.Final</version>
      </dependency-->
      <!--dependency>
      <groupId>org.kie</groupId>
      <artifactId>kie-api</artifactId>
      <version>7.12.0.Final</version>
      </dependency>
      <dependency>
      <groupId>org.drools</groupId>
      <artifactId>drools-decisiontables</artifactId>
      <version>7.12.0.Final</version>
      <scope>runtime</scope>
      </dependency-->
      <dependency>
      <groupId>commons-io</groupId>
      <artifactId>commons-io</artifactId>
      <version>2.6</version>
      </dependency>
      <dependency>
      <groupId>com.google.guava</groupId>
      <artifactId>guava</artifactId>
      <version>20.0</version>
      </dependency>
      <!-- Logging -->
      <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-api</artifactId>
      <version>1.7.25</version>
      </dependency>
      <dependency>
      <groupId>org.slf4j</groupId>
      <artifactId>slf4j-simple</artifactId>
      <version>1.6.4</version>
      </dependency>
      </dependencies>

      <build>
      <resources>
      <resource>
      <directory>src/main/resources</directory>
      <includes>
      <include>**/*</include>
      </includes>
      </resource>
      </resources>
      <sourceDirectory>src/main/java</sourceDirectory>

      <plugins>
      <plugin>
      <artifactId>maven-clean-plugin</artifactId>
      <version>3.0.0</version>
      </plugin>
      <!-- see http://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
      <plugin>
      <artifactId>maven-resources-plugin</artifactId>
      <version>3.0.2</version>
      </plugin>
      <plugin>
      <artifactId>maven-compiler-plugin</artifactId>
      <version>3.7.0</version>
      <!-- set the java version -->
      <configuration>
      <source>1.8</source>
      <target>1.8</target>
      </configuration>
      </plugin>
      <plugin>
      <artifactId>maven-surefire-plugin</artifactId>
      <version>2.20.1</version>
      </plugin>
      <!--plugin>
      <artifactId>maven-jar-plugin</artifactId>
      <version>3.0.2</version>
      </plugin-->
      <plugin>
      <artifactId>maven-install-plugin</artifactId>
      <version>2.5.2</version>
      </plugin>
      <plugin>
      <artifactId>maven-deploy-plugin</artifactId>
      <version>2.8.2</version>
      </plugin>
      <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-assembly-plugin</artifactId>
      <version>3.1.0</version>
      <configuration>
      <archive>
      <manifest>
      <addClasspath>true</addClasspath>
      <mainClass>
      com.abc.planner.app.UavRoutingApp
      </mainClass>
      </manifest>
      </archive>
      <descriptorRefs>
      <descriptorRef>jar-with-dependencies</descriptorRef>
      </descriptorRefs>
      </configuration>
      <executions>
      <execution>
      <id>make-assembly</id>
      <phase>package</phase>
      <goals>
      <goal>single</goal>
      </goals>
      </execution>
      </executions>
      </plugin>
      </plugins>
      </build>



      It is executing from the IDE. I have extracted the jar files and found only 1 META_INF/kie.conf



      Any ideas are really appreciated.



      Thanks







      drools optaplanner






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 9 at 10:41









      Geoffrey De Smet

      14.6k53987




      14.6k53987










      asked Nov 7 at 23:02









      PSLV

      164




      164
























          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          It looks like a drools and Uber-jar(or fat-jar or one-jar) issue. I found this on the drools documentation site:



          https://docs.jboss.org/drools/release/7.14.0.Final/drools-docs/html_single/index.html#_building_and_running_drools_in_a_fat_jar



          This is a much simpler fix than some of the others suggested.



          I made the change suggested here and used the maven shade plugin to build a single jar and it works now. I am pasting my sample pom file for other users who will run into this issue:



          Add this to the maven-shade-plugin section:



          <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
          <resource>META-INF/kie.conf</resource>
          </transformer>


          My final pom.xml



          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.2.0</version>
          <executions>
          <!-- Run shade goal on package phase -->
          <execution>
          <phase>package</phase>
          <goals>
          <goal>shade</goal>
          </goals>
          <configuration>
          <transformers>
          <!-- add Main-Class to manifest file -->
          <transformer
          implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
          <mainClass>com.abc.planner.app.UavRoutingApp</mainClass>

          <!-- -Dlog4j.configurationFile=../properties/idStrikeSolver-log4j.properties -Duser.timezone="UTC" -->
          </transformer>
          <transformer
          implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
          <resource>META-INF/kie.conf</resource>
          </transformer>
          </transformers>
          </configuration>
          </execution>
          </executions>
          </plugin>


          Hope this helps others too! Thanks for your help Geoffrey.






          share|improve this answer





















          • Thanks for sharing!
            – Geoffrey De Smet
            Nov 13 at 16:45


















          up vote
          0
          down vote













          Drools and jar-with-dependencies aren't compatible AFAIK.



          Workarounds:




          • A different score calculation easy java (too slow), incremental java (too painfull), constraintstreams (coming soon).

          • Don't use jar-with-dependencies






          share|improve this answer





















          • Thanks for the response Geoffrey. I changed the pom file to use "shaded-plugin" and that is not working either. For some reason, 7.1.0 OptaPlanner works (even with jar-with-dependecies). Is there anything else I can try?
            – PSLV
            Nov 9 at 17:22













          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53199223%2foptaplanner-7-13-0-cant-be-executed-from-a-jar-file%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          1
          down vote













          It looks like a drools and Uber-jar(or fat-jar or one-jar) issue. I found this on the drools documentation site:



          https://docs.jboss.org/drools/release/7.14.0.Final/drools-docs/html_single/index.html#_building_and_running_drools_in_a_fat_jar



          This is a much simpler fix than some of the others suggested.



          I made the change suggested here and used the maven shade plugin to build a single jar and it works now. I am pasting my sample pom file for other users who will run into this issue:



          Add this to the maven-shade-plugin section:



          <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
          <resource>META-INF/kie.conf</resource>
          </transformer>


          My final pom.xml



          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.2.0</version>
          <executions>
          <!-- Run shade goal on package phase -->
          <execution>
          <phase>package</phase>
          <goals>
          <goal>shade</goal>
          </goals>
          <configuration>
          <transformers>
          <!-- add Main-Class to manifest file -->
          <transformer
          implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
          <mainClass>com.abc.planner.app.UavRoutingApp</mainClass>

          <!-- -Dlog4j.configurationFile=../properties/idStrikeSolver-log4j.properties -Duser.timezone="UTC" -->
          </transformer>
          <transformer
          implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
          <resource>META-INF/kie.conf</resource>
          </transformer>
          </transformers>
          </configuration>
          </execution>
          </executions>
          </plugin>


          Hope this helps others too! Thanks for your help Geoffrey.






          share|improve this answer





















          • Thanks for sharing!
            – Geoffrey De Smet
            Nov 13 at 16:45















          up vote
          1
          down vote













          It looks like a drools and Uber-jar(or fat-jar or one-jar) issue. I found this on the drools documentation site:



          https://docs.jboss.org/drools/release/7.14.0.Final/drools-docs/html_single/index.html#_building_and_running_drools_in_a_fat_jar



          This is a much simpler fix than some of the others suggested.



          I made the change suggested here and used the maven shade plugin to build a single jar and it works now. I am pasting my sample pom file for other users who will run into this issue:



          Add this to the maven-shade-plugin section:



          <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
          <resource>META-INF/kie.conf</resource>
          </transformer>


          My final pom.xml



          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.2.0</version>
          <executions>
          <!-- Run shade goal on package phase -->
          <execution>
          <phase>package</phase>
          <goals>
          <goal>shade</goal>
          </goals>
          <configuration>
          <transformers>
          <!-- add Main-Class to manifest file -->
          <transformer
          implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
          <mainClass>com.abc.planner.app.UavRoutingApp</mainClass>

          <!-- -Dlog4j.configurationFile=../properties/idStrikeSolver-log4j.properties -Duser.timezone="UTC" -->
          </transformer>
          <transformer
          implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
          <resource>META-INF/kie.conf</resource>
          </transformer>
          </transformers>
          </configuration>
          </execution>
          </executions>
          </plugin>


          Hope this helps others too! Thanks for your help Geoffrey.






          share|improve this answer





















          • Thanks for sharing!
            – Geoffrey De Smet
            Nov 13 at 16:45













          up vote
          1
          down vote










          up vote
          1
          down vote









          It looks like a drools and Uber-jar(or fat-jar or one-jar) issue. I found this on the drools documentation site:



          https://docs.jboss.org/drools/release/7.14.0.Final/drools-docs/html_single/index.html#_building_and_running_drools_in_a_fat_jar



          This is a much simpler fix than some of the others suggested.



          I made the change suggested here and used the maven shade plugin to build a single jar and it works now. I am pasting my sample pom file for other users who will run into this issue:



          Add this to the maven-shade-plugin section:



          <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
          <resource>META-INF/kie.conf</resource>
          </transformer>


          My final pom.xml



          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.2.0</version>
          <executions>
          <!-- Run shade goal on package phase -->
          <execution>
          <phase>package</phase>
          <goals>
          <goal>shade</goal>
          </goals>
          <configuration>
          <transformers>
          <!-- add Main-Class to manifest file -->
          <transformer
          implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
          <mainClass>com.abc.planner.app.UavRoutingApp</mainClass>

          <!-- -Dlog4j.configurationFile=../properties/idStrikeSolver-log4j.properties -Duser.timezone="UTC" -->
          </transformer>
          <transformer
          implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
          <resource>META-INF/kie.conf</resource>
          </transformer>
          </transformers>
          </configuration>
          </execution>
          </executions>
          </plugin>


          Hope this helps others too! Thanks for your help Geoffrey.






          share|improve this answer












          It looks like a drools and Uber-jar(or fat-jar or one-jar) issue. I found this on the drools documentation site:



          https://docs.jboss.org/drools/release/7.14.0.Final/drools-docs/html_single/index.html#_building_and_running_drools_in_a_fat_jar



          This is a much simpler fix than some of the others suggested.



          I made the change suggested here and used the maven shade plugin to build a single jar and it works now. I am pasting my sample pom file for other users who will run into this issue:



          Add this to the maven-shade-plugin section:



          <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
          <resource>META-INF/kie.conf</resource>
          </transformer>


          My final pom.xml



          <plugin>
          <groupId>org.apache.maven.plugins</groupId>
          <artifactId>maven-shade-plugin</artifactId>
          <version>3.2.0</version>
          <executions>
          <!-- Run shade goal on package phase -->
          <execution>
          <phase>package</phase>
          <goals>
          <goal>shade</goal>
          </goals>
          <configuration>
          <transformers>
          <!-- add Main-Class to manifest file -->
          <transformer
          implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
          <mainClass>com.abc.planner.app.UavRoutingApp</mainClass>

          <!-- -Dlog4j.configurationFile=../properties/idStrikeSolver-log4j.properties -Duser.timezone="UTC" -->
          </transformer>
          <transformer
          implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
          <resource>META-INF/kie.conf</resource>
          </transformer>
          </transformers>
          </configuration>
          </execution>
          </executions>
          </plugin>


          Hope this helps others too! Thanks for your help Geoffrey.







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 13 at 3:13









          PSLV

          164




          164












          • Thanks for sharing!
            – Geoffrey De Smet
            Nov 13 at 16:45


















          • Thanks for sharing!
            – Geoffrey De Smet
            Nov 13 at 16:45
















          Thanks for sharing!
          – Geoffrey De Smet
          Nov 13 at 16:45




          Thanks for sharing!
          – Geoffrey De Smet
          Nov 13 at 16:45












          up vote
          0
          down vote













          Drools and jar-with-dependencies aren't compatible AFAIK.



          Workarounds:




          • A different score calculation easy java (too slow), incremental java (too painfull), constraintstreams (coming soon).

          • Don't use jar-with-dependencies






          share|improve this answer





















          • Thanks for the response Geoffrey. I changed the pom file to use "shaded-plugin" and that is not working either. For some reason, 7.1.0 OptaPlanner works (even with jar-with-dependecies). Is there anything else I can try?
            – PSLV
            Nov 9 at 17:22

















          up vote
          0
          down vote













          Drools and jar-with-dependencies aren't compatible AFAIK.



          Workarounds:




          • A different score calculation easy java (too slow), incremental java (too painfull), constraintstreams (coming soon).

          • Don't use jar-with-dependencies






          share|improve this answer





















          • Thanks for the response Geoffrey. I changed the pom file to use "shaded-plugin" and that is not working either. For some reason, 7.1.0 OptaPlanner works (even with jar-with-dependecies). Is there anything else I can try?
            – PSLV
            Nov 9 at 17:22















          up vote
          0
          down vote










          up vote
          0
          down vote









          Drools and jar-with-dependencies aren't compatible AFAIK.



          Workarounds:




          • A different score calculation easy java (too slow), incremental java (too painfull), constraintstreams (coming soon).

          • Don't use jar-with-dependencies






          share|improve this answer












          Drools and jar-with-dependencies aren't compatible AFAIK.



          Workarounds:




          • A different score calculation easy java (too slow), incremental java (too painfull), constraintstreams (coming soon).

          • Don't use jar-with-dependencies







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Nov 9 at 10:43









          Geoffrey De Smet

          14.6k53987




          14.6k53987












          • Thanks for the response Geoffrey. I changed the pom file to use "shaded-plugin" and that is not working either. For some reason, 7.1.0 OptaPlanner works (even with jar-with-dependecies). Is there anything else I can try?
            – PSLV
            Nov 9 at 17:22




















          • Thanks for the response Geoffrey. I changed the pom file to use "shaded-plugin" and that is not working either. For some reason, 7.1.0 OptaPlanner works (even with jar-with-dependecies). Is there anything else I can try?
            – PSLV
            Nov 9 at 17:22


















          Thanks for the response Geoffrey. I changed the pom file to use "shaded-plugin" and that is not working either. For some reason, 7.1.0 OptaPlanner works (even with jar-with-dependecies). Is there anything else I can try?
          – PSLV
          Nov 9 at 17:22






          Thanks for the response Geoffrey. I changed the pom file to use "shaded-plugin" and that is not working either. For some reason, 7.1.0 OptaPlanner works (even with jar-with-dependecies). Is there anything else I can try?
          – PSLV
          Nov 9 at 17:22




















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53199223%2foptaplanner-7-13-0-cant-be-executed-from-a-jar-file%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          How to change which sound is reproduced for terminal bell?

          Title Spacing in Bjornstrup Chapter, Removing Chapter Number From Contents

          Can I use Tabulator js library in my java Spring + Thymeleaf project?