Hi,
The very simple way to solve such problems is:
1. Add: DynamicImport-Package: *
to MANIFEST.MF file in bundle with Wicket.
2. Use customized implementation of IClassResolver which falls back to
Wicket bundle ClassLoader, eg:
try {
ClassLoader loader = Thread.currentThread().getContextClassLoader();
if (loader == null) {
loader = DefaultClassResolver.class.getClassLoader();
clazz = loader.loadClass(classname);
} else {
try {
clazz = loader.loadClass(classname);
} catch (ClassNotFoundException e) {
loader = DefaultClassResolver.class.getClassLoader();
clazz = loader.loadClass(classname);
}
}
}
We are using this approach in our applications and everything works
like a charm (0 serialization related problems) :).
Maybe this is not the best way and maybe not very elegant but it uses
OSGi standard mechanism, nothing Equinox specific.
--
Daniel
On Sun, Nov 1, 2009 at 2:27 AM, David Leangen <[email protected]> wrote:
>
> If you do go with OSGi, you will have problems with classloaders and
> deserialization.
>
> To my knowledge, nobody has yet solved this (i.e. implemented a good
> solution) in a decent way. The Eclipse buddy system is not "proper" OSGi,
> IMO.
>
> pax-wicket does "solve" this problem (using "proper" OSGi), but I have never
> used their approach much even though I use the framework.
>
> Here is a post about this by me with some interesting comments from Igor:
>
> http://bioscene.blogspot.com/2009/03/serialization-in-osgi.html
>
>
> Good luck to you!
> =David
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]