# Howto: install jUDDI server on JOnAS

- I. UDDI Servers
- II. jUDDI Overview
- III. How to Find the Latest Version
- IV. Install Steps
  - A. Create the jUDDI webapp
  - 1. Compilation
  - 2. Customization
  - B. Create the Database
  - 1. Retrieve the sql scripts for your database
  - 2. Setup the database
  - C. Configure JOnAS Datasource
  - D. Deploy and test jUDDI
- V. Links

## I. UDDI Server

A UDDI server is basically a web services registry.
Providers of web services put technical information (such as the WSDL definition used to access the web service, description, ...) inside these registries. Web service Consumers can browse these registries to choose a web services that fits their needs.

## II. jUDDI Overview

jUDDI (pronounced "Judy") is a Java-based implementation of the Universal Description, Discovery, and Integration (UDDI) specification (v2.0) for Web services. It is implemented as a pure Java web application and can be deployed with a minimum amount of work inside JOnAS.
Refer to http://ws.apache.org/juddi for more information.

## III. How to Find the Latest Version

JOnAS already includes jUDDI as a preconfigured webapp (CVS Snapshot (21-Jan-2005) + 2 patchs). For the latest jUDDI version, refer to http://ws.apache.org/juddi.

## IV. Install Steps

jUDDI requires a minimum of configuration steps to be successfully deployed inside JOnAS.
If you use the JOnAS provided juddi.war, skip step 1., "Compilation," and start with Step 2., "Customization."

### A. Create the juddi webapp

#### 1. Compilation

Go to the directory where the jUDDI sources are located (JUDDI_HOME).
Customize the JUDDI_HOME/conf/juddi.properties configuration file.
`# jUDDI Proxy Properties (used by RegistryProxy and the Console)
juddi.proxy.adminURL = http://localhost:9000/juddi/admin
juddi.proxy.inquiryURL = http://localhost:9000/juddi/inquiry
juddi.proxy.publishURL = http://localhost:9000/juddi/publish
juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
# jUDDI HTTP Proxy Properties
juddi.httpProxySet = true
juddi.httpProxyHost = proxy.viens.net
juddi.httpProxyPort = 8000
juddi.httpProxyUserName = sviens
juddi.httpProxyPassword = password`
Launch compilation with ant war. That will produce a juddi.war inside JUDDI_HOME/build/ directory.

#### 2. Customization

JOnAS provide a lightweight `juddi.war` file from which all unnecessary libraries have been removed.

The original `juddi.war` (created from JUDDI_HOME) has a lot of libraries inside its `WEB-INF/lib` that are already provided by JOnAS. These files, listed below, can safely be removed:

- axis.jar
- commons-discovery.jar
- commons-logging.jar
- jaxrpc.jar
- saaj.jar
- wsdl4j.jar

By default, jUDDI includes a jonas-web.xml descriptor (in JUDDI_HOME/conf). This descriptor specifies the jndi name of the DataSource used in jUDDI; its default value is: jUDDIDB. This value will be used in the <datasource>.properties of JOnAS.

### B. Create the Database

#### 1. Retrieve the SQL scripts for your database

jUDDI comes with SQL files for many databases (MySQL, DB2, HSQL, Sybase, PostgreSQL, Oracle, TotalXML, JDataStore).
SQL Scripts are different for each version of jUDDI:

- MySQL
  - create_database.sql insert_publishers.sql
- DB2
  - create_database.sql insert_publishers.sql
- HSQL
  - create_database.sql insert_publishers.sql
- Sybase
  - create_database.sql insert_publishers.sql
- PostgreSQL
  - create_database.sql insert_publishers.sql
- Oracle
  - create_database.sql insert_publishers.sql
- TotalXML
  - create_database.sql insert_publishers.sql
- JDataStore
  - create_database.sql insert_publishers.sql

#### 2. Setup the database

Execute the given scripts (table creation, tmodels insertions and publishers insertions).
Then, a publisher (the user who has the rights to modify the UDDI server) must be added manually. This is currently the only way to add a publisher for jUDDI.

### C. Configure JOnAS Datasource

As jUDDI uses a DataSource to connect to the database, JOnAS must be configured to create this DataSource.
This is done as usual in JOnAS:
Create a file (named ws-juddi-datasource.properties for example) and populate it with the appropriate database configuration information.
`###################### MySQL DataSource configuration example
# datasource.name is the jndi-name set in the jonas-web.xml
datasource.name jUDDIDB
# datasource.url is the URL where database can be accessed`
`datasource.url jdbc:mysql://localhost/db_juddi
#` `datasource.classname is the JDBC Driver classname`
`datasource.classname com.mysql.Driver
# Set here DB username and password
datasource.username XXX
datasource.password XXX
#` `available values : rdb,rdb.postgres,rdb.oracle,rdb.oracle8,rdb.mckoi,rdb.mysql`
`datasource.mapper rdb.mysql`
Add the datasource properties filename (without the suffix .properties) in your ($JONAS_BASE|$JONAS_ROOT)/conf/jonas.properties
`jonas.service.dbm.datasources <datasource-filename>`.

### D. Deploy and test jUDDI

Deploy jUDDI on JOnAS with a command line similar to the following:
`$ jonas admin -a ~/juddi/juddi.war
` The following output should display: `
11:53:57,984 : RegistryServlet.init : jUDDI Starting: Initializing resources and subsystems.
11:53:58,282 : AbsJWebContainerServiceImpl.registerWar : War /home/sauthieg/sandboxes/ws-projects/ws-juddi/build/juddi.war available at the context /juddi.
`
Open your web browser and go to the URL http://localhost:9000/juddi/happyjuddi.jsp to confirm that the jUDDI setup is successful.
If setup is successful, then your UDDI server can be accessed through any UDDIv2.0-compliant browser.
inquiryURL = http://localhost:9000/juddi/inquiry
publishURL = http://localhost:9000/juddi/publish

## V. Links

- UDDI web site (http://uddi.org/)
- jUDDI web site (http://ws.apache.org/juddi)
- UDDI4J Java implementation (http://www.uddi4j.org)
- IBM UDDI Test Registry (https://uddi.ibm.com/testregistry/registry.html)
- Microsoft UDDI Test Registry (http://uddi.microsoft.com/)
- methods web Site (http://www.xmethods.net/)
- UDDI Browser (http://www.uddibrowser.org/)