 | Level: Intermediate Stefan Schmidt (geronimo@stsmedia.net), Ph.D. candidate, Developer and Author
30 Aug 2005 Learn how to incorporate Web services into a
classic Java™ 2 Platform, Enterprise Edition
(J2EE)-based application deployed on the Apache Geronimo
application server. Extending the BookShop example
application, which lets customers use a Web browser to
search a database for books by category, will provide
insight into the configurations required to develop Web
services-enabled applications for the J2EE 1.4 platform. And
by incorporating two J2EE-compliant Web services into
BookShop, you'll implement an expanded architecture that
addresses both service-consumer and service-provider scenarios.
Prerequisites
Java developers with prior experience in J2EE platform
development are the primary audience for this tutorial.
General knowledge of distributed programming concepts
and the role of Web services in this context is
beneficial but not required.
System requirements
Note: While this tutorial's example uses MySQL for the
deployment steps, you can deploy the application using
Apache Derby by converting the SQL
file to make it Derby compliant. Part 2 of this series
provides more detail on deployment with Apache Derby. To run the example code in this tutorial, you need to
perform the following steps:
- Download and install the following applications and
libraries:
- The J2SE 1.4.2_08 SDK
- Apache Geronimo
M4 or later
- Apache Ant
- Apache Axis
1.2.1
- MySQL and MySQL
Connector/J driver
- Sun Java Web
Services Developer Pack (Java WSDP)
- Optionally, download and install the Eclipse SDK.
- Make sure that the environmental variables in Table
1 are set in your shell.
Table 1. Setting the environmental variables
| Variable name | Required setting |
|---|
GERONIMO_HOME
| Set to the root folder of your Geronimo installation |
ANT_HOME
| Set to the root folder of your Ant installation |
JAVA_HOME
| Set to the root folder of your Java installation |
AXIS_HOME
| Set to the root folder of your Axis installation |
AXIS_LIBRARIES
| Set to all libraries in AXIS_HOME/lib |
PROJECT_HOME
| Set to the root folder of the BookShop application |
PATH
| Include JAVA_HOME/bin, ANT_HOME/bin,
JWSDP_HOME and JWSDP_HOME/jaxrpc/bin |
- Create a database called
bookshopdb in MySQL, and then
run the supplied database script
(etc/bookshopdb.sql) to create and populate the
required relational-database tables.
- Create a folder in
%GERONIMO_HOME%/repository/mysql/jars, and copy the
mysql-connector-java-your_version_number.jar
driver to this directory.
- Edit the geronimo-ra.xml database deployment plan
found in %PROJECT_HOME%/etc by updating your exact
MySQL Connector/J driver name, username, password,
and server name as required.
- Edit the build.xml project to set the correct paths
for your Geronimo and Axis installations. Also, look
into %GERONIMO_HOME%/repository/tranql/rars and
adjust the TranQL file name in the build.xml file accordingly.
Duration
Under two hours
Formats html, pdf
|  | |  |