Configuring examples.trace.MQeTraceServlet for use with WAS 4.0

First of all, the servlet code must be packaged into a form that suits the application server. This example will create a web module for use with WAS 4.0.

From the WebSphere Administrative Console, choose the menu item Application Assembly tool from the Tools menu. The Application assembly tool should appear.

Figure 102. The WebSphere administrative console

Screen grab showing the WebSphere Administrative Console

Select "Create Web Module Wizard", and click OK. In specifying the properties, enter the file name, and more information, if you wish.

Figure 103. Specifying Web module properties

Screen grab showing the WebSphere Administrative Console

Figure 104. Adding files to the application

Screen grab showing the WebSphere Administrative Console

The next step is to add files to the application. The examples.trace.MQeTraceServlet is in the MQeExamples.jar and relies on classes from MQeGateway.jar, MQeExamples.jar and MQeTraceDecode.jar.

Since you've included all the classes you need, the next panel that asks you if you want to make distributable, or set a classpath, can be left blank, just click next. The next panel is to set any icons for this web application. If you don't have any, just click next.

Next you have to specify the component properties.

Figure 105. Adding web comopnents

Screen grab showing the WebSphere Administrative Console

Only the component name is compulsory, but you may want to add a display name and a description.

The next panel allows you to specify which class is the servlet to run.

Figure 106. Specifying component type and class name

Screen grab showing the WebSphere Administrative Console

The next four panels can safely be left blank, they are for specifying icons, security roles and initialization parameters.

After this, you must specify what URL will map to your servlet. The final URL will be of the form http://hostname:port/specified_dir/specified_url_pattern

Figure 107. Specifying a URL to map to your servlet

Screen grab showing the WebSphere Administrative Console

All of the subsequent panels can be left blank. They are for adding resources, context parameters, error pages, MIME mappings, tag libraries, welcome files and EJB references.

Click Finish, and then save the file. If you save the file to \AppServer\InstallableApps\ where you installed WebSphere application server, then it will automatically appear in the list of servlets in the administration panel.

Figure 108. Saving the file

Screen grab showing the WebSphere Administrative Console

Next, this component needs to be imported and started. From the wizards button, select "Install Enterprise Application".

Figure 109. Install enterprise application

Screen grab showing the WebSphere Administrative Console

Install your component as a standalone module.

Figure 110. Installing your component as a standalone module

Screen grab showing the WebSphere Administrative Console

Specify an application name, and a root for the web module. This is the part of the URL immediately after the http://hostname:portnumber/ and shouldn't be left as /

Figure 111. Specifying an applilcation name

Screen grab showing the WebSphere Administrative Console

All of the subsequent panels can be left blank, they are about controlling users, EJB roles, JNDI bindings, EJB mappings, resource references, datasources for EJB, data sources for CMP, and virtual hosts.

Figure 112. Information dialog

Screen grab showing the WebSphere Administrative Console

Next, the web module has to be started. Select the application server that it has been configured for. It should appear under Installed Web Modules.

Figure 113. Starting the web module

Screen grab showing the WebSphere Administrative Console

Figure 114. Information dialog success message

Screen grab showing the WebSphere Administrative Console

If everything went well, it should now be available for use from the com.ibm.mqe.trace.MQeTraceToBinaryMidp. Since this servlet doesn't support get, then viewing the URL with a web browser will result in a 405 error. This is normal.

If your application server is set up with the defaults, the URL for the servlet is http://localhost:9080/mqetrace/trace.



© IBM Corporation 2002, 2003. All Rights Reserved