Solved

How to set up server on WinNT?

Posted on 1997-11-07
12
171 Views
Last Modified: 2012-05-04
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
0
Comment
Question by:pyang051597
  • 6
  • 5
12 Comments
 
LVL 5

Expert Comment

by:msmolyak
ID: 1230216
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
 

Author Comment

by:pyang051597
ID: 1230217
Yes, the server is java application.

Thanks for your help

0
 
LVL 3

Expert Comment

by:eugenem
ID: 1230218
0
 
LVL 5

Expert Comment

by:msmolyak
ID: 1230219
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
 

Author Comment

by:pyang051597
ID: 1230220
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
 
LVL 5

Expert Comment

by:msmolyak
ID: 1230221
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
Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

 

Author Comment

by:pyang051597
ID: 1230222
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
 

Author Comment

by:pyang051597
ID: 1230223
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
 
LVL 5

Expert Comment

by:msmolyak
ID: 1230224
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
 

Author Comment

by:pyang051597
ID: 1230225
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
 

Author Comment

by:pyang051597
ID: 1230226
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
 
LVL 5

Accepted Solution

by:
msmolyak earned 70 total points
ID: 1230227
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

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now