This week I had to install Apache jUDDI for the purpose of the “Knowledge Organization and WEB 3.0” class which is one of my Master’s degree disciplines at PPGI-UFRJ.
When I went to jUDDI‘s web site I discovered that jUDDI have a embeded Apache Tomcat within it. No problem if I hadn’t already installed Tomcat.
Since I wouldn’t like to have 2 running Tomcat installations I decided to install and deploy jUDDI in my existing Tomcat installation. After a few searches in Google I could not find someone who have already done it. That’s why I decided to write this (not so comprehensive) instructions.
Well, since I have already had a running Tomcat installation you will have to install it. It’s very easy. You can find a lot of HOW TOs around. Therefore, I consider the following prerequisites for my step-by-step installation instructions of jUDDI.
- Java Platform, Standard Edition (Java SE). I have jdk1.6.0_21;
- Apache Tomcat. I have apache-tomcat-6.0.29 running on port 8080;
Having properly installed and configured Java and Tomcat we can now start with the other jUDDI‘s prerequisites.
- Download and install MySQL Community Server 5.5.14. Choose the MSI installer version;
- Now let’s create a user and a database for jUDDI…
- Execute the MySQL Command Line Client (It’s in Windows’ Program menu);
- Execute these 3 commands: “CREATE USER ‘juddi’@’localhost’ IDENTIFIED BY ‘juddi’;“, “CREATE DATABASE juddi;” and “GRANT ALL PRIVILEGES ON juddi.* TO ‘juddi’@’localhost’;“;
- Download jUDDI portal bundle 3.0.4 and unzip it. Although this zip have an embeded Tomcat installation we won’t use it. We’ll need jus some webapps inside it.
- Copy the juddiv3, pluto and juddi-portlets folders (they are located inside the webapps folder in the zip file) to Tomcat‘s webapps folder. Again, just as a reference my webapps folder is in C:\Program Files\apache-tomcat-6.0.29\webapps;
- Also copy the following libraries from your zip’s juddi-portal-bundle-3.0.4\lib folder to your existing C:\Program Files\apache-tomcat-6.0.29\webapps folder:
- Download MySQL Connector/J 5.1.17 (the official JDBC driver for MySQL) and unzip it. Find the mysql-connector-java-5.1.17-bin.jar file and copy it to the lib folder of your existing Tomcat installation. My Tomcat‘s lib is in C:\Program Files\apache-tomcat-6.0.29\lib;
- Open the file C:\Program Files\apache-tomcat-6.0.29\webapps\juddiv3\META-INF\context.xml with any text editor and edit it in order to look like this…
- <?xml version=”1.0″ encoding=”UTF-8″?>
- .\web.xml: Set the value of <res-ref-name> as jdbc/juddiDB;
- .\classes\juddiv3.properties: Set the property juddi.persistenceunit.name with value juddiDB;
- .\classes\META-INF\persistence.xml: Set the persistence-unit‘ name to juddiDB, set <non-jta-data-source> value to java:comp/env/jdbc/juddiDB and make sure there is a <property name=”openjpa.jdbc.DBDictionary” value=”mysql“/> element in it.
Step 4 – Add users and roles to Tomcat
- Open C:\Arquivos de programas\apache-tomcat-6.0.32\conf\tomcat-users.xml and make sure it looks like this one:
<?xml version=’1.0′ encoding=’utf-8′?>
<user username=”root” password=”root” roles=”pluto,tomcat,manager”/>
<user username=”uddi” password=”uddi” roles=”pluto,tomcat,manager”/>
<user username=”sales” password=”sales” roles=”pluto,tomcat,manager”/>
<user username=”marketing” password=”marketing” roles=”pluto,tomcat,manager”/>
<user username=”tomcat” password=”tomcat” roles=”manager”/>
Step 5 – Enjoy your brand new Registry
…or like the following one if you click on the jUDDI Portal link…
Now you may for example connect to juddi MySQL database and execute the command “show tables;” just to list all tables created by the jUDDI installation process.
Some very important notes:
- Of course the instructions on this post are not perfect for a production environment. I installed everything in my windows development sandbox. If you are installing it for a production environment I strongly recommend you not to use the same password as the login name of the MySQL user. Another thing is to change the default jUDDI Authentication.
- It’s possible to do the same thing for a Linux environment. Just follow the instructions having Linux on your mind;
I’ll talk more about Apache jUDDI Registry on a next post.
Stay away from trouble!
Update at 2011-07-23 23:17
Make sure the file juddiv3.properties of webapps/juddiv3 and webapps/uddi-portlets have the same configurations. Therefore, copy webapps/juddiv3/WEB-INF/classes/juddiv3.properties to webapps/uddi-portlets/WEB-INF/classes/juddiv3.properties.