Andreas Hess // Computer // UDDI // Tomcat

How to Setup Tomcat for jUDDI

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 of Tomcat needs to be changed. You will have to add a new context in the server.xml file.

For Tomcat 4

  <Context path="/juddi" docBase="juddi"
              debug="5" reloadable="true" crossContext="true">
    <Logger className="org.apache.catalina.logger.FileLogger"
              prefix="localhost_juddiDB_log" suffix=".txt"
    <Resource name="jdbc/juddiDB"
    <ResourceParams name="jdbc/juddiDB">

      <!-- Maximum number of dB connections in pool. Make sure
           you configure your mysqld max_connections large enough to
           handle all of your db connections. Set to 0 for no limit.


     <!-- Maximum number of idle dB connections to retain in
         pool. Set to 0 for no limit.



      <!-- MySQL dB username and password for dB connections  -->



      <!-- Class name for mm.mysql JDBC driver -->


      <!-- The JDBC connection url for connecting to your MySQL dB.
           The autoReconnect=true argument to the url makes sure
           that the mm.mysql JDBC Driver will automatically reconnect if
           mysqld closed the connection.
           mysqld by default closes idle connections after 8 hours.



Thanks to "freeman" for pointing this out to me. He also pointed me to a mailing list mail that might contain valuable information if you have trouble getting jUDDI to work.

For Tomcat 5

In Tomcat 5, the syntax for the server.xml file has changed.

<Context path="/juddi" docBase="juddi" debug="5" reloadable="true" crossContext="true">
  <Resource name="jdbc/juddiDB" auth="Container" type="javax.sql.DataSource"
            username="juddi" password="juddi" driverClassName=""
            validationQuery="select count(*) from PUBLISHER" />  

Thanks to Steven Hulshof for contributing the XML snippet for Tomcat 5.


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).

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