[Question] Error with logfactory
gbonnema opened this issue · comments
When I start the application using java -jar dist/build/upm.jar
I get the error text appended to the end of this issue. I suspect it is a very simple error on my side, but do not know how to approach it. I have done the following:
- I checked that apache-commons-logging was installed (it was).
- I checked that java itself is installed (it is). I have version java-1.8.0-openjdk
- I am running Fedora 19 (most recent software).
Any pointers as to how to resolve this issue?
Kind regards, Guus Bonnema.
The error I get:
gbonnema ~ projects java upm-swing java -jar dist/build/upm.jar
Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
at com._17od.upm.util.Preferences.<clinit>(Preferences.java:40)
at com._17od.upm.gui.MainWindow$2.run(MainWindow.java:234)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:311)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 16 more
I think the problem is the "Class-Path" given in the upm.jar manifest assumes the dependant jars are in the same directory as upm.jar.
If you're looking to start upm using locally compile classfiles you can use,
ant run
Or alternatively,
java -classpath ./build:./lib/AppleJavaExtensions.jar:./lib/appbundler-1.0ea.jar:./lib/bcprov-jdk14-145.jar:./lib/commons-codec-1.3.jar:./lib/commons-httpclient-3.0.jar:./lib/commons-logging-1.1.jar:./lib/commons-validator-1.4.0.jar:./lib/jarbundler-2.1.0.jar:./lib/javacsv.jar:./lib/junit.jar com._17od.upm.gui.MainWindow
Thank you very much. doing ant run
solves the issue! I did get 2 warnings, but I suspect they are not essential as the application loaded and executed fine.
Thanks.
P.S. the warnings were (twice):
warning: 'includeantruntime' was not set, defaulting to build.sysclasspath=last; set to false for repeatable builds
Not sure whether I should take action.