Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    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 12:15 Go to next message
Farooq Kamal is currently offline Farooq Kamal
Messages: 40
Registered: January 2010
Location: Karachi, Pakistan
Member
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 20:59 Go to previous messageGo to next message
Andrew Niefer is currently offline Andrew Niefer
Messages: 990
Registered: July 2009
Senior Member
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 08:35 Go to previous messageGo to next message
Jerome Godard is currently offline Jerome Godard
Messages: 6
Registered: November 2010
Junior Member
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 10:29 Go to previous messageGo to next message
Farooq Kamal is currently offline Farooq Kamal
Messages: 40
Registered: January 2010
Location: Karachi, Pakistan
Member
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 12:34 Go to previous message
Jerome Godard is currently offline Jerome Godard
Messages: 6
Registered: November 2010
Junior Member
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: Thu Oct 02 00:27:15 GMT 2014

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

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