This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 219869 - NetBeans doesn't recognize if another IDE instance is already running.
Summary: NetBeans doesn't recognize if another IDE instance is already running.
Status: NEW
Alias: None
Product: platform
Classification: Unclassified
Component: Autoupdate (show other bugs)
Version: 7.3
Hardware: PC Linux
: P2 normal (vote)
Assignee: Libor Fischmeistr
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2012-10-11 03:15 UTC by paolosca
Modified: 2014-02-10 14:15 UTC (History)
1 user (show)

See Also:
Issue Type: ENHANCEMENT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description paolosca 2012-10-11 03:15:12 UTC
Product Version: NetBeans IDE Dev (Build 201210040002)
Updates: Updates available
Java: 1.7.0_03; OpenJDK Client VM 22.0-b10
System: Linux version 3.2.0-4-686-pae running on i386; UTF-8; en_US (nb)
User directory: /home/paolo/.netbeans/dev
Cache directory: /home/paolo/.cache/netbeans/dev

If I'm already running NetBeans and I accidentally click the shortcut to open it again a new NetBeans instance is launched, the splash window briefly appears saying it's updating modules, and then disappear after a few seconds, then it appears again in an infinite loop sending the processor to 100% usage.

I can interrupt the look only closing the first NB instance, in this case the new one is loaded properly but oddly two NB windows appear on screen.

This happen often because of a strange behavior of NB in the shortcut panel of gnome shell which doubles as a task manager.

Normally, when I click on an icon on the shortcut/task manager panel in gnome while the application is already open, instead of opening another instance, the focus is shifted on the already open window.

NetBeans however behaves differently, when I open it from the panel it creates a new icon at the bottom of the panel (as a task manager), if I click the new one the NB window get the focus, if I click the original one it tries to open a new instance of NB.

If it's not very clear I can add a snapshot.

Regards,

Paolo
Comment 1 paolosca 2012-10-11 05:20:27 UTC
I have to add the following:

1. The icon created in the gnome shell taskbar is called "java-lang-Thread", as it's the window containing NetBeans, and this is perhaps the cause of the double icon in the launcher/taskbar;

2. The double icon issue has always been there since I upgraded to gnome 3, but when I accidentally clicked on the NB launcher icon no new instance was created, it merely worked a while and then the process stopped by it self;

3. When the second instance starts the update window appears even though I haven't downloaded any update, it just keeps going on and off every few seconds in an infinite loop;

4. I upgrade this bug to P2 because last time it happened I had to restart my laptop because there was no way to exit the loop (not even killing all java processes stopped it);

Regards,

Paolo
Comment 2 Jiri Rechtacek 2012-10-11 08:08:02 UTC
I'm using Gnome Shell on Ubuntu 11.04 I haven't seen problem like this.
Comment 3 paolosca 2012-10-12 05:40:05 UTC
Hi Jiri,

I found a way of reproducing this reliably, and perhaps affects also other platforms.

It's not NetBeans which doesn't recognize if there is already a running instance but the updater/plugin installer.

My problem was due to the fact I had some files in ~/NetBeans/dev/update/download, probably left over from a botched plugin install.

To reproduce this problem just try to install some plugin, while it's downloading click on the NetBeans laucher, the updater will start even if an installation is already taking place possibly messing it up.

This can happen also when to install the plugins is necessary to restart since they will be left in the download directory.

If for some reason the plugins cannot be installed (i.e. a missing dependency) the downloaded file will be left in the download directory and it will cause the installed to popup in an infinite loop.

Perhaps this could be easily solved adding a check in the installer so that if NetBeans is already running the installer is aborted.

Also, to avoid having files left over in the download directory the installer should probably clean up the download directory of all files after it's done, including the ones it was not able to install due to missing dependencies or any other reason.

I leave this report as resolved, please let me know if I should reopen it or open a new one for the installer or just leave it closed.
Comment 4 Jiri Rechtacek 2012-10-12 09:52:33 UTC
(In reply to comment #3)
> Hi Jiri,
> 
> I found a way of reproducing this reliably, and perhaps affects also other
> platforms.
> 
> It's not NetBeans which doesn't recognize if there is already a running
> instance but the updater/plugin installer.
> 
> My problem was due to the fact I had some files in
> ~/NetBeans/dev/update/download, probably left over from a botched plugin
> install.
> 
> To reproduce this problem just try to install some plugin, while it's
> downloading click on the NetBeans laucher, the updater will start even if an
> installation is already taking place possibly messing it up.
> 
> This can happen also when to install the plugins is necessary to restart since
> they will be left in the download directory.
> 
> If for some reason the plugins cannot be installed (i.e. a missing dependency)
> the downloaded file will be left in the download directory and it will cause
> the installed to popup in an infinite loop.
> 
> Perhaps this could be easily solved adding a check in the installer so that if
> NetBeans is already running the installer is aborted.
> 
> Also, to avoid having files left over in the download directory the installer
> should probably clean up the download directory of all files after it's done,
> including the ones it was not able to install due to missing dependencies or
> any other reason.
> 
> I leave this report as resolved, please let me know if I should reopen it or
> open a new one for the installer or just leave it closed.

I reopen it myself and decreased the priority a little. I'm going to reproduce it with following your steps and let you know if other details are needed. Thanks
Comment 5 Jiri Rechtacek 2014-01-31 15:16:34 UTC
No intention for fixing this in the near future, it requires a bit complex changes in Auto Update Services which cannot be addressed during stabilization phase. I'm sorry.