[jetty-dev] Unregistering OSGi web bundles when they are stoped in the framwork

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[jetty-dev] Unregistering OSGi web bundles when they are stoped in the framwork

Chris Frost
Hi,

We have found a problem using Jetty on OSGi and Windows. Want to check it's actually a bug before raising one. When a web bundle is stopped, Jetty should unregister the webapp and let go of any file handles it has open on it. I don't think this last part is happening as we are unable to delete any files from the webapp until we shut Virgo down, Windows prevents this when a file is still open unlike Mac.

Looking through the code in the Jetty-OSGi-Boot bundle, there seems to be some 'todos' around the area of unregistering. The relevant code seems to be around JettyBootstrapActivator, WebBundleTrackerCustomizer and JettyContextHandlerServiceTracker. There is a comment in the code saying that the WebBundleTrackerCustomizer.unregister method has nothing to do as Jetty listens for services to go down instead but that method is still called a lot and I'm not sure I understand what is happening when JettyContextHandlerServiceTracker tries an unregister, I believe this is the right service tracker to be looking at. Any pointers are appreciated and I'll dig a little deeper.

Christopher Frost - VMware
Virgo from EclipseRT


_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Unregistering OSGi web bundles when they are stoped in the framwork

Jan Bartel-3
Chris,

Note that windows frequently has problems with jar files. This could
be as simple as we're iterating over the contents of a jar file
somewhere and not setting caches to false on the JarURLConnection.

Alternatively, it could be because of the way we serve static content,
see here for hints on how to get around that:
http://wiki.eclipse.org/Jetty/Howto/Deal_with_Locked_Windows_Files

Or, it could be there is indeed some code missing.

Do you have a stack trace? That might help to decide which of the above it is.

I'll take a look at at the code and get back to you.
Jan

On 29 March 2012 23:35, Chris Frost <[hidden email]> wrote:

> Hi,
>
> We have found a problem using Jetty on OSGi and Windows. Want to check it's
> actually a bug before raising one. When a web bundle is stopped, Jetty
> should unregister the webapp and let go of any file handles it has open on
> it. I don't think this last part is happening as we are unable to delete any
> files from the webapp until we shut Virgo down, Windows prevents this when a
> file is still open unlike Mac.
>
> Looking through the code in the Jetty-OSGi-Boot bundle, there seems to be
> some 'todos' around the area of unregistering. The relevant code seems to be
> around JettyBootstrapActivator, WebBundleTrackerCustomizer and
> JettyContextHandlerServiceTracker. There is a comment in the code saying
> that the WebBundleTrackerCustomizer.unregister method has nothing to do as
> Jetty listens for services to go down instead but that method is still
> called a lot and I'm not sure I understand what is happening when
> JettyContextHandlerServiceTracker tries an unregister, I believe this is the
> right service tracker to be looking at. Any pointers are appreciated and
> I'll dig a little deeper.
>
> Christopher Frost - VMware
> Virgo from EclipseRT
>
>
> _______________________________________________
> jetty-dev mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
Reply | Threaded
Open this post in threaded view
|

Re: [jetty-dev] Unregistering OSGi web bundles when they are stoped in the framwork

Chris Frost
Hi,

I've had a bit of a play with those Jetty settings to see what difference it makes, not sure if it a complete solution though. I'll give more feedback next week. I don't have a stack trace from Jetty, its some code in Virgo that is trying to remove the web applications files after it's been stopped but can't as something, probably Jetty, still has some handles open on them. I'll be spending more time on this next week.

Chris.

----- Original Message -----
From: "Jan Bartel" <[hidden email]>
To: "Jetty @ Eclipse developer discussion list" <[hidden email]>
Sent: Friday, 30 March, 2012 12:27:53 AM
Subject: Re: [jetty-dev] Unregistering OSGi web bundles when they are stoped in the framwork

Chris,

Note that windows frequently has problems with jar files. This could
be as simple as we're iterating over the contents of a jar file
somewhere and not setting caches to false on the JarURLConnection.

Alternatively, it could be because of the way we serve static content,
see here for hints on how to get around that:
http://wiki.eclipse.org/Jetty/Howto/Deal_with_Locked_Windows_Files

Or, it could be there is indeed some code missing.

Do you have a stack trace? That might help to decide which of the above it is.

I'll take a look at at the code and get back to you.
Jan

On 29 March 2012 23:35, Chris Frost <[hidden email]> wrote:

> Hi,
>
> We have found a problem using Jetty on OSGi and Windows. Want to check it's
> actually a bug before raising one. When a web bundle is stopped, Jetty
> should unregister the webapp and let go of any file handles it has open on
> it. I don't think this last part is happening as we are unable to delete any
> files from the webapp until we shut Virgo down, Windows prevents this when a
> file is still open unlike Mac.
>
> Looking through the code in the Jetty-OSGi-Boot bundle, there seems to be
> some 'todos' around the area of unregistering. The relevant code seems to be
> around JettyBootstrapActivator, WebBundleTrackerCustomizer and
> JettyContextHandlerServiceTracker. There is a comment in the code saying
> that the WebBundleTrackerCustomizer.unregister method has nothing to do as
> Jetty listens for services to go down instead but that method is still
> called a lot and I'm not sure I understand what is happening when
> JettyContextHandlerServiceTracker tries an unregister, I believe this is the
> right service tracker to be looking at. Any pointers are appreciated and
> I'll dig a little deeper.
>
> Christopher Frost - VMware
> Virgo from EclipseRT
>
>
> _______________________________________________
> jetty-dev mailing list
> [hidden email]
> https://dev.eclipse.org/mailman/listinfo/jetty-dev
>
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev
_______________________________________________
jetty-dev mailing list
[hidden email]
https://dev.eclipse.org/mailman/listinfo/jetty-dev