In my application I used Equinox HttpService implementation but now I'm trying to move to Pax Web. I have a problem with different class loader strategy used in these two implementations: 1. While registering of servlet, Equinox creates ServletRegistration instance and stores current context classloader. Then, while Servlet.service (in class HttpServletManager.InternalHttpServiceServlet), this previously stored classloader is temporary set as a context class loader. 2. HttpService from Pax web is created by ServiceFactory for each bundle using it. And each instance of HttpServiceStarted has reference to such bundle and creates also new BundleClassLoader (from Swiss Box), which is used while Servlet.service.
First case works in my application, because context class loader used while servlet registration has access to all needed classes. Second case don't works, because my bundle registering servlet don't import some packages, so I have ClassNotFoundException while Servlet.service(). What implementation of HttpService works correct? I suppose Pax Web :-) but I'm not sure. So I don't know whether I should add some (sometimes strange) imports to my bundle or there is an error in Pax Web... P.S. In OSGI 4.1 spec I can't find anything about classloaders in HttpService description. -- Damian _______________________________________________ general mailing list [email protected] http://lists.ops4j.org/mailman/listinfo/general
