This project has retired. For details please refer to its Attic page.
<link rel="stylesheet" type="text/css" href="css/jbossorg.css"/><meta name="generator" content="DocBook XSL Stylesheets V1.76.1"/><link rel="home" href="index.html" title=""/><link rel="up" href="index.html" title=""/><link rel="prev" href="ch07.html" title=""/><link rel="next" href="ch09.html" title=""/><link rel="copyright" href="ln-d2e27.html" title=""/><meta xmlns:d="http://docbook.org/ns/docbook" xmlns:rf="java:org.jboss.highlight.XhtmlRendererFactory" http-equiv="Content-Type" content="text/html; charset=UTF-8"/></head><body><p xmlns:d="http://docbook.org/ns/docbook" id="title"><a href="http://www.jboss.org" class="site_href"><strong>JBoss.org</strong></a><a href="http://docs.jboss.org/" class="doc_href"><strong>Community Documentation</strong></a></p><ul xmlns:d="http://docbook.org/ns/docbook" class="docnav"><li class="previous"><a accesskey="p" href="ch07.html"><strong/></a></li><li class="next"><a accesskey="n" href="ch09.html"><strong/></a></li></ul><div class="chapter"><div class="titlepage"><div><div><h2 class="title"><a id="chapter-HowToDeployjUDDITo"/></h2></div></div></div><div class="toc"><p><strong/></p><dl><dt><span class="section"><a href="ch08.html#_tomcat">8.1. Tomcat</a></span></dt><dd><dl><dt><span class="section"><a href="ch08.html#_openjpa_and_cxf">8.1.1. OpenJPA and CXF</a></span></dt><dt><span class="section"><a href="ch08.html#_hibernate_and_cxf">8.1.2. Hibernate and CXF</a></span></dt><dt><span class="section"><a href="ch08.html#_openjpa_and_axis2">8.1.3. OpenJPA and Axis2</a></span></dt></dl></dd><dt><span class="section"><a href="ch08.html#_jboss">8.2. JBoss</a></span></dt><dd><dl><dt><span class="section"><a href="ch08.html#_jbossas_6_0_0_ga">8.2.1. JBossAS 6.0.0.GA</a></span></dt><dt><span class="section"><a href="ch08.html#_jbossas_7_x_jbosseap_6_x">8.2.2. JBossAS 7.x/JBossEAP-6.x</a></span></dt></dl></dd><dt><span class="section"><a href="ch08.html#_deploying_to_glassfish">8.3. Deploying to Glassfish</a></span></dt><dd><dl><dt><span class="section"><a href="ch08.html#_glassfish_jars">8.3.1. Glassfish jars</a></span></dt><dt><span class="section"><a href="ch08.html#_configure_the_juddi_datasource">8.3.2. Configure the JUDDI datasource</a></span></dt><dt><span class="section"><a href="ch08.html#_add_juddiv3_cxf_war">8.3.3. Add juddiv3-cxf.war</a></span></dt><dt><span class="section"><a href="ch08.html#_run_juddi">8.3.4. Run jUDDI</a></span></dt></dl></dd></dl></div> <p>The jUDDI distribution ships preconfigured on Tomcat - it runs out of the box. All you have to do in go into the <code class="literal">juddi-distro-<version>/juddi-tomcat-<version>/bin</code> directory and start up Tomcat. All of this just as described in <a class="xref" href="ch02.html"/>.</p> <p>By default the <code class="literal">juddiv3.war</code> 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 <span class="emphasis"><em>profiles</em></span> to change the configuration and dependencies in the <code class="literal">juddiv3.war</code>. To run these maven based scripts you need to go into <code class="literal">juddi-distro-<version>/juddiv3-war</code> directory.</p> <div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="_tomcat"/></h2></div></div></div> <div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_openjpa_and_cxf"/></h3></div></div></div> <p>Target platform Tomcat and Derby using OpenJPA and CXF. Both OpenJPA and CXF are packaged up in the juddiv3.war.</p> <pre class="screen">mvn clean package -P openjpa</pre> <p>Then copy the <code class="literal">target/juddiv3.war</code> to the <code class="literal"><tomcat>/webapps</code> directory.</p> </div> <div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_hibernate_and_cxf"/></h3></div></div></div> <p>Target platform Tomcat and Derby using Hibernate and CXF. Both Hibernate and CXF are packaged up in the juddiv3.war.</p> <pre class="screen">mvn clean package -P hibernate</pre> <p>Then copy the <code class="literal">target/juddiv3.war</code> to the <code class="literal"><tomcat>/webapps</code> directory.</p> </div> <div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_openjpa_and_axis2"/></h3></div></div></div> <p>Target platform Tomcat and Derby using OpenJPA and Apache Axis2. Both Hibernate and Axis2 are packaged up in the juddiv3.war.</p> <pre class="screen">mvn clean package -P axis2</pre> <p>Then copy the <code class="literal">target/juddiv3.war</code> to the <code class="literal"><tomcat>/webapps</code> directory.</p> </div> </div> <div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="_jboss"/></h2></div></div></div> <div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_jbossas_6_0_0_ga"/></h3></div></div></div> <p>This section describes how to deploy juddi to JBoss 6.0.0.GA.</p> <p>First, download jboss-6.0.0.GA - the zip or tar.gz bundle may be found at <a class="ulink" href="http://www.jboss.org/jbossas/downloads/">http://www.jboss.org/jbossas/downloads/</a>. Download the bundle and uncompress it.</p> <div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_hibernate_and_jbossws_native"/></h4></div></div></div> <p>Target platform JBoss-6.x and HSQL using Hibernate and JBossWS-native. The juddiv3.war relies on Hibernate and JBossWS-native in the appserver.</p> <pre class="screen">mvn clean package -P hibernate-jbossws-native</pre> <p>Then copy the <code class="literal">target/juddiv3.war</code> to the <code class="literal"><jboss>/server/default/deploy</code> directory.</p> </div> <div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_hibernate_and_jbossws_cxf"/></h4></div></div></div> <p>Target platform JBoss-6.x and HSQL using Hibernate and JBossWS-cxf. The juddiv3.war relies on Hibernate and JBossWS-cxf in the appserver.</p> <pre class="screen">mvn clean package -P hibernate-jbossws-cxf</pre> <div class="variablelist"><p class="title"><strong/></p><dl><dt><span class="term">Issue 1</span></dt><dd> <pre class="screen">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</pre> <p class="simpara">Workaround: deploy juddiv3.war as a directory (not a zip file).</p> </dd><dt><span class="term">Issue 2</span></dt><dd> <p class="simpara">JBoss-5.x Note that configuration 3 and 4 will also run on JBoss-5.x, but you may run into the following</p> <pre class="screen">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.</pre> <p class="simpara">Workaround: Unzip the deployers/jbossws.deployer/jbossws-native-core.jar and add the xmldsig-core-schema.xsd in the schema directory,</p> <pre class="screen">10293 Fri May 27 14:40:40 EDT 2011 schema/xmldsig-core-schema.xsd</pre> <p class="simpara">Edit the file META-INF/jbossws-entities.properties by adding a line at the bottom saying:</p> <pre class="screen">http\://www.w3.org/2000/09/xmldsig#=schema/xmldsig-core-schema.xsd</pre> </dd></dl></div> <p>Copy juddiv3.war to server/default/deploy and unpack it.</p> <p>Insert jboss-web.xml into the juddiv3.war/WEB-INF directory , should look like the following :</p> <pre class="screen"><?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></pre> </div> <div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_change_web_xml"/></h4></div></div></div> <p>Replace the WEB-INF/web.xml with the jbossws-native-web.xml within docs/examples/appserver.</p> </div> <div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_configure_datasource"/></h4></div></div></div> <p>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 :</p> <pre class="screen">cp mysql-connector-java-5.0.8-bin.jar /opt/jboss-5.1.0.GA/server/default/lib</pre> <p>Next, configure a JBoss datasource file for your db. Listed below is an example datasource for MySQL :</p> <pre class="screen"><?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></pre> <p>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 (<a class="ulink" href="https://www.hibernate.org/hib_docs/v3/api/org/hibernate/dialect/package-summary.html">https://www.hibernate.org/hib_docs/v3/api/org/hibernate/dialect/package-summary.html</a>). 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.</p> </div> </div> <div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_jbossas_7_x_jbosseap_6_x"/></h3></div></div></div> <p>This section describes how to deploy juddi to JBossAS 7, WildFly and JBossEAP 6</p> <div class="section"><div class="titlepage"><div><div><h4 class="title"><a id="_hibernate_and_jbossws_cxf_2"/></h4></div></div></div> <p>Target platform Wildfly/EAP and H2 using Hibernate and JBossWS-cxf. The juddiv3.war relies on Hibernate and JBossWS-cxf modules in the appserver. To build the correct juddiv3.war run</p> <pre class="screen">mvn clean package -P jboss7up</pre> <p>Use the JBoss add-user.sh script to create an application user with the uddiadmin role.</p> </div> </div> </div> <div class="section"><div class="titlepage"><div><div><h2 class="title"><a id="_deploying_to_glassfish"/></h2></div></div></div> <p>This section describes how to deploy juddi to Glassfish 2.1.1. These instructions will use CXF as a webservice framework.</p> <p>First, download the glassfish-v2.1.1 installer JAR. Once downloaded,install using the JAR and then run the ant setup script :</p> <pre class="screen">java -jar glassfish-installer-v2.1.1-b31g-linux.jar cd glassfish ant -f setup.xml</pre> <div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_glassfish_jars"/></h3></div></div></div> <p>Copy the following JARs into domains/domain1/lib/ext. Note that for the purposes of this example, we have copied the MySQL driver to domains/domain1/lib/ext :</p> <pre class="screen">antlr-2.7.6.jar cglib-nodep-2.1_3.jar commons-collections-3.2.1.jar commons-logging-1.1.jar dom4j-1.6.1.jar hibernate-3.2.5.ga.jar hibernate-annotations-3.3.0.ga.jar hibernate-commons-annotations-3.0.0.ga.jar hibernate-entitymanager-3.3.1.ga.jar hibernate-validator-3.0.0.ga.jar javassist-3.3.ga.jar jboss-common-core-2.0.4.GA.jar jta-1.0.1B.jar mysql-connector-java-5.0.8-bin.jar persistence-api-1.0.jar</pre> </div> <div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_configure_the_juddi_datasource"/></h3></div></div></div> <p>First, using the asadmin administration tool, import the following file :</p> <pre class="screen"><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE resources PUBLIC "-//Sun Microsystems Inc.//DTD Application Server 9.0 Domain//EN" "*<install directory>/lib/dtds/sun-resources_1_3.dtd*"> <resources> <jdbc-connection-pool name="mysql-pool" datasource-classname="com.mysql.jdbc.jdbc2.optional.MysqlDataSource" res-type="javax.sql.DataSource"> <property name="user" value="juddi"/> <property name="password" value="juddi"/> <property name="url" value="jdbc:mysql://localhost:3306/juddiv3"/> </jdbc-connection-pool> <jdbc-resource enabled="true" jndi-name="jdbc/mysql-resource" object-type="user" pool-name="mysql-pool"/> </resources></pre> <pre class="screen">asadmin add-resources resource.xml</pre> <p>Then use the Glassfish administration console to create a "jdbc/juddiDB" JDBC datasource resource based on the mysql-pool Connection Pool.</p> </div> <div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_add_juddiv3_cxf_war"/></h3></div></div></div> <p>Unzip the juddiv3-cxf WAR into domains/domain1/autodeploy/juddiv3.war .</p> <p>Add a sun-web.xml file into juddiv3.war/WEB-INF. Make sure that the JNDI references matches the JNDI location you configured in the Glassfish administration console.</p> <pre class="screen"><?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE sun-web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Application Server 9.0 Servlet 2.5//EN' 'http://www.sun.com/software/appserver/dtds/sun-web-app_2_5-0.dtd'> <sun-web-app> <resource-ref> <res-ref-name>jdbc/juddiDB</res-ref-name> <jndi-name>jdbc/juddiDB</jndi-name> </resource-ref> </sun-web-app></pre> <p>Next, make a few changes to juddiv3.war/WEB-INF/classes/META-INF/persistence.xml . Change the "hibernate.dialect" property to match the database that 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 (<a class="ulink" href="https://www.hibernate.org/hib_docs/v3/api/org/hibernate/dialect/package-summary.html">https://www.hibernate.org/hib_docs/v3/api/org/hibernate/dialect/package-summary.html</a>). Next, change the <jta-data-source> change the value from java:comp/env/jdbc/JuddiDS to java:comp/env/jdbc/JuddiDB.</p> </div> <div class="section"><div class="titlepage"><div><div><h3 class="title"><a id="_run_juddi"/></h3></div></div></div> <p>Start up the server :</p> <pre class="screen">cd bin asadmin start-domain domain1</pre> <p>Once the server is deployed, browse to <a class="ulink" href="http://localhost:8080/juddiv3">http://localhost:8080/juddiv3</a></p> </div> </div> </div><ul xmlns:d="http://docbook.org/ns/docbook" class="docnav"><li class="previous"><a accesskey="p" href="ch07.html"><strong/></a></li><li class="up"><a accesskey="u" href="#"><strong/></a></li><li class="home"><a accesskey="h" href="index.html"><strong/></a></li><li class="next"><a accesskey="n" href="ch09.html"><strong/></a></li></ul></body></html>