In each column, The Support Authority discusses resources, tools, and other elements of IBM® Technical Support that are available for WebSphere® products, plus techniques and new ideas that can further enhance your IBM support experience.
As always, we begin with some new items of interest for the WebSphere community at large:
- Check out the IBM Conferences & Events page for a list of upcoming conferences. Enroll in the IBM European WebSphere Technical Conference before July 10th and receive an early bird discount of 100 € off the conference fee. This 4.5 day event, to be held 11-15 October 2010 in Düsseldorf, Germany, combines the WebSphere and Transaction & Messaging Conferences of previous years into one seamless agenda, offering two great conferences for the price of one. This year’s conference will be co-located with the Portal Excellence Conference, dedicated to portal business solutions and technical strategies..
- Last week, the IBM Support Portal was named one of the Top Ten Support Sites of 2010 by the Association of Support Professionals. Have you tried the IBM Support Portal yet? All IBM software products are now included, and all software product support pages have been replaced by IBM Support Portal. See the Support Authority's Introduction to the new IBM Support Portal for details.
- Learn, share, and network at the IBM Electronic Support Community blog on developerWorks.
- Check out the new Global WebSphere Community at websphereusergroup.org. Customize the content on your personalized GWC page and connect to other "WebSpherians" with the same interests.
- Several exciting webcasts are planned in May and June at the WebSphere Technical Exchange. Check the site for details and become a fan on Facebook!
Continue to monitor the various support-related Web sites, as well as this column, for news about other tools as we encounter them.
And now, on to our main topic...
Using interactive tools to avoid confusion and errors
WASService.exe is required in the default directory for adding, updating, and removing WebSphere Application Server services in Windows. The WASService command takes several parameters along with several long path strings. Not only can this be confusing to anyone who tries to use it, but it also open an opportunity to set it up incorrectly.
For example, WASService -add has three required
and nine optional parameters, shown in Figure 1.
Figure 1. WASService command
Providing all these parameters on the command line can be time consuming and frustrating, but it can also be error prone and confusing. Beyond that, it can sometimes take an hour or more to debug the cause of a service that was created but fails to start WebSphere Application Server.
Listing 1 shows and example of the WASService command line arguments for creating a Windows service.
Listing 1
WASService.exe -add "vanno"
-serverName "dmgr"
-profilePath "C:\Program Files\IBM\WebSphere\AppServer\profiles\Dmgr02"
-logRoot "C:\Program Files\IBM\WebSphere\AppServer\profiles\Dmgr02\logs\dmgr"
-logFile "C:\Program Files\IBM\WebSphere\AppServer\profiles\Dmgr02\logs\WS_startdmgr.log"
-configRoot "C:\Program Files\IBM\WebSphere\AppServer\profiles\Dmgr02\config"
-encodeParams
-stopArgs "-username wasadmin -password mypassword"
-startType automatic
-restart true
|
Windows services for WebSphere Application Server can be used, for example, to start WebSphere Application Server manually or automatically when the Windows operating system has been restarted, or to automatically restart if the process dies. WebSphere Application Server services can be created during profile creation in the Profile Management Tool, or using the WASService.exe command utility (see the WebSphere Application Server Information Center). Figure 2 shows a screen capture of the Windows Services panel. As highlighted in this figure, a service called IBM WebSphere Application Server V7.0 – vanno1Node01 has been defined.
Figure 2. Windows Services panel
To help you create WebSphere Application Serer services quickly and without confusion,
the WASServiceCmd utility was developed. WASServiceCmd is a new interactive
wizard to help you quickly manage Windows services for WebSphere Application Server
V6.x and V7x. This wizard is a front end to the Wasservice.exe command line utility
shipped with WebSphere Application Server in the bin directory. You can
download this tool
and then run it from <WebSphere_Install_Root>\bin\.
Supported management functions of this tool include the ability to:
- Add a new or update an existing Windows service using the minimum required parameters.
- Add a new or update an existing Windows service using all available parameters.
- Remove a service.
- Display the status of a service.
- Enable WASService traces for problem determination.
Figure 3 shows the tool’s main menu.
Figure 3. WASServiceCmd.exe main menu
To use this utility:
- Run
WASServiceCmd.exefrom the WebSphere/AppServer/bin directory. - In response to Select number next to the options on the main menu,
select item
1to create a service using the minimum number of parameters (Figure 3). - In response to Select number next to the profile, select the number associated with the profile for which you wish to create the service (Figure 4).
Figure 4. Select profile
- In response to Select number next to server, select the server from the
list. In the example shown in Figure 5, there is only one selection, dmgr.
Also shown in Figure 5, hints and warnings display as you go (circled in the
figure) to help you prevent common problems.
Figure 5. Select server
- Enter the Service Name for your service (Figure 6).
Figure 6. Name service
- In the next steps, accept the default values by pressing Enter, or make changes as
needed:
- -startArgs and –stopArgs are not required options. Use these options to specify additional parameters used for starting and stopping the JVM process. For example, you may add username and password, as follows:
-stopArgs “-username mrathi –password po1la3r!s”These additional parameters are then automatically passed into the script that the Windows service uses to stop the JVM process. As shown in Figure 7, the default is no additional arguments and you can press Enter to skip this option.
Figure 7. Additional start arguments
- Enter the Log Root Path. The default location is specified in
Figure 8. You can press Enter to accept the default location, or you can enter the full path to your log root directory.
Figure 8. Log Root Path
- Enter the Log File name. The default location is specified in
Figure 9. You
can press Enter to accept the default location, or you can enter the full path to your log file directory.
Figure 9. Log File
- Enter the Config Root location. The default location is specified
in Figure 10. You can press Enter to accept the default location, or you can enter the full path to your config root directory.
Figure 10. Config Root
- Specify the restart policy (Figure 11). Enter 1 to automatically
restart this service if it fails. Enter 2 to restart manually if
the service fails. If you press Enter, the default value of 1 is assumed.
Figure 11. Restart Policy
- Specify the Start Type (Figure 12). Enter 1 if you want this service to
automatically start when the operating system starts or when the
service is called for the first time. Enter 2 if the service must
be started manually using the Windows Services panel. The default
is 1 (automatic start type).
Figure 12. Start Type
- -startArgs and –stopArgs are not required options. Use these options to specify additional parameters used for starting and stopping the JVM process. For example, you may add username and password, as follows:
- After all the input prompts the final command is displayed before executing,
circled in Figure 13. Review all the parameters in the command before responding
to Execute command now?
Figure 13. Final constructed command
A command log is also kept for every command that gets issued. If the command contains a password, the password appears as "*******" in the <WebSphere_Install_Root>\bin\WASServiceCmd.log file. Figure 14 shows an example of what the log file contains.
Figure 14. Example log contents
This article described how you can use the WASServiceCmd utility to guide you through creating, listing, deleting, and tracing Windows services for WebSphere Application Server quickly and without making common errors. This is a great tool for administrators in production environments and in development and test systems where more frequent service creation and deletions might be required.
Learn
-
Information Center: WASService Command
-
Technote and download: Using WASServiceCmd to create Windows services for WebSphere Application Servers
-
Video: WASService
demo
-
The Support Authority: If you need help with WebSphere products, there are many ways to get it
-
IBM Software product
Information Centers
-
IBM Software Support Web site
-
IBM Education Assistant
-
IBM developerWorks
-
IBM Redbooks
-
WebSphere Software Accelerated Value Program
Get products and technologies
Discuss
-
Forums and newsgroups
-
Java
technology Forums
-
WebSphere
Support Technical Exchange on Facebook
-
Global WebSphere Community on WebSphere.org
- Follow IBM Support on Twitter!
- WebSphere Electronic Support
- WebSphere Application Server information
- WebSphere Process Server
- WebSphere MQ
- WebSphere Business Process Management
- WebSphere Business Modeler
- WebSphere Adapters
- WebSphere DataPower Appliances
- WebSphere Commerce
- IBM Support Assistant Tools
Paul Van Norman received B.Sc. in Computer Science in 1996 from the University of Regina. He moved from Regina, Canada to Austin, Texas where he has been working in WebSphere Application Server Level 2 support since May, 2000. Paul is the team lead of the WASADM team and has previously led several other L2 teams. Paul enjoys the outdoors and can often be seen in the Texas hill country back roads on his trusted Honda motorcycle.
Dr. Mahesh Rathi has been involved with WebSphere Application Server product since its inception. He led the security development team before joining the L2 Support team, and joined the SWAT team in 2005. He thoroughly enjoys working with demanding customers, on hot issues, and thrives in pressure situations. He received his PhD in Computer Sciences from Purdue University and taught Software Engineering at Wichita State University before joining IBM.




