Skip to main content


developerWorks  >  Open source | Java technology | WebSphere  >

J2EE Web services in Geronimo, Part 1

JAX-RPC service endpoints, EJB endpoints, and client APIs

developerWorks

Level: Intermediate

Stefan Schmidt (geronimo@stsmedia.net), Ph.D. candidate, Developer and Author

30 Aug 2005

Register now or sign in using your IBM ID and password.

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:

  1. 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)
  2. Optionally, download and install the Eclipse SDK.
  3. Make sure that the environmental variables in Table 1 are set in your shell.

    Table 1. Setting the environmental variables
    Variable nameRequired 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

  4. 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.
  5. Create a folder in %GERONIMO_HOME%/repository/mysql/jars, and copy the mysql-connector-java-your_version_number.jar driver to this directory.
  6. 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.
  7. 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


Share this....

digg Digg this story del.icio.us del.icio.us Slashdot Slashdot it!


Back to top


Document options

Document options requiring JavaScript are not displayed


My developerWorks needs you!

Connect to your technical community