You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by niklas modin <ni...@oracle.com> on 2010/11/30 19:22:35 UTC

[digester] Class loading issue using commons-digester in OSGi setup

  Hi all,

I'm trying to use commons-scxml in an OSGi environment (Equinox) and 
scxml has a dependency
on digester, which causes some class loading issues.

Digester gets it's own class loader being a separate bundle, however it 
looks like when
ObjectCreateRule.begin() instantiates the SCXML object when I try to 
parse a scxml document
this is done using this snippet:

/Class clazz = digester.getClassLoader().loadClass(realClassName);/

Since SCXML isn't in the digesters class loader, this will never work.

Any ideas on how this should work in an OSGi deployment ? Any one else 
with some experience
of using scxml/digester in this manner ?

Do I need to skip installing all the bundles separately, and just pack 
them all together into a
big jar ? Feels like that contradicts the whole modularization goal of 
OSGi/bundles.

Cheers,
Niklas

Re: [digester] Class loading issue using commons-digester in OSGi setup

Posted by Rahul Akolkar <ra...@gmail.com>.
On Tue, Nov 30, 2010 at 5:54 PM, niklas modin <ni...@oracle.com> wrote:
>  Hi,
>
> I would like to stay with standards though, and I think these are all
> eclipse headers right?.
<snip/>

Yup.

-Rahul


> But it seems I have to bend something a little here to get it to work. :)
>
> Anyways, thanks for the help
>
> Cheers,
> Niklas
>
>
<snap/>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [digester] Class loading issue using commons-digester in OSGi setup

Posted by niklas modin <ni...@oracle.com>.
  Hi,

I would like to stay with standards though, and I think these are all 
eclipse headers right?.
But it seems I have to bend something a little here to get it to work. :)

Anyways, thanks for the help

Cheers,
Niklas


On 11/30/2010 2:16 PM, Rahul Akolkar wrote:
> On Tue, Nov 30, 2010 at 1:22 PM, niklas modin<ni...@oracle.com>  wrote:
>>   Hi all,
>>
>> I'm trying to use commons-scxml in an OSGi environment (Equinox) and scxml
>> has a dependency
>> on digester, which causes some class loading issues.
>>
>> Digester gets it's own class loader being a separate bundle, however it
>> looks like when
>> ObjectCreateRule.begin() instantiates the SCXML object when I try to parse a
>> scxml document
>> this is done using this snippet:
>>
>> /Class clazz = digester.getClassLoader().loadClass(realClassName);/
>>
>> Since SCXML isn't in the digesters class loader, this will never work.
>>
>> Any ideas on how this should work in an OSGi deployment ? Any one else with
>> some experience
>> of using scxml/digester in this manner ?
>>
> <snip/>
>
> There is atleast one Eclipse-based plugin that use Commons SCXML; more below.
>
>
>> Do I need to skip installing all the bundles separately, and just pack them
>> all together into a
>> big jar ? Feels like that contradicts the whole modularization goal of
>> OSGi/bundles.
>>
> <snip/>
>
> Right, this can be done without packing everything into one jar. Such
> situations are usually handled using OSGi buddy policies and buddy
> class loading mechanisms.
>
>  From the archives, see my reply to a similar query:
>
>    http://markmail.org/message/hoyi3r7cvbxqrk5x
>
> -Rahul
>
>
>> Cheers,
>> Niklas
>>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
> For additional commands, e-mail: user-help@commons.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org


Re: [digester] Class loading issue using commons-digester in OSGi setup

Posted by Rahul Akolkar <ra...@gmail.com>.
On Tue, Nov 30, 2010 at 1:22 PM, niklas modin <ni...@oracle.com> wrote:
>  Hi all,
>
> I'm trying to use commons-scxml in an OSGi environment (Equinox) and scxml
> has a dependency
> on digester, which causes some class loading issues.
>
> Digester gets it's own class loader being a separate bundle, however it
> looks like when
> ObjectCreateRule.begin() instantiates the SCXML object when I try to parse a
> scxml document
> this is done using this snippet:
>
> /Class clazz = digester.getClassLoader().loadClass(realClassName);/
>
> Since SCXML isn't in the digesters class loader, this will never work.
>
> Any ideas on how this should work in an OSGi deployment ? Any one else with
> some experience
> of using scxml/digester in this manner ?
>
<snip/>

There is atleast one Eclipse-based plugin that use Commons SCXML; more below.


> Do I need to skip installing all the bundles separately, and just pack them
> all together into a
> big jar ? Feels like that contradicts the whole modularization goal of
> OSGi/bundles.
>
<snip/>

Right, this can be done without packing everything into one jar. Such
situations are usually handled using OSGi buddy policies and buddy
class loading mechanisms.

>From the archives, see my reply to a similar query:

  http://markmail.org/message/hoyi3r7cvbxqrk5x

-Rahul


> Cheers,
> Niklas
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org