• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to create Window Service in JAVA  RSS feed

 
ram gaurav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

How to create a Window Service in JAVA.

Thanks
Gaurav
 
Ajay Singh
Ranch Hand
Posts: 182
 
ram gaurav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sir Thanks for your reply but can you please guide me that how to start for the same
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The documentation should cover what you needto do. What have you tried? What is going wrong?
 
ram gaurav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your answer Sir.

I have done all necessary configuration and i am using Method 2 to make service.

I put and update all JAR files as per the notes.

I have made just simple Hello World programme and i have also given the name of main class in wrapper.conf .

Now please tell me that how to run the code so that i can make it run like Window Service.

Thanks
Gaurav
 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So you have created a service and now you want to run it? Either use the services.msc GUI (which you will find in Administative Tools, or by running "services.msc"), or start it via the command line with the command "net start <your service name>".
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Once you have configured you wrapper.conf file, with the tons and tons of options, there is a command line prog to test it. And once, you feel satified with it, this same command line prog has an option to install and uninstall it as a windows service.

Quite frankly, I am surprised that you were able to figure out the many many configurations of the wrapper.conf file, but didn't find the documentation on the command line program (which I think is wrapper.exe, but it has been awhile).

Henry
 
ram gaurav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the answer.

Now, when i am running the application it is giving me the error that java.lang.NoClassDefFoundError:

But i have given full classpth in config file as follows



and also please tell me that should i have to create a Thread in my class or normal programme will run successfully.

Thanks
Gaurav
 
ram gaurav
Ranch Hand
Posts: 208
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks all.

With all your great helps, i am able to make my first Window Service.

Thanks
Gaurav
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!