Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[equinox-dev] Equinox/OSGi class loading and [de]serialization

Hello,

 

I am looking for some advice regarding coping with the Equinox/OSGi bundle classloader architecture within the framework I am building.  The scenario is this:

 

I have a bundle that defines an API for developing application components than can then be assembled into composite components.  Component.java and CompositeComponent.java are defined within that API bundle.  Also defined within that API bundle is a class to help me serialize and deserialize [Composite]Components.

 

Concrete component types are intended to be developed separately and contributed as plug-in bundles.  Therefore you could have a CompositeComponent consisting of 3 concrete components of differing types, A, B and C.

 

The issue I am running into is the inability to deserialize a CompositeComponent containing types A, B, and C, because their concrete component class types are only defined within their respective bundles’ classloaders.  i.e. when the CompositeComponent is instantiated, ClassNotFoundExceptions are thrown for types A, B, and C within the API bundle.

 

Does anyone have a recommendation or strategy to cope with this?  I recognize that the classloader separation is part of the core of the architecture, but it seems to make [de]serialization a real challenge.

 

Thanks,

-Mike Furtak


Back to the top