Java App like window Service

toaries

Junior Member
Aug 27, 2012
5
0
0
Hello

I want to run my java app like window service like it should not close when logoff on window and also it should be start automatically when window bootup. I used the JSmooth wrapper for that. Its now starting the java app on window boot. But problem is when I logoff on window it is closing my application. I really don’t want to close my Java Application on window logoff. plz suggest me the best possible solutions or some other wrapper which can perform that task.




Thanks
Regards
Mudasser
 
Sep 29, 2004
18,656
68
91
If you wrote the app, why not just make it a real service?

His application is written in java. Java applications can not run as a service natively.

He did what i have read that you must do to have it run as a service. You must use a wrapper or create your own wrapper in C.

OP,
Are there any options in your wrapper when launching the java app?
Does the wrapper you are using offer support?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
His application is written in java. Java applications can not run as a service natively.

He did what i have read that you must do to have it run as a service. You must use a wrapper or create your own wrapper in C.

OP,
Are there any options in your wrapper when launching the java app?
Does the wrapper you are using offer support?

Even if it can't be an official service in the control panel manner, isn't there a way to detach from the desktop session and move into the background?
 

tfinch2

Lifer
Feb 3, 2004
22,114
1
0
We use "Java Service Wrapper" from Tanuki. Works like a champ.

If you are looking for something open source, look at Apache Commons Daemon.
 
Sep 29, 2004
18,656
68
91
Even if it can't be an official service in the control panel manner, isn't there a way to detach from the desktop session and move into the background?

Windows services require that a C API be implemented. It's something like 3 callback methods.

Without implementing those methods implemented, you can not use your application as a Windows service.
 

toaries

Junior Member
Aug 27, 2012
5
0
0
I just did Rnd and find JSmooth wrapper its work fine for me. like it added my app in Control panel service list and also starting my application on window boot but only problem left that when i log off then my application closed and i don't want to close on log off. i did some RnD and they are saying to change in the followings files
SunJVMExe.cpp or SunJVMDLL.cpp

http://sourceforge.net/projects/jsmooth/forums/forum/297041/topic/2370742
http://sourceforge.net/projects/jsmooth/forums/forum/297041/topic/5043499

But i m not able to find that files.
How i can find that file to change it.


Thanks
Regards
Mudasser
 
Sep 29, 2004
18,656
68
91
Wow, sounds like the fix is to modify the JVM. I've never gone down that path.

What you need to do (I think) is:
1) Get JVM source
2) Compile it (this could take some time to get everythign configured correctly)
3) make suggested changes
4) recompile
5) use new JVM

Thing is, if you are updating the source code for the JVM, I don't know why one wouldn't be able to simply make the JVM a service itself and remove the necessity for a wrapper.