Closed bencomp closed 6 years ago
I cannot reproduce the problem. Neither on the master
branch nor the develop
branch I'm getting this error.
The dependencies should be loaded from the repository defined in the POM: https://github.com/AKSW/DL-Learner/blob/master/components-ext/pom.xml#L280-L307
I checked the bundle-2.2.jar in my local repository, and it contains the class BDDFactory2. It seems that something goes wrong in the initialization of this class, see the source code which contains this static class block:
static {
try {
String ex = getProperty("user.dir", ".") + getProperty("file.separator", "/");
String var11 = "/bdd-libraries/lib";
URL var12 = BDDFactory2.class.getResource(var11);
String var13 = var12.getFile();
String var14 = var13.replaceFirst("[.]jar[!].*", ".jar").replaceFirst("file:", "");
JarFile var15 = new JarFile(var14);
Enumeration entries = var15.entries();
while(entries.hasMoreElements()) {
JarEntry entry = (JarEntry)entries.nextElement();
String entryName = "/" + entry.getName();
if(entryName.startsWith(var11) && entryName.length() > var11.length() + "/".length() && entryName.substring(entryName.length() - ".so".length()).equals(".so")) {
String var9 = LoadNativeLibrary.createTempFile(entryName, ex).getName();
}
}
} catch (IOException var10) {
logger.error("Unable to load the Native Library.\n JDD will be used!");
logger.error(var10.getMessage());
StackTraceElement[] stack = var10.getStackTrace();
StackTraceElement[] f = stack;
int libraryDir = stack.length;
for(int jarPath = 0; jarPath < libraryDir; ++jarPath) {
StackTraceElement se = f[jarPath];
logger.error(se.toString());
}
}
}
Thanks for your quick response!
When I debug testCase2 in IntelliJ IDEA a NullPointerException
in the line String var13 = var12.getFile();
is said to cause the ExceptionInInitializer
. There is no directory /bdd-libraries/lib
on my system, so var12
will be null
after the assignment.
Did you install BuDDy locally by any chance, preventing the NullPointerException
?
No, I did nothing but using Maven. Giuseppe Cota, the developer of BUNDLE is looking into it.
Hi bencomp, I cannot reproduce the problem me either. Just a silly question. What OS are you using? 32 or 64 bits? Windows or Linux?
@giuseta I'm on Mac OSX, which is 64 bit. To be more complete:
$ mvn -version
Apache Maven 3.3.9 (bb52d8502b132ec0a5a3f4c09453c07478323dc5; 2015-11-10T17:41:47+01:00)
Maven home: /usr/local/Cellar/maven/3.3.9/libexec
Java version: 1.8.0_102, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.11.6", arch: "x86_64", family: "mac"
$ java -version
java version "1.8.0_102"
Java(TM) SE Runtime Environment (build 1.8.0_102-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.102-b14, mixed mode)
@giuseta Maybe there is a problem resp. a difference on MacOSX with Java and the system properties which are used to build the path.
@bencomp Can you check if the *.so
files are contained in the JAR file?
Ok. In /bdd-libraries/lib there should be some shared libraries that are automatically downloaded by means of Maven. The problem here is that there are not shared libraries for MacOSX in the Maven repository that contains these BDD libraries. I'll compile the libraries for MacOSX and add them into the repository as soon as possible.
@giuseta thanks for investigating and providing the solution!
@bencomp I've found the libraries that you need for OSX but I'm not sure whether they work (Unfortunately I'm quite sure they are 32-bit libraries, I've downloaded them from here: http://javabdd.sourceforge.net/) . I don't own a Mac and I'm trying to crosscompile on linux in order to be sure to have 64-bit libraries for OSX, but I'm encountering some difficulties, so please try again to compile DL-Learner and let me know if it works.
I worked around the issue by using a 100% Java BDD Factory in case the libraries are not correctly loaded. The performances are slightly worse when performing probabilistic reasoning but you should not have problems.
@giuseta great :) I had found that JavaBDD library too, which said I need CUDD to build. When I downloaded and built CUDD on my machine, I ended up with libcudd.a
and libcudd.la
.
The Mac OSX binary distribution of JavaBDD indeed includes libbuddy.jnilib
, but when I build JavaBDD from source I get libbdd.0.0.0.dylib
. It looks like version management was lost since 2005 :(
A pure Java solution is a safe alternative, thanks for that. This was a change in BUNDLE, correct? Will you release this change and should DL-Learner release a new (minor) minor with the new version of BUNDLE as an updated dependency? Then this issue can be resolved with the next version.
@bencomp You are correct, the change was in BUNDLE. I've already released this change. You should already be able to build DL-Leaner without changing anything
@giuseta Did you increase the version number of the BUNDLE artifact? Otherwise, @bencomp has to force an Maven update with mvn -U ...
because this dependency isn't a SNAPSHOT.
@LorenzBuehmann You are right, I didn't increase the version of BUNDLE artifact. He has to force Maven to update. Thank you for pointing that out.
When I run
mvn clean install
on the top level project, the build fails in thecomponents-ext
module with the following message (excerpt):Is there a missing (external) dependency? bundle-2.2.jar is in my Maven local repository.