Thanks Jörg for your answer. I'm currently trying to do that: a custom bundle by hand.
I get the following resource content: > - xstream-1.4.7.jar > - jettison-1.0.1.jar to make my own bundle. I share the bundle.jar::/META-INF/MANIFEST.MF on gist https://gist.github.com/anonymous/d10599202ec41ee1992a be warn that I didn't report all xtream package here (bundle export package ).. At runtime I got the following exception: Exception in thread "Thread-697" java.lang.NoClassDefFoundError: java.util.regex.Pattern at com.thoughtworks.xstream.XStream.<clinit>(Unknown Source) at java.lang.J9VMInternals.initializeImpl(Native Method) at java.lang.J9VMInternals.initialize(Unknown Source) (...) I check "java.util.regex.Pattern" which is available since 1.4... but this class seems not available on J9 JVM. I will maybe try to test an older version of xstream. Regards Brice 2014-12-09 13:59 GMT+01:00 Jörg Schaible > Hello Brice, > > Brice Vandeputte wrote: > > > Hi all, > > > > I'm trying to use XStream (JSON mode) with the following constraints: > > > > - jdk 1.4, > > - Prosyst OSGi container. > > > > > > In the official "news.html" page, I read (nov 2011): > >> Anyone who needs a version for Java 1.4.2 can build it easily from > > source, this build is still supported and part of CI. > > > > So I get the xstream source and I compile it using JDK 1.4.2_19 and maven > > 2.0.11 (with success). > > In my target bundle application I just inline the following ressources > > from the distribution : > > - xstream-1.4.7.jar > > - jettison-1.0.1.jar > > - stax-1.2.0.jar > > - stax-api-1.0.1.jar > > > > When I start my application, I Got the following result : > > > org.osgi.framework.BundleException: Can't Resolve poc-bundle : > > com.ibm.xml.xlxp.api.stax > > > > So my questions are: > > - is xstream always compliant with jdk 1.4 ? > > Yes, otherwise you would not have been able to build it. The unit tests are > quite extensive. OSGi support is a different story though. > > > - do you know how to solve this dependency error ? > > - what's wrong in the way I use xstream ? > > The reported error message indicates that this is an error reported by > OSGi. > My OSGi knowledge is very limited, therefore I'd check the manifests of the > jars from above for this bundle requirement. Note, that no OSGi entries are > added to XStream's manifest if you build with Java 1.4 (mainly because the > Felix bundle-plugin requires a Java 5 runtime), you will have to handcraft > a > manifest on your own. > > Cheers, > Jörg > >