{ last revision 6-18-98 } A brief description of installing a java command line server as an NT service : An NT "Service" is the equivalent of a UNIX process that runs "in the background". It always runs regardless of who is logged on, but doesn't put an icon on the task bar. If you open the Services control panel, you see all your running services. Any of them can be stopped at any time(though some may be essential for NT to run). Installing something as a service is harder if you use either our database server or RmiJDBC. Both require using Microsoft's "Srvany" program. If you need info on this, see http://www.cat-soft.com/srvany.htm - or - http://bscw.gmd.de/Download/bscwserv.html Steps required for me to install our server as a service: (1) Added my database as a system data source in the ODBC control panel. (2) Followed instructions at http://www.cat-soft.com/SrvAny.htm to install my application as a service. Registry values I used for setting up a database server service that would still show a DOS server window: AppDirectory : C:\WINNT\system32\inetsrv\wwwroot\bore\production [ my application directory ] Application: c:\winnt\system32\cmd.exe AppParameters : /k C:\WINNT\system32\inetsrv\wwwroot\BORESRV.BAT Notes : - I don't use java as the application. I run cmd.exe as the application in order to see the DOS window. - "/k" prevents the DOS window from closing after executing the command. - The above setup only works if your CLASSPATH is a system variable (not a user variable). If your CLASSPATH is only a user variable, you will need to add the classpath to the equivalent of BORESRV.BAT. - Below is the text of BoreSrv.bat : -------------------------------- @echo off cd C:\WINNT\system32\inetsrv\wwwroot\bore\production // the java application directory java Server cd \ -------------------------------- (3) Went into "Services" control panel, and found my service. When I started it, it didn't work. (I didn't initially have the registry values set as above, which may have been part of the problem.) I then tried to determine how I could debug the program. You may or may not find the next step useful. (1) I installed srvany as a service, following instructions at microsoft site: http://support.microsoft.com/support/kb/articles/Q152/4/60.asp Then used "cmd.exe" as a parameter to srvany. This opened a DOS window. I ran my server from there, which allowed me to see registry problems my server was having. Both problems I encountered involved the ODBC drivers being unable to find certain registry key values. To fix the problem, I simply copied key values from other System Data sources on the machine. I still don't know why the ODBC administrator control panel did not set up my data source with all of the necessary keys. I used regedt32.exe to edit the registry. (Usually found in winnt\system32.) The keys I found to be necessary were these: (under HKEY_LOCAL_MACHINE/SOFTWARE/ODBC/ODBC.INI/): DBQ: REG_SZ : C:\WINNT\system32\...\ (NOT added by ODBC control panel -- may have caused error) Driver : REG_SZ : C:\WINNT\System32\odbcjt32.dll (added by ODBC control panel) DriverId: REG_DWORD: 0x19 (NOT added by ODBC control panel -- caused error) UID: REG_SZ : (NOT added by ODBC control panel -- may have caused error) Notes: - To add a REG_SZ or REG_DWORD value, select "Edit/Add Value". - DriverId is decimal number 19. - I put no value for UID. - My ODBC driver gave a "can't find DriverId" error until I added the driver ID value. I found this value by looking at other system data sources that used MS Access. They all used 19, so I used 19. - After fixing the first error, my ODBC driver gave a "general error" until I added the other two registry values. It worked fine once these were added. I determined which keys to add by looking at other registry entries and finding which ones they all had in common. --------------------------------------------------------------------------------------------------------------------- (4) With the proper registry values, I stopped the database server service (using the Services control panel) and restarted it. It worked. ---------------------------------------------------------------------------------------------------------------------