Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » OSGi shutdown problems
OSGi shutdown problems [message #112484] Sat, 15 November 2008 13:23 Go to next message
Igor Pavlenko is currently offline Igor PavlenkoFriend
Messages: 24
Registered: July 2009
Junior Member
Hello

I made a RAP application, and I have to stop the OSGi framework. But I
cannot do this in few cases.

If I start an OSGi Framework and I can stop it. It is fine.
If I start an OSGi Framework and run my application on it - the workbench
of my application will be created. The application works fine. But if I
try to shutdown OSGi - I cannot do this.

If I start an OSGi Framework and run my application and then close the
workbench - there will be no problems with shutting down OSGi.

The problem is that After I create my workbench I have a socket listener
that is suspended:

Thread [SocketListener0-1] (Suspended)
Object.wait(long) line: not available [native method] [local variables
unavailable]
ArrayList<E>(Object).wait() line: 474
UICallBackManager.blockCallBackRequest() line: 187
UICallBackServiceHandler.service() line: 383
ServiceManager$HandlerDispatcher.service() line: 98
RWTDelegate.doPost(HttpServletRequest, HttpServletResponse) line: 63
RequestHandler.service(HttpServletRequest, HttpServletResponse) line: 51
RequestHandler(HttpServlet).service(ServletRequest, ServletResponse)
line: 689
ServletRegistration.handleRequest(HttpServletRequest,
HttpServletResponse, String) line: 90
HttpServiceServlet(ProxyServlet).processAlias(HttpServletReq uest,
HttpServletResponse, String, String) line: 117
HttpServiceServlet(ProxyServlet).service(HttpServletRequest,
HttpServletResponse) line: 59
HttpServiceServlet(HttpServlet).service(ServletRequest, ServletResponse)
line: 689
HttpServerManager$InternalHttpServiceServlet.service(Servlet Request,
ServletResponse) line: 269
ServletHolder.handle(ServletRequest, ServletResponse) line: 428
Servlet25Handler(ServletHandler).dispatch(String, HttpServletRequest,
HttpServletResponse, ServletHolder, int) line: 677
Servlet25Handler(ServletHandler).handle(String, String, HttpRequest,
HttpResponse) line: 568
HttpContext.handle(String, String, HttpRequest, HttpResponse) line: 1530
HttpContext.handle(HttpRequest, HttpResponse) line: 1482
HttpServer.service(HttpRequest, HttpResponse) line: 909
HttpConnection.service(HttpRequest, HttpResponse) line: 820
HttpConnection.handleNext() line: 986
HttpConnection.handle() line: 837
SocketListener.handleConnection(Socket) line: 245
SocketListener(ThreadedServer).handle(Object) line: 357
ThreadPool$PoolThread.run() line: 534

You can see in this stack this call:
ServletRegistration.handleRequest(HttpServletRequest, HttpServletResponse,
String) line: 90

But in HttpServiceServlet(ProxyServlet).processAlias(HttpServletReq uest,
HttpServletResponse, String, String) we have
org.eclipse.equinox.http.servlet.internal.Registration instance. For this
instance we call registration.addReference() before calling of
registration.handleRequest and registration.removeReference() after.

So the SocketListener is suspended and the registration.destroy() method
that should be executed when we will try to shutdown OSGi (also if we stop
the application in web container) will be locked.

Could somebody help me, please?
Re: OSGi shutdown problems [message #113159 is a reply to message #112484] Sun, 23 November 2008 19:32 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: rherrmann.innoopract.com

Igor,

do you explicitly call UICallBack#activate()? In this case you need
to take care that UICallBack#deactivate() is called when the session
terminates.
The code would look like this:
ISessionStore sessionStore = RWT.getSessionStore();
sessionStore.addSessionStoreListener( new SessionStoreListener() {
public void beforeDestroy( SessionStoreEvent event ) {
UICallBack.deactivate( "your-id" );
}
} );

HTH
RĂ¼diger

Igor Pavlenko wrote:
> Hello
>
> I made a RAP application, and I have to stop the OSGi framework. But I
> cannot do this in few cases.
>
> If I start an OSGi Framework and I can stop it. It is fine.
> If I start an OSGi Framework and run my application on it - the
> workbench of my application will be created. The application works fine.
> But if I try to shutdown OSGi - I cannot do this.
>
> If I start an OSGi Framework and run my application and then close the
> workbench - there will be no problems with shutting down OSGi.
>
> The problem is that After I create my workbench I have a socket listener
> that is suspended:
>
> Thread [SocketListener0-1] (Suspended)
> Object.wait(long) line: not available [native method] [local
> variables unavailable]
> ArrayList<E>(Object).wait() line: 474
> UICallBackManager.blockCallBackRequest() line: 187
> UICallBackServiceHandler.service() line: 383
> ServiceManager$HandlerDispatcher.service() line: 98
> RWTDelegate.doPost(HttpServletRequest, HttpServletResponse) line: 63
> RequestHandler.service(HttpServletRequest, HttpServletResponse)
> line: 51
> RequestHandler(HttpServlet).service(ServletRequest, ServletResponse)
> line: 689
> ServletRegistration.handleRequest(HttpServletRequest,
> HttpServletResponse, String) line: 90
> HttpServiceServlet(ProxyServlet).processAlias(HttpServletReq uest,
> HttpServletResponse, String, String) line: 117
> HttpServiceServlet(ProxyServlet).service(HttpServletRequest,
> HttpServletResponse) line: 59
> HttpServiceServlet(HttpServlet).service(ServletRequest,
> ServletResponse) line: 689
> HttpServerManager$InternalHttpServiceServlet.service(Servlet Request,
> ServletResponse) line: 269
> ServletHolder.handle(ServletRequest, ServletResponse) line: 428
> Servlet25Handler(ServletHandler).dispatch(String,
> HttpServletRequest, HttpServletResponse, ServletHolder, int) line: 677
> Servlet25Handler(ServletHandler).handle(String, String, HttpRequest,
> HttpResponse) line: 568
> HttpContext.handle(String, String, HttpRequest, HttpResponse) line:
> 1530
> HttpContext.handle(HttpRequest, HttpResponse) line: 1482
> HttpServer.service(HttpRequest, HttpResponse) line: 909
> HttpConnection.service(HttpRequest, HttpResponse) line: 820
> HttpConnection.handleNext() line: 986
> HttpConnection.handle() line: 837
> SocketListener.handleConnection(Socket) line: 245
> SocketListener(ThreadedServer).handle(Object) line: 357
> ThreadPool$PoolThread.run() line: 534
>
> You can see in this stack this call:
> ServletRegistration.handleRequest(HttpServletRequest,
> HttpServletResponse, String) line: 90
>
> But in HttpServiceServlet(ProxyServlet).processAlias(HttpServletReq uest,
> HttpServletResponse, String, String) we have
> org.eclipse.equinox.http.servlet.internal.Registration instance. For
> this instance we call registration.addReference() before calling of
> registration.handleRequest and registration.removeReference() after.
>
> So the SocketListener is suspended and the registration.destroy() method
> that should be executed when we will try to shutdown OSGi (also if we
> stop the application in web container) will be locked.
>
> Could somebody help me, please?
>
Re: OSGi shutdown problems [message #113283 is a reply to message #113159] Mon, 24 November 2008 18:27 Go to previous message
Igor Pavlenko is currently offline Igor PavlenkoFriend
Messages: 24
Registered: July 2009
Junior Member
Thank you.

It is the solution.

Igor
Previous Topic:How to import java project
Next Topic:Strange NullPointerExcepion
Goto Forum:
  


Current Time: Tue Jan 31 21:20:47 GMT 2023

Powered by FUDForum. Page generated in 0.06218 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top