Installing the jUDDI UDDI Server and Publishing WSDL, Part 1 - Installation and Configuration

By Joel Barnum, Descriptor Systems.

Introduction

In this article, you will learn how to install the open-source jUDDI server and configure it. In Part 2, you will publish a Web service's WSDL to it.

This article assumes that you are familiar with SOAP, WSDL and UDDI, as these topics will not be explored here.

Blatant, shameless plug: If you are not familiar with SOAP, WSDL and UDDI, I recommend that you get some Web services training from Descriptor Systems. You can find more information at www.descriptor.com. Thanks!

Update: Unfortunately, these instructions do NOT work if you have Java 1.6 installed. Apparently, there is a bug with no workaround due to a conflict between jUDDI and Java 6.

Here are the software packages you will need:

Installing and Configuring jUDDI

  1. Install the Java Standard Edition according to the instructions on the Sun website. Install the JSE's bin directory into the PATH as is normal for your operating system.
  2. Install Apache Tomcat according to the instructions from the Apache website. Note the installation directory -- we will refer to it as the TOMCAT-HOME in this article.
  3. Unzip the HypersonicSQL archive to a directory of your choice. We will refer to this as the HSQL-HOME in this article.
  4. Unzip the jUDDI archive to a directory of your choice. We will refer to this as the JUDDI-HOME in this article.
  5. Copy the {HSQL-HOME}/lib/hsqldb.jar to {TOMCAT-HOME}/common/lib. This makes the HypersonicSQL database runtime available to Tomcat.
  6. Create a directory under TOMCAT-HOME named db. We will create the HSQLDB database for the UDDI storage here.
  7. Next, you will create the UDDI database. Open a command prompt window or terminal and change to the {TOMCAT-HOME}/common/lib directory. Then enter the following to start the HSQLDB admin GUI:
    java -cp hsqldb.jar org.hsqldb.util.DatabaseManager        
            

    In the GUI, enter or select the following, leaving the rest as their default values:

    Type: HSQL Database Engine Standalone
    URL: jdbc:hsqldb:file:{TOMCAT-HOME}/db/uddi

    Be sure to substitute the actual pathname for {TOMCAT-HOME} (note that forward slashes are OK even in Windows). Then press OK.

  8. In the HSQLDB GUI, choose File - Open Script and navigate to the {JUDDI-HOME}/sql/hsqldb folder, then select the create_database.sql script and press Open. To run the script, press the Execute button. The HSQL GUI will report an "Update Count" of 1.
  9. Repeat the above step to open the {JUDDI-HOME}/sql/hsqldb/insert_publishers.sql script. Before executing it, remove the "--" comment characters in front of the INSERT and VALUES lines in the script. After executing, you should see an "Update Count" of 1.

    You can then choose View - Refresh Tree from the GUI's menu to see the database tables.

    To further test, highlight and delete the text INSERT command text and then enter:

    SELECT COUNT(*) FROM PUBLISHER         
            

    You should see a result of "1". Close the GUI when you are finished.

  10. Copy the {JUDDI-HOME}/webapps/juddi directory to {TOMCAT-HOME}/webapps. You should end up with a {TOMCAT-HOME}/webapps/juddi directory that contains index.html, happyjuddi.jsp and several subdirectories. This installs the jUDDI web application into Tomcat.
  11. In the {TOMCAT-HOME}/webapps/juddi/META-INF directory, create a file named context.xml. Enter the following into the file:
    <Context path="/juddi" docBase="juddi" debug="5" reloadable="true" 
      crossContext="true">
      <Logger className="org.apache.catalina.logger.FileLogger"
                   prefix="localhost_juddiDB_log" suffix=".txt"
                   timestamp="true"/>
                   
      <Resource name="jdbc/juddiDB" 
               auth="Container"
               type="javax.sql.DataSource"
               username="sa" password=""
               driverClassName="org.hsqldb.jdbcDriver"
               url="jdbc:hsqldb:file:{TOMCAT-HOME}/db/uddi"
               validationQuery="select publisher_ID from PUBLISHER"/>
      <Resource name="jdbc/juddi" 
               auth="Container"
               type="javax.sql.DataSource"
               username="sa" password=""
               driverClassName="org.hsqldb.jdbcDriver"
               url="jdbc:hsqldb:file:{TOMCAT-HOME}/db/uddi"
               validationQuery="select publisher_ID from PUBLISHER"/>                 
    </Context>       
            

    Be sure to replace the {TOMCAT-HOME} placeholders with the actual pathname. This file configures two DataSources so that the jUDDI application can use the HSQLDB database tables you created in an earlier step.

  12. Edit the {TOMCAT-HOME}/webapps/juddi/WEB-INF/web.xml file and near the bottom, copy the existing resource-ref element so there are two. Edit the copy to define a res-ref-name of jdbc/juddi. The two resource-ref elements should look like:
      <resource-ref>
        <description>jUDDI DataSource</description>
        <res-ref-name>jdbc/juddiDB</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>
      <resource-ref>
        <description>jUDDI DataSource</description>
        <res-ref-name>jdbc/juddi</res-ref-name>
        <res-type>javax.sql.DataSource</res-type>
        <res-auth>Container</res-auth>
      </resource-ref>        
            
  13. In the command prompt or terminal window, change to the {TOMCAT-HOME}/bin folder and start Tomcat by entering one of the following, depending on your operating system:
    catalina run         -- for Windows
    ./catalina.sh run    -- for *nix    
            
  14. Test jUDDI by opening a Web browser and entering the following URL:
    http://localhost:8080/juddi/happyjuddi.jsp        
            

    You should not see any errors on the page (no red text).

  15. One final test. Enter the following URL into your browser:
    http://localhost:8080/juddi/console/get_authToken.jsp        
            

    In the top multi-line entry area, change the userID from *** to jdoe and the cred from *** to an empty string. Then press the Submit button.

    In the bottom multi-line area, you should see a returned SOAP message with an authInfo element containing text of the form authToken:xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx. If that worked, then you have successfully installed and configured jUDDI!