Apache jUDDICommunity Documentation

Chapter 12. Deploying to JBoss 5.1.0.GA

12.1. Introduction
12.2. Add juddiv3.war
12.3. Configure Datasource

This section describes how to deploy juddi to JBoss 5.1.0.GA. These instructions will use CXF as a webservice framework rather than JBoss WS native.

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

Next, download jbossws-cxf-3.2.0.zip - which can be found at http://www.jboss.org/jbossws/downloads/. Uncompress it.

In the uncompressed jbossws-cxf-3.2.0, rename ant.properties-example to ant.properties. Edit ant.properties and set the jboss.510.home property to the directory where you unpacked your jboss-5.1.0.GA installation.

Next, execute the ant target "ant deploy-jboss510". Once CXF is deployed, start the server and verify the installation with 'ant tests'.

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/juddiDB</res-ref-name>
        <jndi-name>java:/juddiDB</jndi-name>
    </resource-ref>

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