VAJava and WebSphere Test Environment

Forewords and Requirements

This tutorial explains how to run Turbine within VisualAge for Java WebSphere Test Environment.

This tutorial works with VAJava 3.5.2 and 3.5.3. Please tell us if you find that it works with other versions.

Step 1 : Import the correct packages in VAJava

Let's assume the following conventions : {Turbine dir} is the directory where you have unzipped the Turbine distribution or sources and {VAJava dir} is the directory where VAJava is installed. Let's also define {WTE dir} to be the WebSphere Test Environment directories, i.e. {VAJava dir}/ide/project_resources/IBM WebSphere Test Environment.

You need to create a project : Turbine

Import into Turbine project all JARS/SRC associated with the specific Turbine release

Step 2 : Modify WebSphere Test Environment

Edit default.servlet_engine

Edit {WTE dir}/properties/default.servlet_engine and add the following under the default_app webgroup :

    <websphere-webgroup name="turbine">
       <description>Turbine Application Framework</description>
       <document-root>$approot$/web</document-root>
       <classpath>$approot$/servlets</classpath>
       <root-uri>/turbine</root-uri>
       <auto-reload enabled="true" polling-interval="3000"/>
       <shared-context>false</shared-context>
    </websphere-webgroup>

Create a turbine directory

Create a directory called turbine under {WTE dir}/hosts/default_host. Under turbine create another 2 subdirectories : servlets and web.

Create the following directories (which is similiar to the TDK distribution) under the web directory.

  • images
  • logs
  • resources
  • stylesheets
  • templates
  • WEB-INF/conf
  • Copy the TurbineResource.properties file to the "WEB-INF/conf" directory. The templates, logs etc. directories are quite self explanetory I think.

    Create a turbine.webapp file

    Create a turbine.webapp file in {WTE dir}/host/default_app/servlets and put the following content :

    <webapp>
       <name>turbine</name>
       <description>Turbine Application Framework</description>
       <error-page>/ErrorReporter</error-page>
    
       <servlet>
          <name>turbine</name>
          <description>Turbine Application Framework</description>
          <code>org.apache.turbine.Turbine</code>
          <servlet-path>/ServletRedirector</servlet-path>
          <autostart>true</autostart>
       </servlet>
     </webapp>
    

    Step 3 : Edit VAJava workspace classpath

    In the WebSphere Test Environment under Servlet Engine, add Turbine to the classpath.