The WASService command line tool lets you create a Windows service for any WebSphere Application Server Java process.
The WASService.exe command file is located in the install_root\bin directory.
WASService.exe command syntax for starting an existing service
WASService.exe [-start] "service_name" [optional startServer.bat parameters]
WASService.exe command syntax for creating a service or updating an existing service
WASService.exe -add "service_name" -serverName server -profilePath server_profile_directory [-wasHome install_root] [-configRoot configuration_repository_directory] [-startArgs additional_start_arguments] [-stopArgs additional_stop_arguments] [-userid user_id -password password] [-logFile service_log_file] [-logRoot server_log_directory] [-restart true | -restart false] [-startType automatic | manual | disabled]
WASService.exe command syntax for deleting a service
WASService.exe -remove "service_name"
WASService.exe command syntax for stopping a running service
WASService.exe -stop "service_name" [optional stopServer.bat parameters]
WASService.exe command syntax for retrieving service status
WASService.exe -status "service_name"
WASService.exe command syntax for encoding parameters
WASService.exe -encodeParams "service_name"
Supported arguments include:
WASService -encodeParams service_name
After creating a custom profile, you must federate the node to create a node agent server on the node. You can also use the administrative console of the deployment manager to create application server processes on the node. You can create a Windows service for the nodeagent server process or the application servers on the node.
A node agent server is also created after adding an application server node to a deployment manager cell. You can create a Windows service for the nodeagent server process as described later.
To view Windows services, open the Control panel and click Administrative Tools > Services. Select a service to view information about it. Right click the service and click Properties. Four tabs provide information and functionality. For example, select the Setup type field on the General tab to change the setup type.
Creating a deployment manager service
WASService -add dmgr -servername dmgr -profilePath "C:\Program Files\IBM\WebSphere\AppServer\ profiles\Dmgr1" -wasHome "C:\Program Files\IBM\WebSphere\AppServer" -logfile "C:\Program Files\IBM\WebSphere\AppServer\ profiles\Dmgr1\logs\startManager.log" -logRoot "C:\Program Files\IBM\WebSphere\AppServer\ profiles\Dmgr1\logs" -restart true
Adding Service: dmgr Config Root: C:\Program Files\IBM\WebSphere\AppServer\profiles\Dmgr1\config Server Name: dmgr Profile Path: C:\Program Files\IBM\WebSphere\AppServer\profiles\Dmgr1 Was Home: D:\Program Files\IBM\WebSphere\AppServer\ Start Args: Restart: 1 IBM WebSphere Application Server V6 - dmgr service successfully added.
Click Start > Settings > Control Panel > Administrative Tools > Services to work with the new service.
Creating a node agent service
WASService -add nodeagent -servername nodeagent -profilePath "C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile" -wasHome "C:\Program Files\IBM\WebSphere\AppServer" -logfile "C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile\logs\startNode.log" -logRoot "C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile\logs" -restart true
Adding Service: nodeagent Config Root: C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile\config Server Name: nodeagent Profile Path: C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile Was Home: C:\Program Files\IBM\WebSphere\AppServer\ Start Args: Restart: 1 IBM WebSphere Application Server V6 - nodeagent service successfully added.
Creating an Application Server service
WASService -add server2 -servername server2 -profilePath "C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile" -wasHome "C:\Program Files\IBM\WebSphere\AppServer" -logfile "C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile\logs\startNode.log" -logRoot "C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile\logs" -restart true
Adding Service: server2 Config Root: C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile\config Server Name: server2 Profile Path: C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile Was Home: C:\Program Files\IBM\WebSphere\AppServer\ Start Args: Restart: 1 IBM WebSphere Application Server V6 - server2 service successfully added.
Updating an existing Application Server service
This example updates an existing service called IBM WebSphere Application Server V6 - server2 with additional stop arguments, username and password. The user name and password are required by the stopServer command to stop the application server with security enabled.
WASService -add server2 -servername server2 -profilePath "C:\Program Files\IBM\WebSphere\AppServer\ profiles\CustomProfile" -stopArgs "-username user_name -password password" -encodeParams server2
Because server1 is registered to run as a Windows Service, the request to start this server will be completed by starting the associated Windows Service.
Because nodeagent is registered to run as a Windows Service, the request to start or stop this server will be completed by starting or stopping the associated Windows Service. Examine the log files to view messages related to this command.
Because dmgr is registered to run as a Windows Service, the request to start or stop this server will be completed by starting or stopping the associated Windows Service. Examine the log files to view messages related to this command.
Stopping a server after enabling security
Could not stop the IBM WebSphere Application Server V6 - server_name service on Local Computer. The service did not return an error. This could be an internal Windows error or an internal service error. If the problem persists, contact your system administrator.
The problem is due to the service control of the process. You must change the service to use the proper stop-server arguments for a secure server.
Use the -stopArgs parameter and the -encodeParams parameter to update the service as described in the "Updating an existing application server service" example.
Related tasks
Automatically restarting server processes
Related information
Access problems after enabling security