Using Apache Felix, I have an OSGi component I've authored that wraps some middleware my company uses. Currently it depends on a good number of external libraries, and I appear to have run into a limit on the Bundle-classpath: parameter length. I've had to rename libraries such as commons-collections.jar to ccoll.jar.
I'm curious if anyone has any advice on working around this limitation?
Bundle-ClassPath: .,lib/log4j.jar,lib/cvfs.jar,lib/backport.jar,lib/cbeanutils.jar,lib/ccodec.jar,lib/ccoll.jar,lib/chttp.jar,lib/cjxpath.jar,lib/clang.jar,[libs redacted],lib/saaj-api.jar,lib/saaj-impl.jar,lib/Schemas.jar,lib/xbean.jar,lib/clog.jar,lib/dom4j.jar,lib/xml-apis.jar,lib/xerces.jar,lib/xalan.jar,lib/jaxp-ri.jar,lib/japi.jar,lib/mail.jar
I suppose I could get more characters by leaving off the lib/ bits, but I'm curious if this is a bug, a defined limitation, or just simply idiocy on my part.
Manifest line lengths are limited to 72 bytes as stated in http://java.sun.com/j2se/1.4.2/docs/guide/jar/jar.html. After that you will have to split the line and start a new one beginning with a space character. In this case:
Bundle-ClassPath: .,lib/log4j.jar,lib/cvfs.jar,lib/backport.jar,lib/cbea
nutils.jar,lib/ccodec.jar,lib/ccoll.jar,lib/chttp.jar,lib/cjxpath.jar,l
ib/clang.jar,[libs redacted],lib/saaj-api.jar,lib/saaj-impl.jar,lib/Sch
emas.jar,lib/xbean.jar,lib/clog.jar,lib/dom4j.jar,lib/xml-apis.jar,lib/
xerces.jar,lib/xalan.jar,lib/jaxp-ri.jar,lib/japi.jar,lib/mail.jar
Alternatively you could use a tool like BND that does things like this (and more) for you automatically.