You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by jerome moliere <je...@gmail.com> on 2012/01/02 11:18:44 UTC

Advice for library handling XML marshalling/unmarshalling

Hi all,
excuse me for the out of subject , but I 'm facing clever problems of
Classloaders with a bundle using Castor XML under Felix (works well
under Equinox)  Have you ever used XStream with your OSGi bundles ?
For those interested with the error I get a NoClassDefFoundError while
instantiating an Unmarshaller() , the class not found is SAXException
and I'm using a 1.6 JDK


Thanks
jerome

J.MOLIERE - Mentor/J
auteur Eyrolles
blog: http://romjethoughts.blogspot.com

Re: Advice for library handling XML marshalling/unmarshalling

Posted by Holger Hoffstätte <ho...@googlemail.com>.
On 02.01.2012 15:40, jerome moliere wrote:
> Increasing log verbosity pointed me directly to the problem, I just
> had to set the org.osgi.framework.bootdelegation property and the
> application starts

This is not such a good "solution". IIRC Equinox does bootdelegation
automatically for JDK packages (or even worse everything? don't remember),
but it's IMHO much better to explicitly import the required packages - in
this case SAX. If XStream doesn't do this (1.4.2 doesn't seem to be a
bundle) then your bundle will have to explicitly import it when embedding
XStream.
Bundles should run anywhere, and Equinox' default behaviours are very
often "supposed to be helpful", but ultimately just misleading.

-h

Re: Advice for library handling XML marshalling/unmarshalling

Posted by jerome moliere <je...@gmail.com>.
Hi all,
I'd like to thank Arjun for this very helpful answer...
Increasing log verbosity pointed me directly to the problem, I just
had to set the org.osgi.framework.bootdelegation property and the
application starts

Thanks
J.MOLIERE - Mentor/J
auteur Eyrolles
blog: http://romjethoughts.blogspot.com




2012/1/2 Arjun Panday <ar...@alcatel-lucent.com>:
> Hi Jerome,
>
> Have you tried setting
> felix.log.level=4
> in your felix configuration?
>
> It usually gives a lot more detailed information on class loading issues.
>
> Another classic approach for this kind of third party library is to embed it
> in your own bundle.
>
> -arjun
>
>
>
>
> On 01/02/2012 11:18 AM, jerome moliere wrote:
>>
>> Hi all,
>> excuse me for the out of subject , but I 'm facing clever problems of
>> Classloaders with a bundle using Castor XML under Felix (works well
>> under Equinox)  Have you ever used XStream with your OSGi bundles ?
>> For those interested with the error I get a NoClassDefFoundError while
>> instantiating an Unmarshaller() , the class not found is SAXException
>> and I'm using a 1.6 JDK
>>
>>
>> Thanks
>> jerome
>>
>> J.MOLIERE - Mentor/J
>> auteur Eyrolles
>> blog: http://romjethoughts.blogspot.com
>
>

Re: Advice for library handling XML marshalling/unmarshalling

Posted by Arjun Panday <ar...@alcatel-lucent.com>.
Hi Jerome,

Have you tried setting
felix.log.level=4
in your felix configuration?

It usually gives a lot more detailed information on class loading issues.

Another classic approach for this kind of third party library is to 
embed it in your own bundle.

-arjun



On 01/02/2012 11:18 AM, jerome moliere wrote:
> Hi all,
> excuse me for the out of subject , but I 'm facing clever problems of
> Classloaders with a bundle using Castor XML under Felix (works well
> under Equinox)  Have you ever used XStream with your OSGi bundles ?
> For those interested with the error I get a NoClassDefFoundError while
> instantiating an Unmarshaller() , the class not found is SAXException
> and I'm using a 1.6 JDK
>
>
> Thanks
> jerome
>
> J.MOLIERE - Mentor/J
> auteur Eyrolles
> blog: http://romjethoughts.blogspot.com