Websphere Configuration

From Skyway Wiki

Jump to: navigation, search

This page describes any considerations regarding the deployment of a fully or partially generated Spring MVC and Spring Web Flow applications to WebSphere application servers.

This page has been updated to reflect the use of Skyway Builder 6.3.

Contents

WebSphere 6.1.0.x with EJB3 pack running JDK 5

Here are the steps to deploy to WebSphere 6.1.0.x:

  • From the Enterprise Configuration tab of the Spring DSL, configure the project as follows:
    • Container: WebSphere
      • Transactions: Container
      • Persistence: Hibernate
    • Must manually create the data source through the admin console

WebSphere 7.0

Here are the steps to deploy to WebSphere 7.0:

  • From the Enterprise Configuration tab of the Spring DSL, configure the project as follows:
    • Container: WebSphere
      • Transactions: Container
      • Persistence: Container
    • Must manually create the data source through the admin console


Mandatory Configurations

Page Access By default, WebSphere will not allow for URLs that do not point to a physical JSP or HTML page to be accessed. Skyway built applications, like most, use action handlers for invoking logic to keep a clean separation between View (pages) and Control (logic). As Spring MVC is the web infrastructure used by applications built within Skyway, WebSphere must be configured to allow for URLs that do not have physical pages to be accessible. To do this, you must set the custom property of com.ibm.ws.webcontainer.invokefilterscompatibility to true for the application server.

References:


Page Parsing

By default, WebSphere will not automatically parse EL expressions on JSPs unless the version of the XSD pointed to is an exact match of the web version supported by the container. By default, Skyway produces a web.xml file that is 2.5 compliant, but will, of course, run on older web containers. An easy solution is to explicitly instruct each JSP to enable ELParsing. Simply adding the bolded attribute to the page tag will enable this.

   <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
   pageEncoding="ISO-8859-1" isELIgnored="false" %>

If you are creating your JSPs in Eclipse, then this attribute is automatically added if you use Skyway JSP File as the default template when making new JSPs.


Web Sphere and the Dollar Sign "$"

Avoid placing a dollar sign "$" directly to the left-hand-side of a custom tag in your jsps. WebSphere will attempt to parse the $<custom-tag> as EL, which will result in an exception (specifcally an ArrayIndexOutOfBoundsException).

Configuring Websphere 6.1 for Skyway Projects with Webservices

First you need to log into the Websphere Admin console to set up shared libraries. Make sure that the needed jar files are on the file system of the machine hosting Websphere.

The jars that will be needed are:

  • jaxws-api-2.1-1.jar
  • wsdl4-1.6.1.jar
  • geronimo-ws-metadata_2.0_spec-1.1.2.jar

While in the Websphere Administrator console, go to the Environments section and expand it.

  1. Click the Shared Libraries link.
  2. Click the New button
  3. Give the shared library a name.
    1. In the Class path section, give the absolute path to the necessary jar files. See the example below.
      1. c:\WSLib\wsdl4j-1.6.1.jar
      2. c:\WSLib\geronimo-ws-metadata_2.0_spec-1.1.2.jar
      3. c:\WSLib\jaxws-api-2.1-1.
  4. Click Apply
  5. Add the shared library to the server via Application servers > server1 > (Java and Process Management) Class loader > Shared library References
  6. Restart Websphere.

After Deploying a Skyway Project to Websphere 6.1.0.x

After a deploy, go to the Enterprise Applications section under Applications; your app will be listed there with a red x - meaning it's not running.

  1. Click on the application to be configured; you will be taken to another screen
  2. Click the Classloading and update detection link; you will get a new page.
  3. Here, enter a value for the Polling Interval
  4. Select Classes loaded with application class loader first radio button
  5. Select Class loader for each WAR file in application radio button
  6. Click Apply
  7. Return to the Enterprise Applications section, select the checkbox by the newly configured application and click start, or you can restart the entire server.

Configuring Websphere 7.0 for Skyway Projects with Webservices

Disable automatic library updates

  • From the Category Mapping tab of the Spring DSL, configure the project as follows:
    • Check the "Disable automatic dependency updates to projects" checkbox

Configure Build Path

  1. Right Click on your web project and select Build Path -> Configure Build Path... from the context menu
  2. Select the Libraries tab
  3. Select the all.atomikos.execution library and then click on the Remove button
  4. Select the all.webservice.execution library and then click on the Remove button
  5. Select the all.xml.execution library and then click on the Remove button
  6. Create a lib directory under the WebContent/WEB-INF directory in your web project if it does not exist
  7. Add the xml-resolver-1.2.jar file to the lib directory

After Deploying a Skyway Project to Websphere 7.0

After a deploy, expand and select the Applications -> Application Types -> Websphere enterprise applications option. Your app will be listed there with a red x - meaning it's not running.

  1. Click on the application to be configured; you will be taken to another screen
  2. Click the Classloading and update detection link; you will get a new page.
  3. Select Classes loaded with local class loader first (parent last) radio button
  4. Select Single class loader for application radio button
  5. Click Apply
  6. Return to the Enterprise Applications section, select the checkbox by the newly configured application and click start, or you can restart the entire server.
Personal tools