Manage Learn to apply best practices and optimize your operations.

Automatically start a WebSphere instance

A WebSphere instance on the iSeries runs as a job in a subsystem, like any other job on the system. However, the normal method used to start the WebSphere instance is different, requiring that you use the startServer command from the QShell environment. But what if you want to start your WebSphere instance automatically when the system is first IPL'ed?

A WebSphere instance on the iSeries runs as a job in a subsystem, like any other job on the system. However, the normal method used to start the WebSphere instance is different, requiring that you use the startServer command from the QShell environment. But what if you want to start your WebSphere instance automatically when the system is first IPL'ed? This article will show you how to make that happen.

The examples in this article are based on WebSphere Base version 5.0.2 for the iSeries. Depending on the version of WebSphere you are running, the library and subsystem names may be different.

More Information

IBM has supplied a program that can be used in an autostart job entry on the iSeries to start your WebSphere instance. So, just like any other job, you can create an entry in the subsystem description to start your instance when the subsystem is started. You can then add the STRSBS command to your system startup program (normally called QSTRUP and pointed to by system value QSTRUPPGM). The result is when your system is powered up the WebSphere susbsystem and its associated instance job(s) are started. The command you would place in your startup program would look something like this:

STRBS SBS(QEJBAS5/QEJBAS5)

It is good practice to follow all commands in your startup program with a MONMSG CPF0000 so that if the command fails, the execution of the program won't stop.

To create an autostart job entry in the WebSphere subsystem, you need to create a job description that contains the command used to start the job and the autostart job entry itself. In the job description, the command used to start the job is placed in the Request Data parameter. The command would look like this:

QSYS/CALL PGM(QEJBAS5/QEJBSTRSVR) PARM('-instance' '/QIBM/UserData/WebAs5/Base/yourinstancename' '-server' 'yourservername')

In this command, yourinstancename is the name you have given to your WebSphere instance and yourservername is the WebSphere server name associated with that instance. For example, if you created the WebSphere instance using the default values in the crtwasinst command, the instance name becomes 'default' and the server name becomes 'server1'.

Figure 1 shows the output from a DSPJOBD command for a sample job description, with some of the key parameters highlighted.

                                                                               
                                                                                
                    Display Job Description                             

                                                 System:   SYS1    
 Job description:   MYWAS          Library:   MYLIB                          
                                                                                
 User profile . . . . . . . . . . . . . . . . . . :   QEJBSVR                   
 CL syntax check  . . . . . . . . . . . . . . . . :   *NOCHK                    
 Hold on job queue  . . . . . . . . . . . . . . . :   *NO                       
 End severity . . . . . . . . . . . . . . . . . . :   30                        
 Job date . . . . . . . . . . . . . . . . . . . . :   *SYSVAL                   
 Job switches . . . . . . . . . . . . . . . . . . :   00000000                  
 Inquiry message reply  . . . . . . . . . . . . . :   *RQD                      
 Job priority (on job queue)  . . . . . . . . . . :   5                         
 Job queue  . . . . . . . . . . . . . . . . . . . :   QEJBJOBQ                  
   Library  . . . . . . . . . . . . . . . . . . . :     QEJBAS5                 
 Output priority (on output queue)  . . . . . . . :   5                         
 Printer device . . . . . . . . . . . . . . . . . :   *USRPRF                   
 Output queue . . . . . . . . . . . . . . . . . . :   *USRPRF                   
   Library  . . . . . . . . . . . . . . . . . . . :                             
 Message logging:                                                               
   Level  . . . . . . . . . . . . . . . . . . . . :   4                         
   Severity . . . . . . . . . . . . . . . . . . . :   0                         
   Text . . . . . . . . . . . . . . . . . . . . . :   *SECLVL                   
 Log CL program commands  . . . . . . . . . . . . :   *NO                       
 Accounting code  . . . . . . . . . . . . . . . . :   *USRPRF                   
 Print text . . . . . . . . . . . . . . . . . . . :   *SYSVAL                   
                                                                                
 Routing data . . . . . . . . . . . . . . . . . . :   QCMDI                     
                                                                                
 Request data . . . . . . . . . . . . . . . . . . :   QSYS/CALL 
PGM(QEJBAS5/QEJBstrsvr) PARM('-instance' 
'/QIBM/UserData/WebAs5/Base/yourinstancename' '-server' 
'yourservername')                                                                               
                                                                                
 DDM conversation . . . . . . . . . . . . . . . . :   *KEEP                     
 Device recovery action . . . . . . . . . . . . . :   *SYSVAL                   
 Time slice end pool  . . . . . . . . . . . . . . :   *SYSVAL                   
 Job message queue maximum size . . . . . . . . . :   *SYSVAL                   
 Job message queue full action  . . . . . . . . . :   *SYSVAL                   
 Allow multiple threads . . . . . . . . . . . . . :   *YES                      
 Initial ASP group  . . . . . . . . . . . . . . . :   *NONE                     
 Spooled file action  . . . . . . . . . . . . . . :   *SYSVAL                   
 Text . . . . . . . . . . . . . . . . . . . . . . :   jobd for websphere 
autostart job entry                                                                      
                                                                                

Figure 1: The job description for a WebSphere autostart job entry

In this example we have created a job description object named MYWAS in library MYLIB. Make sure the user profile that runs the system startup program (usually QPGMR) has authority to this object and library. The jobq that is specified in the jobd, in this case QEJBAS5/QEJBJOBQ, is attached to the WebSphere subsystem description. You can find the name of this jobq by using Option 6 from the DSPSBSD command for your WebSphere installation.

The Message Logging values of 4 0 *SECVL assure that a job log gets created when the WebSphere job ends. This is not necessary, but it can be helpful during debug if the WebSphere instance does not get started correctly. The Routing data is QCMDI, and the Request data is as shown. The last parameter you must be sure to specify is to set Allow Multiple Threads to *YES. The WebSphere instance is a highly threaded job.

Once you have created the job description, you just need to add an autostart job entry to the subsystem description that points to the job description. The command would look like this:

ADDAJE SBSD(QEJBAS5/QEJBAS5) JOB(MYSERVER) JOBD(MYLIB/MYWAS)

You can specify any name for the Job parameter, but it is a good idea to make it meaningful in terms of your WebSphere installation. I like to use the actual server name, such as SERVER1, because then the job name will be the same whether it gets started from the autostart job entry or from the QShell command.

To verify that the autostart job entry got added, you can use Option 3 from DSPSBSD to view it. It will look like the one shown in Figure 2 below.

                  Display Autostart Job Entries                          
                                                       System:   SYS1    
 Subsystem description:   QEJBAS5     Status:   ACTIVE                       
                                                                                
 Job            Job Description     Library                                     
 SERVER1           MYWAS            MYLIB                                    

Figure 2: Output from DSPSBSD Option 3

Dan Reusche is a senior systems administrator at Think Federal Credit Union in Rochester, Minn. He has worked with the IBM AS/400 and iSeries platform since 1988, when he worked at the IBM Rochester Development Lab and support of AS/400 systems used within IBM. You may contact him at dreusche@chartermi.net.

This tip originally appeared on Search400.com.

Do you have comments on this tip? Let us know.

Please let others know how useful it is via the rating scale below. Do you have a useful Notes/Domino tip or code to share? Submit it to our monthly tip contest and you could win a prize and a spot in our Hall of Fame.

Dig Deeper on IBM WebSphere

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchWindowsServer

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchDataCenter

SearchContentManagement

Close