Goobi CLI: Class not found exception
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Goobi.Production |
Fix Released
|
Medium
|
Unassigned | ||
1.7 |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Running Goobi client creates a Class-Not-
/usr/bin/java -Xmx256m -jar /home/goobi/
Exception in thread "main" java.lang.
org/apache/
Caused by: java.lang.
org.apache.
at java.net.
at java.security.
at java.net.
at java.lang.
at sun.misc.
at java.lang.
Could not find the main class:
org.goobi.
Looks like a problem in Java class path loading mechanism or something relevant to class path.
Related branches
- Henning Gerhardt: Approve
- Matthias Ronge: Pending requested
- zeutschel: Pending requested
-
Diff: 29 lines (+1/-10)1 file modifiedbuild.xml (+1/-10)
Changed in goobi-production: | |
status: | New → Confirmed |
Changed in goobi-production: | |
importance: | Undecided → Medium |
Changed in goobi-production: | |
status: | Fix Committed → Fix Released |
Nasty class loading issue here. :-/ It appears that the Class-Path manifest value is never used to load resources form inside the jar. See: http:// docs.oracle. com/javase/ tutorial/ deployment/ jar/downman. html
"Note: The Class-Path header points to classes or JAR files on the local network, not JAR files within the JAR file or classes accessible over internet protocols. To load classes in JAR files within a JAR file into the class path, you must write custom code to load those classes. For example, if MyJar.jar contains another JAR file called MyUtils.jar, you cannot use the Class-Path header in MyJar.jar's manifest to load classes in MyUtils.jar into the class path. "
Special class loading has to be implemented to make it work like expected. Until then one has to provide the extracted libraries near the jar.
NOTE: Eclipse "Standalone CLI" builds use a custom mechanism to run those kind of JARed applications.