Perhaps I am not the first to find this but I noticed that if the following entries are made in the juddi WEB-INF/web.xml file and /conf/server.xml (of Tomcat 5.5 installation) respectively (as specified in the how-to):
 
web.xml
 
  <resource-ref>
    <description>jUDDI DataSource</description>
    <res-ref-name>jdbc/juddiDB</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
  </resource-ref>
 
server.xml  (also note that w/ Tomcat 5.5, the <Resource> element uses the simpler attribute values for all of the parameters instead of the separate nested <ResourceParams> and <parameter> elements)
 
    <Context path="/juddi" docBase="juddi" debug="5" reloadable="true"
     crossContext="true">
     <Logger className="org.apache.catalina.logger.FileLogger"
            prefix="localhost_juddiDB_log" suffix=".txt"
            timestamp="true"/>
        
             <Resource name="jdbc/juddiDB" auth="Container" type="javax.sql.DataSource"
               maxActive="100" maxIdle="30" maxWait="10000"
               username="juddi" password="juddi" driverClassName="com.mysql.jdbc.Driver"
               url=""/> 
               
    </Context>
 
 
then the happyjuddi.jsp will in fact validate w/ a successful JDBC connection, assuming you have MySQL configured correctly with the juddi database.  HOWEVER and this is IMPORTANT...IN ORDER TO GET ANY ACTUAL API CALLS TO WORK, SAY IF USING UDDI4J, you have to either alter the entries above such that the "jdbc/juddiDB" values shown are CHANGED to "jdbc/juddi" without the "DB" on the end...OR more simply change the value declared in the juddi.properties file that ships with the download file such that 
 

# jUDDI DataSource to use
juddi.dataSource=java:comp/env/jdbc/juddi
 
is changed to read as:

# jUDDI DataSource to use
juddi.dataSource=java:comp/env/jdbc/juddiDB 
 
Once I did this, then UDDI4J calls to the server would also work.  It appears that at runtime, this  value in the juddi.properties file
tells it to use this dataSource name which must be mapped correctly to the JNDI context in the app server (Tomcat).  Of course the happyjuddi.jsp file does not use this...
 
(code from happyjuddi.jsp)

  try
  {
    dsname = request.getParameter("dsname");
    if ((dsname == null) || (dsname.trim().length() == 0))
      dsname = "java:comp/env/jdbc/juddiDB";
...
as it has the name hardcoded (dsname) which is why it works!!! 
 
In fact the how-to at http://wiki.apache.org/ws/Deploy_jUDDI_on_Tomcat_and_MySQL shows the contents of the files with the mismatched names.  Bottom line...they all 3 have to have the same name declared in web.xml, the <Resource> element in the server.xml file (for the juddi Context), and the juddi.properties file, regardless of whether using the name "juddi" or "juddiDB".
 
I hope this will help others trying to get the juddi server to work w/ UDDI4J calls.
 
Lastly, despite getting happyjuddi.jsp to run "happy", all my attempts to make calls using the juddi Console (where you fill in the string *** to make test SOAP calls), appear to fail with a "connection refused" error.  But the happyjuddi.jsp page keeps on running clean each time and Tomcat shows the juddi application to be running.
 
Thanks

Reply via email to