Skip to main content



      Home
Home » Eclipse Projects » Equinox » Launching Equinox via srvany.exe(Launching Equinox via srvany.exe)
Launching Equinox via srvany.exe [message #539577] Fri, 11 June 2010 08:15 Go to next message
Eclipse UserFriend
Has anyone successfully configured osgi to launch via srvany win nt service. Seems to be straightforward but doesn't work for me.

Other than this, could the eclipse.exe (headless) deployment be made a win32 service? From whatever I could find, sc.exe should allow any exe to run (except for bat files). I tried but this doesn't work too.

Looking for any help on this subject other than wrapper.tanukisoftware.org

Thanks
Farooq Kamal
Re: Launching Equinox via srvany.exe [message #539692 is a reply to message #539577] Fri, 11 June 2010 16:59 Go to previous messageGo to next message
Eclipse UserFriend
I've never tried running eclipse as a service, but if you can figure out how
to run normal java as a service, then you can start equinox with
java -jar plugins/org.eclipse.equinox.launcher_1.1.0.v20100507.jar

-Andrew

Farooq Kamal wrote:

> Has anyone successfully configured osgi to launch via srvany win nt
> service. Seems to be straightforward but doesn't work for me.
>
> Other than this, could the eclipse.exe (headless) deployment be made a
> win32 service? From whatever I could find, sc.exe should allow any exe to
> run (except for bat files). I tried but this doesn't work too.
>
> Looking for any help on this subject other than wrapper.tanukisoftware.org
>
> Thanks
> Farooq Kamal
Re: Launching Equinox via srvany.exe [message #893458 is a reply to message #539577] Wed, 04 July 2012 04:35 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

Once you managed to launch your equinox app as a window service using srvany.exe and the command line "java -jar plugins/org.eclipse.equinox.launcher.xxx.jar" , how do you ensure that it will be stopped properly using the Stop feature of the windows service?

I mean, in my case, if I launch my equinox application using the "-console" argument to display the OSGI console, I am supposed to use the command "close" or "exit" to stop the service. This will call the "stop()" method of the Application that will properly close database connection for instance. How could I get the same behavior when I stop the windows service srvany.exe?

Thanks for your help!
Re: Launching Equinox via srvany.exe [message #893483 is a reply to message #893458] Wed, 04 July 2012 06:29 Go to previous messageGo to next message
Eclipse UserFriend
I havent tried this myself but you can add a thread to the vm exit through
 Runtime.addShutdownHook(Thread hook)  
Re: Launching Equinox via srvany.exe [message #893520 is a reply to message #893483] Wed, 04 July 2012 08:34 Go to previous message
Eclipse UserFriend
Thanks for your answer. Actually, I already tryed but the hook is only called in case the jvm is stopped properly :
- if you close using the windows cross or CTRL+C the console : the hook is called -> OK
- if you close using taskmgr : the hook is not called -> anyway, it doesn't matter in my case -> OK
- if you stop the service using "sc.exe" or "net stop", srvany.exe will kill the process using the WIN32 TerminateProcess() API so that the hook is not called. -> KO
Previous Topic:Problem running OSGI in eclipse (-dev mode)
Next Topic:Prevent Bundle from being loaded
Goto Forum:
  


Current Time: Sat Jul 05 04:18:22 EDT 2025

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

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

Back to the top