You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@juddi.apache.org by "Viens, Steve" <St...@FMR.COM> on 2004/02/25 18:46:02 UTC

RE: [Unverified Sender] RE: [Unverified Sender] RE: [Unverified S ender] RE: DB connection was not aquired

Joe, so ... what I remember doing when deploying jUDDI under Tomcat 4.x is
the following:

  1. Shutdown Tomcat (remove the DataSource you've 
     created first ... don't want that hanging around
     confusing things).

  2. Copy the jUDDI webapp directory  to Tomcat's 
     webapps directory (you're probably all set).

  3. Edit jUDDI's web.xml file removing or commenting 
     out the <resource-ref> element:

       <!--
       <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>
       -->

  4. Start Tomcat

  5. Create a DataSource under the "/juddi" context using 
     the same values you're using now.

  6. Try: http://localhost:8080/juddi/happyjuddi.jsp

Good luck!

Steve


-----Original Message-----
From: Viens, Steve 
Sent: Wednesday, February 25, 2004 12:21 PM
To: 'juddi-user@ws.apache.org'
Subject: [Unverified Sender] RE: [Unverified Sender] RE: [Unverified Sender]
RE: DB connection was not aquired


Also, can I assume that the following <resource-ref> element exists in
jUDDI's web.xml file?

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

Steve

-----Original Message-----
From: Viens, Steve 
Sent: Wednesday, February 25, 2004 12:18 PM
To: 'juddi-user@ws.apache.org'
Subject: [Unverified Sender] RE: [Unverified Sender] RE: DB connection was
not aquired


Joe, can you send me the juddi.xml file (if one exists) at the following
path?

  <tomcat-dir>/conf/Catalina/localhost/juddi.xml

Steve

-----Original Message-----
From: Joe Leary [mailto:jleary@vr.state.ut.us] 
Sent: Wednesday, February 25, 2004 12:01 PM
To: juddi-user@ws.apache.org
Subject: RE: [Unverified Sender] RE: DB connection was not aquired


Steve,

If you have a few minutes...

I just deployed juddi to my Linux environment.  Get the same error.
Can you possibly identify my problem?

I have a basic install of Tomcat 4.1.27.  Downloaded the latest
mysql-connector-java-3.0.11-stable-bin.jar file and copied that to
<tomcat>/common/lib directory.  Set up the jndi through the admin GUI.
I attached a screen shot from the admin tool showing my config.  (Also
attached a copy of the Tomcat config.)  Changed the log4j.properties
file to change the location of the log file.  Deployed the WAR file
using the admin GUI.  Stopped and started Tomcat - same error from
happyjuddi:

jUDDI DataSource Check

+ Got a JNDI Context!
+ Got a JDBC DataSource (dsname=java:comp/env/jdbc/juddiDB)
- DB connection was not aquired. (Cannot load JDBC driver class
'null')
- SELECT COUNT(*) FROM PUBLISHER failed (null)

I know the database is okay.  I can connect from a remote system with
mysql -h <host> -u juddi -p and get full access to the database.

Any suggestions on what I am doing wrong?

Joe




-----Original Message-----
From: Viens, Steve [mailto:Stephen.Viens@FMR.COM]
Sent: Friday, February 20, 2004 3:22 PM
To: 'juddi-user@ws.apache.org'
Subject: RE: [Unverified Sender] RE: DB connection was not aquired


Joe,

When/If you do figure this out please consider letting us know how you
did
it. I'm very interested in improving jUDDI's usability for both
deployment
and integration and that kind of information is always very helpful.

Steve

-----Original Message-----
From: Joe Leary [mailto:jleary@vr.state.ut.us]
Sent: Friday, February 20, 2004 4:50 PM
To: juddi-user@ws.apache.org
Subject: RE: [Unverified Sender] RE: DB connection was not aquired


Hi Steve,

Thanks for the quick reply.  To answer your 1st question I have the
MySQL drivers loaded about everywhere I possibly can:

MySQL drivers loaded:
	..\Tomcat 5.0\common\classes\com\mysql\jdbc\jdbc2\optional\* (all
the
class files)
	..\Tomcat 5.0\common\classes\org\gjt\mm\mysql\* (the class file)
	..\Tomcat 5.0\common\lib\mysql-connector-java-3.0.8-stable-bin.jar

Though I am using the 3.0.8 build, not the latest 3.0.10 build.  I
doubt that is the problem though.

I just tried both your methods and still get the same result - ugh...

I have a Linux server set up with Tomcat 4.1.27 and MySQL 3.x.  I
think I will try to install juddi on this box and see if I can get it
to work.

I suspect the app server is just not loading the db driver or
something is missing with the JNDI lookup.  Thanks for your help.  I
will keep plodding along with this.  If something else comes to mind,
please let me know...

Joe


-----Original Message-----
From: Viens, Steve [mailto:Stephen.Viens@FMR.COM]
Sent: Friday, February 20, 2004 1:48 PM
To: 'juddi-user@ws.apache.org'
Subject: RE: [Unverified Sender] RE: DB connection was not aquired


Step #3 of Method #1 should show the value "com.mysql.jdbc.Driver" for
JDBC
Driver Class.

Steve

-----Original Message-----
From: Viens, Steve
Sent: Friday, February 20, 2004 3:45 PM
To: 'juddi-user@ws.apache.org'
Subject: [Unverified Sender] RE: DB connection was not aquired


Joe,

Something you did not mention (but you have probably done) is add the
MySQL
JDBC driver to Tomcat's common/lib directory. Just mentioning this to
be
thorough.

Okay, assuming that's not the problem ... I've had some trouble with
this
exact setup on Tomcat in the past and I personally believe it's a
Tomcat
Admin UI / DataSource set-up bug - but I'm not 100% sure. Here are the
two
methods I've been able to configure the jUDDI DataSource.

Method #1

1. Comment out the <resource-ref> element in jUDDI's web.xml file
before
deploying jUDDI.  If you've already deployed jUDDI, and it sounds like
you
have, then make sure the jUDDI context has been removed from
server.xml or
the Tomcat-generated juddi.xml file has been removed from the
{omcat-dir}/conf/Catalina/localhost directory (Tomcat 5.0.x).

2. Deploy jUDDI (copy the webapp to Tomcat's webapp directory) and
restart
tomcat - or use the Tomcat's manager webapp to start jUDDI.

3. Create a DataSource via the Tomcat Admin webapp (these are the
values I
typically use).

  JNDI Name:                jdbc/juddiDB
  Data Source URL:          jdbc:mysql://localhost/juddi
  JDBC Driver Class:
  User Name:                juddi
  Password:                 juddi
  Max. Active Connections:  4
  Max. Idle Connections:    2
  Max. Wait for Connection: 5000
  Validation Query:         SELECT * FROM PUBLISHER

Note that I'm running MySQL 3.x, Tomcat 5.0.16 and I'm using the
Connenct/J
JDBC Driver for MySQL to connect to a MySQL database named "juddi".

  http://www.mysql.com/products/connector-j

4. Pull up the happijuddi.jsp page in your browser.

  http://localhost:8080/juddi/happyjuddi.jsp


***
*** Method #2
***

1. Do not comment out the <resource-ref> element in jUDDI's web.xml
file.

2. Add the <DefaultContext> to Tomcat's server.xml file

    <Engine defaultHost="localhost" name="Catalina">
      <Host appBase="webapps" name="localhost">

        <!-- default context - START -->
        <DefaultContext
className="org.apache.catalina.core.StandardDefaultContext">
          <Resource name="jdbc/juddiDB" type="javax.sql.DataSource"/>
          <ResourceParams name="jdbc/juddiDB">
            <parameter>
              <name>validationQuery</name>
              <value>SELECT * FROM PUBLISHER</value>
            </parameter>
            <parameter>
              <name>maxWait</name>
              <value>5000</value>
            </parameter>
            <parameter>
              <name>maxActive</name>
              <value>4</value>
            </parameter>
            <parameter>
              <name>password</name>
              <value>juddi</value>
            </parameter>
            <parameter>
              <name>url</name>
              <value>jdbc:mysql://localhost/juddi</value>
            </parameter>
            <parameter>
              <name>driverClassName</name>
              <value>com.mysql.jdbc.Driver</value>
            </parameter>
            <parameter>
              <name>maxIdle</name>
              <value>2</value>
            </parameter>
            <parameter>
              <name>username</name>
              <value>juddi</value>
            </parameter>
          </ResourceParams>
        </DefaultContext>
        <!-- default context - END -->

      </Host>
     ...
    </Engine>

Note: The Tomcat admin webapp will complain when you click on the
DataSource
icon under the juddi context and also might when you click on the
DefaultContext icon - or just not show you the DataSource you've added
to
DefaultContext.  But you should see happyjuddi.jsp function properly.

Hope this helps.

PS: If anyone has a better method please let me know .. This seems
like too
obvious a problem to have to hack around it like I've been doing.

Steve


-----Original Message-----
From: Joe Leary [mailto:jleary@vr.state.ut.us]
Sent: Friday, February 20, 2004 2:41 PM
To: juddi-user@ws.apache.org
Subject: DB connection was not aquired


I have installed juddi on a W2K machine with MySQL 4.x and Tomcat 5.x.
The database user, tables, and security are all set up in MySQL and
accessible with the 'juddi' userid.  However, I am unable to resolve
the following error reported by happyjuddi.jsp:

- DB connection was not aquired. (Cannot create JDBC driver of class
'' for connect URL 'null')
- SELECT COUNT(*) FROM PUBLISHER failed (null)

Here is some pertinent information on what I have done thus far...

juddi.properties
	juddi.useConnectionPool=false (not using connection polling)

Tomcat data source set up with Tomcat GUI admin tool with the
following parameters:
	JNDI Name:  jdbc/juddiDB
	Data Source:  jdbc:mysql://localhost:3306/juddi?autoReconnect=true
	JDBC Driver Class:  com.mysql.jdbc.Driver
		also tried (org.gjt.mm.mysql.Driver)
		also tried (com.mysql.jdbc.jdbc2.optional.MysqlDataSource)
	User Name:  juddi
	Password:  ********* (correct password)

MySQL drivers loaded:
	..\Tomcat 5.0\common\classes\com\mysql\jdbc\jdbc2\optional\* (all
the
class files)
	..\Tomcat 5.0\common\classes\org\gjt\mm\mysql\* (the class file)
	..\Tomcat 5.0\common\lib\mysql-connector-java-3.0.8-stable-bin.jar

Anyone encountered this problem and resolved it?  Help would be
appreciated...

Joe