Forum Discussion

soverbosch's avatar
soverbosch
Occasional Contributor
12 years ago

Extension and NoClassDefFoundError

Hi,

I've created a jar which contains some classes to create and sign a SAML assertion, the class is just running fine outside SoapUI. Now when I place the jar (and it dependencies) in the bin/ext folder and try to use this library then I get an annoying java.lang.NoClassDefFoundError: org/apache/velocity/app/Velocity. The strange thing is that at start up of SoapUI I do see the velocity.jar being loaded and this velocity.jar does contain the class Velocity in the correct package structure:

Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/not-yet-commons-ssl-0.3.9.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/xmltooling-1.4.1.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/xmlsec-1.5.6.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/commons-codec-1.7.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/serializer-2.7.1.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/xalan-2.7.1.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/commons-logging-1.1.1.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/commons-collections-3.2.1.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/bcprov-jdk15-1.46.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/soapui-extension-saml-1.0.1-SNAPSHOT.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/commons-lang-2.6.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/openws-1.5.1.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/slf4j-jdk14-1.5.6.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/xml-apis-2.11.0.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/opensaml-2.6.1.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/xml-resolver-1.2.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/slf4j-api-1.5.6.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/xercesImpl-2.10.0.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/joda-time-2.2.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/esapi-2.0.1.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/commons-httpclient-3.1.jar] to extensions classpath
Thu Mar 27 08:18:39 CET 2014:INFO:Adding [/home/soverbosch/SmartBear/SoapUI-4.6.4/bin/ext/velocity-1.7.jar] to extensions classpath

So my question is if someone has had this problem before and has a solution to this?

Br,

Sarris

1 Reply

  • soverbosch's avatar
    soverbosch
    Occasional Contributor
    Ok, found the problem. SoapUI itself is using opensaml-2.4.1.jar which seams to be causing the problem. I probably should revert back to using opensaml-2.4.1 instead of opensaml-2.6.1 .... but when doing this I get the same error message and the dirty solution is copying the velocity.jar to the lib directory does work >:( IMO this means the extension classpath is prepended to the classpath which makes the classpath searched first for a library and then after the extension classpath is searched for. Shouldn't this be:
    - first search on the extension classpath
    - second search on the classpath