Andreas Hess // Computer // UDDI // DB2 :: MySQL :: SOAPUDDI :: CVS :: Tomcat

How to set up your own UDDI registry

Table of Contents

  1. Needed Programs
  2. Step By Step Setup
    1. Java and Tomcat
    2. Axis
    3. Database
    4. jUDDI
    5. UDDI4J

This page

This page documents the experiences I gained working with UDDI and Java. Any comments are of course welcome. However, please note that I'm working on other things now. Therefore I'm not able to help you with specific jUDDI questions. (Unless you are enrolled in the Intelligent Web Applications course.)

Related Pages

1 Needed programs

To set up your own UDDI registry plus a framework to query a UDDI registry you will need the following programs:

  1. A Java 2 SDK and Runtime Environment
  2. An application server
  3. A transport facility that processes SOAP messages
  4. An XML parser
  5. A build tool
  6. A framework for accessing UDDI within Java
  7. A Database Engine
  8. and finally a UDDI registry

In this setup we will rely on the following instances of these software classes:

  1. Sun Java 2 SDK 1.4.0_02, Sun Java 2 Enterprise Edition (J2EE) 1.3.1
  2. Apache Tomcat 4.1.10
  3. Apache Axis 1.0 RC 1
  4. Apache Xerces-J 2.2.0
  5. Apache Ant
  6. UDDI4J, contributed by IBM to the Open Source community on IBM Developerworks, also available in IBMs Web Services Toolkit on IBM Alphaworks
  7. IBM DB2 or MySQL
  8. jUDDI

Software you might want to have as well includes:

2 Step-by-Step Setup

Most of the programs can be setup and run "out of the box". However, there are some traps in which a user could fall. I will shortly summarize the setup procedure and point to some of these traps. Our goal is to run the samples accompaning UDDI4J. Through these samples any of our components can be tested in working together, as UDDI4J uses a SOAP transport facility (here Apache Axis) to communicate with a UDDI registry (here jUDDI ). Axis uses an XML parser (here Apache Xerces-J), whereas the registry runs within an application server (here Apache Tomcat). And of course, any of these programs needs a Java runtime environment. Therefore we can test, if the whole setup works together.

2.1 Java, Tomcat and Xerces

Start Tomcat and test the installation by pointing your web browser to http://localhost:8080/. The Jakarta Tomcat default page should appear.

2.2 Axis

In the next steps we will install Axis and deploy it, that means we will make it accessible from within the application server. Axis puts XML elements with no defined namespace into default-namespaces starting with ns1 and this causes problems with Xerces-J 2.1.0. So make sure that you use Xerces-J 2.2.0 or later.

(Re-)Start Tomcat and test your Axis installation by pointing your web browser to http://localhost:8080/axis/ and to http://localhost:8080/axis/happyaxis.jsp.

2.3 Database

jUDDI comes with SQL scripts for various databases. I will explain the DB2 and MySQL-Installation a little bit more detailed, but with a little bit of SQL knowledge you can easily adapt one of the SQL scripts to work with any SQL database you like. However, installation and setup of a database requires basic knowledge of database administration. It is beyond the scope of this web page to explain everything in detail. If you don't know what to do although you have read the instructions on this web page, it is always a good idea to consult the database documentation.

If you chose DB2:

See the page on IBM DB2 setup for jUDDI for details.

If you chose MySQL:

See the page on MySQL setup for jUDDI for details.

2.4 jUDDI

In the next step we will install jUDDI.

I have used the source code release jUDDI 0.7.0 and compiled the sources myself. If you want to compile jUDDI yourself as well, this may also be a good time to

as you need it to build your jUDDI from the sources.

The web.xml file is located in the webapps/WEB-INF directory. Near the end of the file, find the references to the and the files. Edit the reference so that it points to the actual location of the properties files. They should be located in the juddi/conf directory.

You have to add a few properties to make jUDDI use the database. The file in the juddi/WEB-INF/src/org/juddi/datastore/jdbc directory contains in its comments the necessary properties.

# required JDBC DataSource properties
juddi.dataSource          = java:comp/env/jdbc/juddiDB

# required JDBC Driver properties
juddi.useConnectionPool   = true
juddi.jdbcDriver          = com.mysql.jdbc.Driver
juddi.jdbcURL             = jdbc:mysql://localhost/juddi
juddi.jdbcUser            = juddi
juddi.jdbcPassword        = juddi

Add the above lines to the end of the file. It has been reported that in some cases jUDDI does not read the connection data properly from the properties. This is probably dependent on your installation or on the version of jUDDI or Tomcat. In these cases the conf/server.xml file needs some amendments, too. These changes are described on a separate page.

Note that all these settings that were discussed above are for MySQL! If you use any other database, you have to edit the above properties differently. The jdbcDriver property is sun.jdbc.odbc.JdbcOdbcDriver for any database that is connected through ODBC. If you have configured DB2 with the Client Configuration assistant, access is through ODBC. The database name is then jdbc:odbc:juddi (if your ODBC data source is called juddi).

To see if everything works, start Tomcat and point your browser to http://localhost:8080/juddi/happyjuddi.jsp. This should take you to the "jUDDI happiness page". If you see something like

got a JNDI Context!
got a jUDDI DataSource!

then your installation is probably fine.

2.5 UDDI4J

UDDI4J is a framework to allow access to a UDDI registry from Java.

It might be necessary to apply the following code change to

if (node.getNodeType() == node.ELEMENT_NODE &&
  node.getLocalName().equals(tag)) { 
if (node.getNodeType() == node.ELEMENT_NODE &&
  node.getNodeName().equals(tag)) { 

This code is located in the method public NodeList getChildElementsByTagName(Element el, String tag).

26 Mar 2007, Andreas Hess, andreas at idirlion dot de