Re: XStream and OSGi

2009-08-17 Thread David Leangen
I am also using XStream successfully in OSGi. The problem is the classic deserialization issue. Since there is not yet any standardized solution to this (what seems to me to be a) common problem, I just made my own temporary solution. For any bundle that needs to provide class information

Re: XStream and OSGi

2009-08-17 Thread Steve Lindsay
On Mon, Aug 17, 2009 at 10:57 PM, Guido Spadotto wrote: > > Question 1: Were any of you able to use XStream within an OSGi container > successfully? > We have used xstream in an osgi app. To make it work we: - added the relevant jars to the bundle that was using xstream (we only had the one bundl

Re: Excluding optional imports with OBR?

2009-08-17 Thread Richard S. Hall
Thanks! -> richard On 8/17/09 16:32, Allen Lau wrote: Okay, good to know. Added improvement request at https://issues.apache.org/jira/browse/FELIX-1492 Thanks, Allen On Mon, Aug 17, 2009 at 12:05 PM, Richard S. Hallwrote: No, not currently. -> richard On 8/17/09 14:15, Allen Lau wr

Re: Excluding optional imports with OBR?

2009-08-17 Thread Allen Lau
Okay, good to know. Added improvement request at https://issues.apache.org/jira/browse/FELIX-1492 Thanks, Allen On Mon, Aug 17, 2009 at 12:05 PM, Richard S. Hall wrote: > No, not currently. > > -> richard > > > On 8/17/09 14:15, Allen Lau wrote: > >> Hi, just wondering if there is an easy way

Re: Excluding optional imports with OBR?

2009-08-17 Thread Richard S. Hall
No, not currently. -> richard On 8/17/09 14:15, Allen Lau wrote: Hi, just wondering if there is an easy way to tell OBR not to check and deploy optional imports during deploy? Thanks, Allen - To unsubscribe, e-mail: us

Re: XStream and OSGi

2009-08-17 Thread Todor Boev
Guido Spadotto wrote: > Another guy claimed he solved this issue [1], but I won't believe until > I see it running. > > ... > [1]: > http://archive.timeindexing.codehaus.org/lists/org.codehaus.xstream.user/msg/19183331.p...@talk.nabble.com > On second though I think this wrapper function should

Excluding optional imports with OBR?

2009-08-17 Thread Allen Lau
Hi, just wondering if there is an easy way to tell OBR not to check and deploy optional imports during deploy? Thanks, Allen

Re: XStream and OSGi

2009-08-17 Thread Carsten Ziegeler
Guido Spadotto wrote: > Thanks Carsten, > I'm now injecting the DynamicClassLoader using SCR in my code: > >/** > * The Sling Dynamic ClassLoader manager. > * It is mandatory, so no need for "null" reference checking. > * @scr.reference cardinality="1..1" bind="setDynCl" > *

Re: XStream and OSGi

2009-08-17 Thread Guido Spadotto
Carsten Ziegeler wrote: If your objects are scattered among several bundles you might want to give the Apache Sling dynamic classloader a try: http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/classloader/ It provides the DynamicClassLoaderManager services which gives you a classloade

Re: Question about bundle class loader lifecycle

2009-08-17 Thread Richard S. Hall
On 8/17/09 5:27, Holger Hoffstätte wrote: Todor, Richard - thank you for your responses. I understand how various GC schemes work - I guess I should have asked a more concise question like "does the framework explicitly keep a reference to the classloader, and if so, when is that reference relea

Re: XStream and OSGi

2009-08-17 Thread Reto Bachmann-Gmür
Carsten Ziegeler said the following on 08/17/2009 04:33 PM: > ... > http://svn.apache.org/repos/asf/sling/trunk/bundles/commons/classloader/ > > It provides the DynamicClassLoaderManager services which gives you a > classloader that is able to load all publically available classes from > all bundle

Re: XStream and OSGi

2009-08-17 Thread Carsten Ziegeler
Guido Spadotto wrote >> > Thanks Todor and Charles for your highly appreciated suggestions. > I think that Todor spotted the technical issue with quite a remarkable > conciseness, and you're not out of line. > > 'Captatio benevolentiae' apart ;) I of course am in the case of > "scattered among sev

Re: XStream and OSGi

2009-08-17 Thread Guido Spadotto
Todor Boev wrote: In the [3] link in your message the guy has tried this: xStream.setClassLoader(Thread.currentThread().getContextClassLoader()); Instead he should have tried this xStream.setClassLoader(getClass().getClassLoader()); The idea is to tell xStream to load classes from your own cl

Re: XStream and OSGi

2009-08-17 Thread Todor Boev
In the [3] link in your message the guy has tried this: xStream.setClassLoader(Thread.currentThread().getContextClassLoader()); Instead he should have tried this xStream.setClassLoader(getClass().getClassLoader()); The idea is to tell xStream to load classes from your own class loader, aka you

Re: XStream and OSGi

2009-08-17 Thread Charles Moulliard
Hi Guido, Why don't you use jaxb + camel. Please have a look here in the doc : http://camel.apache.org/jaxb.html Regards, Charles Moulliard Senior Enterprise Architect Apache Camel Committer * blog : http://cmoulliard.blogspot.com On Mon, Aug 17, 2009 at 2:57 PM,

XStream and OSGi

2009-08-17 Thread Guido Spadotto
Hi all, in an OSGi-based project of mine I'm trying to use XStream to marshall/unmarshall data structures to/from XML. Saving data to XML is no big issue, but restoring it from XML throws a CannotResolveClass [1] exception. I've googled a bit and it seems that XStream requires some tampering wit

Re: Question about bundle class loader lifecycle

2009-08-17 Thread Holger Hoffstätte
Todor, Richard - thank you for your responses. I understand how various GC schemes work - I guess I should have asked a more concise question like "does the framework explicitly keep a reference to the classloader, and if so, when is that reference released". :) However in the meantime I found ou