Sylvain Wallez wrote:

Martijn Dashorst wrote:

This is possible (at least with Oscar 1.0.5.), there are some concern you have to take into account. First you need to make sure you use the correct classloader to get to the classes embedded in the bundles. That should be too hard a problem.

Can you elaborate on this point? Is it about setting the correct thread's context classloader?

In Wicket we have a resource loading strategy, which can be altered to use the Oscar/Felix classloader.

A component in Wicket can reside in a bundle, and we use the component's classloader to find its resources (that also are located in the bundle). So when the bundle is loaded using the felix classloader, that one is also used for the resources. When the bundle is loaded by the servlet engine, then we use that classloader.


What doesn't work well is synchronizing the oscar loaded objects across a cluster and serializing the objects into the session.

Though the serialization works pretty well, the receiving side can't instantiate the objects, as the classes can't be found by the servlet container's classloader.

Right. That's where having the servlet engine running as a bundle makes a difference.

Yep. And thats where both Cocoon and Wicket will have problems.


The Wicket framework has run into this problem as well. Everything works quite well when run in a whole OSGi environment, but when there's a mix'n'match with classloaders your in for some hard thinking. We woul also like to see some solution for this problem ;-) Bright ideas are welcome!

Thanks for this answer!

No problem, I /really/ like the bundles of OSGi, and already use it in a production system (from within WebSphere and JBoss). I would like to see the classloading problem solved as that would help Wicket and Felix (and apparently now Cocoon as well) tremendously.

Martijn


Reply via email to