Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 351575

Summary: Add terminate previous launch to OSGi launcher
Product: [Eclipse Project] PDE Reporter: Holger Staudacher <holger.staudacher>
Component: UIAssignee: PDE-UI-Inbox <pde-ui-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: beyhan.veliev, curtis.windatt.public, daniel_megert, remy.suen, rsternberg, ruediger.herrmann
Version: 3.7   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:

Description Holger Staudacher CLA 2011-07-08 10:07:30 EDT
The OSGi launcher works pretty well. It's also good that you can launch multiple instances of the same launch configuration. But there is one use case when this behavior is really annoying. This is when you are developing an OSGi application that uses the HttpService. When launch such an application and want to launch it again you always run into an BindException because the port is used by the previously launched application. So, you need to terminate both before you are able to start it again. We faced this problem also in the launcher for RAP applications and we were able to work out a solution. 

A few weeks ago I refactored this enhancement into a separate bundle which lives currently on github. I think this could be a great addition to the OSGi launcher. E.g. we can add a checkbox called "Terminate previous launched instances" or something like this.

The code can be found here: https://github.com/hstaudacher/OSGi-launcher-enhancements

It's already published under the EPL. If you think this could be a useful feature I would also agree to work it in into the OSGi launcher and provide a patch for it.

Cheers Holger
Comment 1 Curtis Windatt CLA 2011-07-11 15:37:25 EDT
How does your bundle determine the launch to terminate?  I could see this as an option in the Eclipse launch, but it would be more powerful if we could close whatever launch is locking the workspace we plan on using (even if it is a different launch config).
Comment 2 Dani Megert CLA 2011-07-12 04:20:22 EDT
> I could see this as an
> option in the Eclipse launch, but it would be more powerful if we could close
> whatever launch is locking the workspace we plan on using (even if it is a
> different launch config).
This is not specific to the OSGi launcher. The same applies to other launch configurations (e.g. JUnit). Detecting "blocking" issues in the general case is not possible. Also, when it comes to locked OS resources it might not be so easy to determine when the launch is actually cleanly terminated and all resources freed so that the new launch starts without problems.
Comment 3 RĂ¼diger Herrmann CLA 2016-02-12 07:56:15 EST
There currently is a discussion on bug 487554, striving for a more general solution.