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.
Test case: 1. Create Platform application based on trunk. 2. Add one module. 3. Create installer for that module and add the following implementation to the restore method: LifecycleManager.getDefault().markForRestart(); LifecycleManager.getDefault().exit(); 4. Create the .zip, unpack it and start. 5. Expected behavior: platform application reboots in a loop. Current behavior: platform application becomes frozen during the first start. This is a regression appeared about 2 months ago.
Created attachment 134662 [details] The issue demo
Yarda, this is regression. We haven't changed the logic, but got hang
It may be a regression, but first of all I'd like to understand why you are doing something like this at all!?
Some Oracle Solaris Studio users do not perform any development on their local systems. They are using some remote systems with OSS installed instead, which are accessed by VNC/X-forwarding/... So we have introduced special kind of OSS IDE distribution, simplifying IDE usage in that case. Here is use case: 1. User goes to server with OSS installed and starts IDE as he usually does. 2. He initiates creating of Desktop Distribution, which contains IDE bits, user directory and projects packed to .zip. 3. User takes this zip to his workstation, unzips and starts -> after the start he should see IDE configured the same way as on remote server with his projects open as full-remote ones. To implement that we have added special module to Desktop Distribution, that unpacks saved user directory data to newly created one (during the first start) and reboots the platform, to make changes take effect. Unfortunately, the "unpacking" logic is quite complex, so it is quite hard to place it to the starting script, that's why we have chosen module approach.
Probably you could get similar result (but without deadlock) with an OptionProcessor registered for Option.always() that throws new CommandLineException(1).
Calling exit() while initialization sequence is running is dangerous. The fact that it worked was more an accident (with unknown side effects) than a feature. I am ready to help you find new, supported way of achieving the same in new versions of NetBeans Platform: suggestion in comment #5 is supported one. Does it work for you?
The approach with OptionProcessor works for us. Thanks for the hint!