Java Tutorial - Java Scipt : Basic Install

Java Tutorial - Java Scipt :

Basic Install


To start off, we need to download a copy of the Apache Axis project. The latest release is available at http://ws.apache.org/axis/releases.html. At the time of writing, this is version 1.1rc2. Download the axis-1_1rc2.zip
file (for Windows) or the axis-1_1rc2.tar.gz file file (for Linux).

After downloading the file, extract the files from the archive. Unlike many of the other installations, we don’t need to extract them to a common directory. The Axis files will be packaged and deployed as part of a J2EE Web application. Normally, J2EE Web applications are packaged as .war files. However, to
make it easier to access Java Web services, we’re going to deploy Apache Axis in Tomcat as an unpackaged Web application. This is basically a directory with the same structure and files as the .war archive.

To deploy the unpackaged Axis Web application, copy the webapps/axis folder into the Tomcat webapps folder.

On Windows, the command is:

copy webapps\axis %TOMCAT_HOME%\webapps

On Linux, the command is:

cp –r webapps/axis $TOMCAT_HOME/webapps

If you look inside the WEB-INF/libs directory within the Axis Web application, you’ll find library .jar files for JAX/RPC, SAAJ, and WSDL among others. These are some of the standard APIs we covered earlier in our discussions about Java Web services and XML. Apache Axis depends on these Web services standards to provide the foundation. Often the Axis interfaces will give us streamlined access to the APIs.

 Due to some changes in the way Java 1.4 handles package naming, the jaxrpc.jar and saaj.jar files may cause problems when packaged within the WEB-INF/lib directory. If you encounter such an error, the solution is to move the .jar files into the %TOMCAT_HOME%\common\lib directory and then restart Tomcat for the .jar files to be loaded.

Go ahead and start Tomcat if it isn’t already running. Tomcat will pick up the new Web application automatically and deploy the Axis servlet. By default, the Web application is deployed under the Web application’s directory name, axis. This is fine for now. In the Binding Axis under a Different Name section later in the chapter, we’ll demonstrate how to deploy it under a different name and as a .war file.