I’m developing a eclipse plugin rcp and I’m running into a NoClassDefFoundError
Exception in thread 'Thread-7' java.lang.NoClassDefFoundError: org/jdom/input/SAXBuilder at org.geonames.WebService.search(WebService.java:783) at geo.GeocoderGeonames$SearchThread.run(GeocoderGeonames.java:119) Caused by: java.lang.ClassNotFoundException: org.jdom.input.SAXBuilder at org.eclipse.osgi.framework.internal.core.BundleLoader.findClassInternal(BundleLoader.java:483) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:399) at org.eclipse.osgi.framework.internal.core.BundleLoader.findClass(BundleLoader.java:387) at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:87) at java.lang.ClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClassInternal(Unknown Source) ... 2 more
The class that supposedly cannot be found is in a jar that I have added to the buildpath. I don’t get any compile error etc only this exception when the running application enters the code where this class is needed…
Is there some other place I need to add the jar
After reading this added the jar to the MANIFEST.MF, which solved the problem. As I understand it, eclipse starts several classloaders which only sees what MANIFEST.MF tells them to see and ingnores the build path…