On 3/5/13 09:23 , Dan Gravell wrote:
How are you launching the framework?

I'm just running felix.jar.

That is the standard Felix launcher.



If you are using the standard Felix launcher, it registers a VM shutdown
hook to actually stop the framework which can sometimes cause issues. Since
you are explicitly stopping the framework, you could disable the launcher's
shutdown hook in conf/config.properties...look in that file and you'll see
how to disable it.

Well, I could be explicitly stopping the framework, or the stop could occur
when the OS is shutdown and it *appears* this com.apple.eawt._AppEventHandler
kicks in and calls System.exit... Does that count as an explicit stop?

No, it doesn't. This is what would be triggering the launchers shutdown hook.


Note that my reading of the stack trace may not be correct. After all, I
would've thought someone had noticed this before.

It just depends on whether or not anyone tried to put in a tray icon before, I guess.

You might have to mess around a little bit and see if you can come up with a different path to remove the tray icon. One thing that is certain, is that the VM is in a fairly fragile state when shutdown hooks are invoked, which is why we allow ours to be disabled.

Just two thoughts, you could possibly try to register your own shutdown hook in your bundle to remove the tray icon (if you are the only app running, you don't need to worry about gc'ing it I would imagine). You could still potentially disable the launcher's shutdown hook, since I don't believe the framework needs to be cleanly shutdown (although some framework impls may). Another possibility is to try to synchronously listen for the system bundle to start STOPPING and remove the tray icon in the event callback.

Not sure if any of this will help or not.

-> richard


Dan



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to