On 25 Sep 2009, at 11:51, Ian Boston wrote:


On 25 Sep 2009, at 11:32, Ian Boston wrote:


On 25 Sep 2009, at 11:09, Carsten Ziegeler wrote:

Ian Boston wrote:
Has anyone noticed problems reloading a servlet bundle ?

After a reload of a bundle containing a servlet I find that the original
servlet is still used, verified by logging "this".

I know the old servlet was unloaded by OSGi since its references become null after the reload. It looks like the servlet is not being removed
from the ServletResolver.
I will have a deeper look but thought I should ask if anyone else is
seeing the same or if its just me.

Using a reasonably recent Snapshot

I could imaginge a bug in one of the two:
- the servlet resolver caches the servlet. There should be OSGi events
when the bundle is updated and this should clear the cache.

- the new dynamic class loader is still wired to the old bundle. The
class loader listens for bundle events and then throws away the
underlying class loader and creates new ones.

So maybe one of those two mechanisms is not working properly.
If you could provide a test case I could help searching.


I think this must be something I have done, at r815843 unmodified Sling, at least, if I do a simple servlet bound to the HttpSevice and connected either to a static path or a resource type, I cant reproduce the behavior.

I will have to see if I can reproduce in my modified environment with the simple servlet.

yes, simple servlet fails to reload in my environment :(, must have done something bad to prevent the servlet resolver replacing the reference.

Not a Sling problem then.

Using an attached debugger.
In my instance the cache in SlingServletResolver is not cleared by a reload,

I see re-registration events for bindServlet and unbindServlet happening with new service references and service objects all of this works


but I never see the handleEvent method invoked to reset the cache, I guess that I have done something to the event registration process surrounding the SlingServletResolver, but doing event registrations (or breaking the event flow) somewhere else ? Is that possible ?

Ian


Ian




Ian



Carsten

--
Carsten Ziegeler
cziege...@apache.org



Reply via email to