i want to use StringUtils from ApacheCommons inside the execute function of a node model.
I added the libraries to buildpath and it seams to work but when i start knime an execute the node that contains the StringUtils Calls the Exception "java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils" is thrown.
Do i have to include StringUtils anywhere else than in the NodeModel class itself? Or how can i get external libraries running?
If I understand you correctly the problem is you are using commons lang not as an OSGi dependency and another StringUtils class was not found. (My bet one of the other bundles already used the usual org.apache.commons.lang bundle, so it is available, although I could be wrong.)
Cheers, gabor
PS.: I think these kind of questions are more welcome in the KNIME developers forum.
yes, i thought it would be enough to import the StringUtils package and eclipse would do the rest for me. How can i add StrungUtils as OSGi dependency?
In MANIFEST.MF you have a dependency section, there you can specify the dependencies. This one as I remember is something like org.apache.commins.lang.