You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@juddi.apache.org by mark streit <ms...@bellsouth.net> on 2005/11/02 01:59:26 UTC

Fw: jdbc conn naming issues trying to get UDDI4J working

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="jdbc:mysql://localhost:3306/juddi?autoReconnect=true"/> 
               
    </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

Re: Fw: jdbc conn naming issues trying to get UDDI4J working

Posted by Steve Viens <sv...@gmail.com>.
Mark, the juddi.datastore value in the juddi.properties file that ships with
jUDDI is set to the following value (you've indicated that you must change
juddi.properties to this value for jUDDI to work correctly).

# jUDDI DataSource to use
juddi.dataSource=java:comp/env/jdbc/juddiDB

As for the jUDDI Console issue ... the problem may be how your registry is
deployed. Check to make sure the controller.jsp page is pointing to the
correct registry ... by default it assumes that it will connect to a UDDI
registry running on the same node on port 8080. If you have a chance to try
this please let me know if it resolves the issue.
 (perhaps I should have called it 'alpha')
 Steve

 On 11/1/05, mark streit <ms...@bellsouth.net> wrote:
>
> 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="jdbc:mysql://localhost:3306/juddi?autoReconnect=true"/>
>
> </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.propertiesfile, 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
>