Building the BeenThere Sample with Ant build tool


J2EE portability
Rebuilding the Samples that ship in this gallery
Getting started
Identifying the directory structure
Rebuilding and installing the Sample

J2EE portability

One of the great benefits of developing applications on a J2EE platform is portability.  All of the Sample programs in the Samples Gallery are developed on a workstation and run on z/OS systems without changing one line of Java code.  By building J2EE applications on Intel or UNIX systems, a developer can eliminate the challenges of EBCDIC to ASCII or ASCII to EBCDIC file conversions.  The availability of tools makes it easy for developers to write and test on a development workstation and install the enterprise archive (EAR) files on z/OS systems.

Rebuilding the Samples that ship in this gallery

Every WebSphere Application Server (Application Server) for z/OS customer is entitled to the Application Server media for multiplatforms. If you install the WebSphere Application Server base product and the Samples on one of the platforms supported by this package you see the same gallery. The one exception is that when you click sample_name > Build with Ant > platform > Rebuilding and installing the sample.ear file, you get instructions to rebuild the EAR file on that platform.  Because text files in an EAR file (XML, xmi, JavaServer Pages (JSP) files, and so on) must be in an ASCII format, it is easier to edit those files on an ASCII machine.  If you make changes on an ASCII machine, you can then deploy and install the resulting EAR file on the z/OS platform without an EBCDIC to ASCII conversion. 



Getting started

Install WebSphere Application Server on the distributed platform of your choice and indicate to install Application Server Sample applications as well.

Make a backup copy of the <profile_root> directory before attempting to modify or rebuild the Samples. Create a zip file of the samples directory. You can restore the samples directory to its original state by extracting the zip file.



Identifying the directory structure

The Sample is build directory structure is as follows:


profile_root/samples/src/BeenThere Contains the Sample source code for the BeenThere Sample.
profile_root/samples/lib/BeenThere Contains the BeenThere.ear file for the BeenThere Sample.
profile_root/samples/javadoc/BeenThere Contains the Javadoc documentation that generates when the BeenThere Sample is built.
profile_root/samples/bld/BeenThere Contains the generated class files. Use these class files to generate the final BeenThere.ear file. The bld directory is created after the BeenThere Sample is rebuilt.



Rebuilding and installing the Sample

The following directions describe the steps to rebuild the Sample.


Running the Sample build script

Follow these steps to run the Sample build script that rebuilds the Sample:

  1. Open a command prompt.
  2. At the command line, change to the profile_root/samples/src/BeenThere directory.
  3. Run the Sample build script:

  4. Type the following command:

    profile_root\samples\bin\BeenThere\buildBeenThere.bat

    Type the following command:

    . profile_root/samples/bin/BeenThere/buildBeenThere.sh

    • On Windows development platforms, type the following command:

      profile_root\samples\bin\BeenThere\buildBeenThere.bat

    • On UNIX and Linux development platforms, type the following command:

      . profile_root/samples/bin/BeenThere/buildBeenThere.sh
    Type the following command:

    . profile_root/samples/bin/BeenThere/buildBeenThere.sh

The Sample is now built.

Find the buildBeenThere.bat or the buildBeenThere.sh script in the profile_root/samples/bin/BeenThere directory. The scripts set the appropriate class path information and run the Ant build utility. The Ant utility reads the build.xml files, which describe how to build the Samples. Refer to the Jakarta Web site for additional documentation on Ant.

Transferring the rebuilt BeenThere.ear file

Use the File Transfer Protocol (FTP) to transfer the binary EAR file to the z/OS server, using the following instructions.

  1. Find the rebuilt EAR file in the <profile_root>/samples/lib/BeenThere directory
  2. Open an FTP session to the WebSphere Application Server for z/OS from the development platform
  3. Change directory to <profile_root>/samples/lib/BeenThere
  4. del BeenThere.ear
  5. bin
  6. put BeenThere.ear
  7. quit

Removing and reinstalling the BeenThere.ear file

Reinstall the Sample as described in the following steps:


  1. Launch the administrative console by opening a Web browser and going to http://<host_name>:9060/ibm/console where <host_name> is the host name or IP address where deployment manager is running.
  2. Launch the administrative console by opening a Web browser and going to http://<host_name>:9060/ibm/console where <host_name> is the host name or IP address where deployment manager is running.
  3. Launch the administrative console by opening a Web browser and going to http://<host_name>:9080/admin where <host_name> is the host name or IP address where deployment manager is running.
  4. Launch the administrative console by opening a Web browser and going to http://<host_name>:9060/ibm/console where <host_name> is the host name or IP address where deployment manager is running.
  5. Click Servers > Clusters.
  6. Select all of the clusters.
  7. Click Stop.
  8. Click Applications > Enterprise Applications.
  9. Select the BeenThere application.
  10. Click Uninstall.
  11. Click Save at the top of the main panel in the administrative console.
  12. Click Save.
  13. Complete the steps for Installing the BeenThere.ear file.

The rebuilt BeenThere.ear file is now deployed to your Application Servers.