Hi,
I am trying use XgBoost along with Java Maven project, it works when I directly call main class,but it throws below error when I create jar using maven build.
Exception in thread "main" java.lang.IllegalStateException: Unable to load XGBooster
at hex.genmodel.algos.xgboost.XGBoostNativeMojoModel.makeBooster(XGBoostNativeMojoModel.java:36)
at hex.genmodel.algos.xgboost.XGBoostNativeMojoModel.<init>(XGBoostNativeMojoModel.java:29)
at hex.genmodel.algos.xgboost.XGBoostMojoReader.makeModel(XGBoostMojoReader.java:41)
at hex.genmodel.algos.xgboost.XGBoostMojoReader.makeModel(XGBoostMojoReader.java:10)
at hex.genmodel.ModelMojoReader.readAll(ModelMojoReader.java:145)
at hex.genmodel.ModelMojoReader.readFrom(ModelMojoReader.java:34)
at hex.genmodel.MojoModel.load(MojoModel.java:37)
at com.eliprio.pipeline.model.ModelScoring.extractModelParameters(ModelScoring.java:109)
at com.eliprio.pipeline.model.ModelScoring.main(ModelScoring.java:78)
Caused by: ml.dmlc.xgboost4j.java.XGBoostError
at ml.dmlc.xgboost4j.java.Booster.newKryoBooster(Booster.java:85)
at ml.dmlc.xgboost4j.java.Booster.newBooster(Booster.java:74)
at ml.dmlc.xgboost4j.java.Booster.loadModel(Booster.java:135)
at ml.dmlc.xgboost4j.java.BoosterHelper.loadModel(BoosterHelper.java:14)
at hex.genmodel.algos.xgboost.XGBoostNativeMojoModel.makeBooster(XGBoostNativeMojoModel.java:34)
... 8 more
Below is the maven settings
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
<configuration>
<archive>
<manifest>
<mainClass>
{Main class}
</mainClass>
</manifest>
</archive>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<appendAssemblyId>false</appendAssemblyId>
</configuration>
</execution>
</executions>
</plugin>
I have used Xgboost library which has windows dll.