JBoss.orgCommunity Documentation

Chapter 8. How to deploy jUDDI To?

Table of Contents

8.1. Tomcat
8.1.1. OpenJPA and CXF
8.1.2. Hibernate and CXF
8.1.3. OpenJPA and Axis2
8.2. JBoss
8.2.1. JBossAS 6.0.0.GA
8.2.2. JBossAS 7.x/JBossEAP-6.x
8.3. Deploying to Glassfish
8.3.1. Glassfish jars
8.3.2. Configure the JUDDI datasource
8.3.3. Add juddiv3-cxf.war
8.3.4. Run jUDDI

The jUDDI distribution ships preconfigured on Tomcat - it runs out of the box. All you have to do in go into the juddi-distro-<version>/juddi-tomcat-<version>/bin directory and start up Tomcat. All of this just as described in Chapter 2, Getting Started.

By default the juddiv3.war is configured to use OpenJPA and CXF. If you want to change your JPA or WS provider, or you’d like to run on a different container then this chapter may come in handy, as there a number of scripted profiles to change the configuration and dependencies in the juddiv3.war. To run these maven based scripts you need to go into juddi-distro-<version>/juddiv3-war directory.

This section describes how to deploy juddi to JBoss 6.0.0.GA.

First, download jboss-6.0.0.GA - the zip or tar.gz bundle may be found at http://www.jboss.org/jbossas/downloads/. Download the bundle and uncompress it.

Target platform JBoss-6.x and HSQL using Hibernate and JBossWS-cxf. The juddiv3.war relies on Hibernate and JBossWS-cxf in the appserver.

mvn clean package -P hibernate-jbossws-cxf

KNOWN ISSUES

Issue 1
15:14:37,275 SEVERE [RegistryServlet] jUDDI registry could not be started. org.apache.commons.configuration.ConfigurationException: java.util.zip.ZipException: error in opening zip file: org.apache.commons.configuration.ConfigurationException: org.apache.commons.configuration.ConfigurationException: java.util.zip.ZipException: error in opening zip file

Workaround: deploy juddiv3.war as a directory (not a zip file).

Issue 2

JBoss-5.x Note that configuration 3 and 4 will also run on JBoss-5.x, but you may run into the following

ERROR [org.jboss.ws.metadata.wsdl.xmlschema.JBossXSErrorHandler] (main) [domain:http://www.w3.org/TR/xml-schema-1]::[key=src-resolve]::Message=src-resolve: Cannot resolve the name ns1:Signature to a element declaration component.

Workaround: Unzip the deployers/jbossws.deployer/jbossws-native-core.jar and add the xmldsig-core-schema.xsd in the schema directory,

10293 Fri May 27 14:40:40 EDT 2011 schema/xmldsig-core-schema.xsd

Edit the file META-INF/jbossws-entities.properties by adding a line at the bottom saying:

http\://www.w3.org/2000/09/xmldsig#=schema/xmldsig-core-schema.xsd

Copy juddiv3.war to server/default/deploy and unpack it.

Insert jboss-web.xml into the juddiv3.war/WEB-INF directory , should look like the following :

<?xml version="1.0" encoding="ISO-8859-1"?>

<!DOCTYPE jboss-web PUBLIC
	"-//JBoss//DTD Web Application 2.3V2//EN"
    "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">

<jboss-web>

    <resource-ref>
        <res-ref-name>jdbc/JuddiDS</res-ref-name>
        <jndi-name>java:JuddiDS</jndi-name>
    </resource-ref>
    <depends>jboss.jdbc:datasource=JuddiDS,service=metadata</depends>

</jboss-web>

The first step for configuring a datasource is to copy your JDBC driver into the classpath. Copy your JDBC driver into ${jboss.home.dir}/server/${configuration}/lib, where configuration is the profile you wish to start with (default, all, etc.). Example :

cp mysql-connector-java-5.0.8-bin.jar /opt/jboss-5.1.0.GA/server/default/lib

Next, configure a JBoss datasource file for your db. Listed below is an example datasource for MySQL :

<?xml version="1.0" encoding="UTF-8"?>
<datasources>
 <local-tx-datasource>
   <jndi-name>JuddiDS</jndi-name>
   <connection-url>jdbc:mysql://localhost:3306/juddiv3</connection-url>
   <driver-class>com.mysql.jdbc.Driver</driver-class>
   <user-name>root</user-name>
   <password></password>
   <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>

   <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
   <metadata>
      <type-mapping>mySQL</type-mapping>
   </metadata>
 </local-tx-datasource>
</datasources>

Next, make a few changes to the juddiv3.war/classes/META-INF/persistence.xml. Change the "hibernate.dialect" property to match the database you have chosen for persistence. For MySQL, change the value of hibernate.dialect to "org.hibernate.dialect.MySQLDialect". A full list of dialects available can be found in the hibernate documentation (https://www.hibernate.org/hib_docs/v3/api/org/hibernate/dialect/package-summary.html). Next, change the <jta-data-source> tags so that it reads <non-jta-data-source>, and change the value from java:comp/env/jdbc/JuddiDS to java:/JuddiDS.

This section describes how to deploy juddi to Glassfish 2.1.1. These instructions will use CXF as a webservice framework.

First, download the glassfish-v2.1.1 installer JAR. Once downloaded,install using the JAR and then run the ant setup script :

java -jar glassfish-installer-v2.1.1-b31g-linux.jar
cd glassfish
ant -f setup.xml