• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

java application as windows service - how?

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi everybody,


I need to convert my java app to a windows service. And after doing some google search couldn't find anything helpful.

Do you have any recommendations about creating a windows service by using java?

Thanks a lot
 
Marshal
Posts: 22446
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
java service leads me to http://wrapper.tanukisoftware.com/doc/english/download.jsp (second hit). I've used that one successfully in the past.
 
igor ivanovic
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any other free resources?
 
Ranch Hand
Posts: 1179
Mac OS X Eclipse IDE
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can download Tomcat for windows, and then use the tomcat(5, 6 or 7).exe (see bin/service.bat how it should be set up)
 
Rob Spoor
Marshal
Posts: 22446
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The community version is completely free (as in, doesn't cost any money) and can do what you want in most cases.
 
igor ivanovic
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Rob,

It was very useful tool to use.I created a windows service and can run with my local login account, but i need to run it with different account and allow it to interact with desktop.

Do you have such an experience? or Could you recommend me the ways of doing such kind of applications?

Thanks
 
Bartender
Posts: 10336
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator


and allow it to interact with desktop.


Windows services don't normally interact with the desktop. Indeed, their primary purpose it to run "headless", i.e. with no active user session, and hence no desktop. Why have you chosen to use a service to do this?
 
igor ivanovic
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Paul,

Thanks for your response.

In windows,if you open your service's properties window, go to the Log On tab then check the "Allow service to interact with desktop" check box you can run your java gui app properly.

But my problem is to allow the service to be run under with another user's account. Because the local user doesn't have access to the path where my service is trying to get some data and process it.

And also the local user shouldn't have access to that path.Just my app should run with privileged account and do its work.

Because of the above issue i come to a decision to make a java gui app and run it as windows service and give it privileged rights to run.


So i need to do some more research to make my java app run as i mentioned above.


Thanks
 
Rob Spoor
Marshal
Posts: 22446
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
As soon as the service is created you can treat it mostly as any other Windows service. That includes changing the Log On information.
 
igor ivanovic
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi Rob,

But when i change the logon information, there is no way to enable the service interact with desktop.

when the app is running there opens an interface and asks user to choose some info in order to proceed.


So i can run it with local user account, but couldn't run as under the other account.

you got the point?


i hope there is a way in windows to do it.

thanks and waiting your comments
 
Rob Spoor
Marshal
Posts: 22446
121
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Windows services don't just show user interfaces. They are meant to run in the background.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. As others said, Windows services are meant to run in the background.
2. The services which has to run irrespective of the user login, has to be started with a Local System account (the process would have a user name as SYSTEM). It would been, that no user has to login to start the service, once the system is booted, the Windows Service Control Manager will start them.

This is the best tool as far as I know

http://wrapper.tanukisoftware.com/doc/english/download.jsp
 
Doe, a deer, a female deer. Ray, a pockeful of sun. Me, a name, I call my tiny ad ...
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
reply
    Bookmark Topic Watch Topic
  • New Topic