How to set up server on WinNT?

Ok, I have everything done now, applets(and html files), mutlithreaded server. but how can I setup the server as a service which runs in the background even when I do not log on? please note: On Windows NT.

Thanks in advance.

Peggy
pyang051597Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

msmolyakCommented:
Is server a Java application?

If it is there is a sequence of steps you have to take to make it  run as an NT service. I have it documented somewhere, I'll try to find it.

Michael
0
pyang051597Author Commented:
Yes, the server is java application.

Thanks for your help

0
eugenemCommented:
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

msmolyakCommented:
I did find a write-up on how to set up a Java application as an NT service. Let me know if you want it.
0
pyang051597Author Commented:
I visited the site, but that is for FaxMail, is it possible for other applications to be setup as services? I dont want to download those files right now because it said some moves might be dangeous.  Can you give me some ideas about that?

yes, please, msmolyak, I need your help, but I dont know if you can get the credits, sorry about that.

thanks, again.


0
msmolyakCommented:
Peggy,

1. My write-up uses steps similar to those outlined in the abovementioned Web site only they are customized fro a Java application.
2. You will need the two programs which are downloadable from that Web site (I am not sure what dangers are you talking about), they sound pretty tame to me. You are going to be modifying the NT registry but unless start deleting the keys right and left there is no danger ther either provided you follow the instructions.
3. If you feel that my answer is more relevant (complete, correct, etc) then the previous one you can always reject the original answer and let me claim the points. This is up to you.

The write up follows. It is about configuring java application called JetPort (part of JetConnect product). I am sure that your application has different name and parameters and thus disregard whatever is specific to my application and customize it for your case. (I did it while creating the write-up and it worked). Let me know if you need additional help.

Michael

--------------------------------

This file contains the instructions on how to confugure JetPort to run
as an NT service.  The following description assumes
that
- You installed JetConnect in c:\java directory;
- You have instsrv.exe and srvany.exe programs which are part of NT
Resource Kit.
Also I was able to find those utilities on the Web under the following
URL: http://www.electrasoft.com/srvany/srvany.htm.
- You are able to successfully run JetPort as a Java application under
certain user account.

The main benefit of being able to run JetPort as an NT service is that
this way JetPort does not depend on the login
sequence.  That is the users can log on and off without affecting
ability of JetPort to run on a given computer.

The disadvantages of running JetPort as a service rather than as a Java
application are inability use the JetPort Monitor
and inability to do the tracing.  The reason for that is the restriction
imposed by NT: a service can either be interactive
(have access to Console, read keyboard input, etc.) or have network
access, but not both at the same time. Clearly, JetPort
needs a network access, thus the limitations listed above.

The following steps describe the procedure of configuring JetPort as a
service.

1. Install SRVANY.EXE as an NT service by running the following command:
        instsrv <serviceName> <path to srvany.exe>, for example
        instsrv JETPORT c:\bin\srvany.exe

2. From Control Panel/Services/Startup dialog box configure the newly
insatlled service (JETPORT in out example). Set
Startup Type to Manual or Automatic as appropriate. Set Log On As to the
account under which you were able to run JetPort
as Java application.

3. Start the registry editor (REGEDT32.EXE) and find the key
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\JETPORT.
Create "Parameters" key under JETPORT key.  Under Parameters key create
3 values:
        Application :REG_SZ: <path to Java VM>    
        AppParameters: REG_SZ: -classpath <CLASSPATH> jet.connect.port.Main ,
where CLASSPATH contains c:\java\classes directory and classes.zip file
containing standard java libraries.
        AppDirectory: REG_SZ: <directory path>     (this should be a
directory containing the correct jetcnnct.dll as well
as license.dat file if more than one license is used).

For example,
        Application :REG_SZ: c:\java\jdk1.1\bin\java.exe
        AppParameters: REG_SZ: -classpath c:\java\jdk1.1\lib\classes.zip;c:\java\classes  jet.connect.port.Main
        AppDirectory: REG_SZ: c:\java\bin

Once the above steps are completed you should be able to run JetPort as
an NT service.
0
pyang051597Author Commented:
well, I guess I am quite dumb, I followed the steps and failed. here is what I did(my java server application is run as : java APSServer at c:\server, using jdk1.0.2):

1. instsrv NAPS c:\bin\srvany.exe
   OK
2. Control panel/services/startup & logon
   choose "automatic, System account, and Allow Service to interact with desktop".
3. Application :REG_SZ: c:\jdk1.0.2\bin\java.exe
   AppParameters: REG_SZ: -classpath    c:\jdk1.0.2\lib\classes.zip;c:\server APSServer
                                     ^^ (space?)
   AppDirectory: REG_SZ: c:\server

but when I tried to start the server on control panel/service( I clicked the start button), I got an error message: "error 002: the System cound not find the file specified."

Please help.

thanks.

Peggy
0
pyang051597Author Commented:
well, I guess I am quite dumb, I followed the steps and failed. here is what I did(my java server application is run as : java APSServer at c:\server, using jdk1.0.2):

1. instsrv NAPS c:\bin\srvany.exe
   OK
2. Control panel/services/startup & logon
   choose "automatic, System account, and Allow Service to interact with desktop".
3. Application :REG_SZ: c:\jdk1.0.2\bin\java.exe
   AppParameters: REG_SZ: -classpath    c:\jdk1.0.2\lib\classes.zip;c:\server APSServer
                                     ^^ (space?)
   AppDirectory: REG_SZ: c:\server

but when I tried to start the server on control panel/service( I clicked the start button), I got an error message: "error 002: the System cound not find the file specified."

Please help.

thanks.

Peggy
0
msmolyakCommented:
Peggy,

Make sure all your files are where you think they are (srvany.exe, java.exe). Why did you choose system account. Try running it under your own (I assume that's where you normally run your server). Make sure your Registry structure is correct. (Tha is you have Parameters key with three values). Try adding c:\server and c:\bin to the path under the account you use to run.

Michael
0
pyang051597Author Commented:
Thanks for your quick response, I add those 2 files to c:\server and it worked! thanks:)

I have one last question: how to delete disabled server from control panel/service? I just re-setup my server and decided to use a new name, but at last I found I cannot delete the old one.

again, thanks, sorry eugenem, I have to give the credits to michael, although the web site you suggested was the right one.
 
0
pyang051597Author Commented:
i already remove the old service by using "instsrv .. remove", thanks.

I am going to close this question, michael, please say sth here so I can give you the credits.  btw, how useful are the credits?
I know they are useful for asking Qs, but for experts?

again, I appreciate your help.

peggy

0
msmolyakCommented:
Those points are useful mainly as ego boosters (by the way I cannnot use my expert points to ask questions). The Experts Excahnge claim that if you collect many-many expert points you become a paid expert (they sort of knight you). I am not holding my breath though.

Glad to be of assistance.

Michael
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Java

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.