tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Richards" <ncmu...@pobox.com>
Subject Re: tomcat4 and JDBCRealm problem
Date Tue, 02 Oct 2001 16:56:34 GMT
If you are using Tomcat 4 put it in CATALINA_HOME\common\lib
----- Original Message ----- 
From: "Epling, Bob" <Bob.Epling@twtelecom.com>
To: <tomcat-user@jakarta.apache.org>
Sent: Tuesday, October 02, 2001 10:35 AM
Subject: RE: tomcat4 and JDBCRealm problem


Craig,

Thanks for the advice.  For grins I wrote a quickie program in java that
connected to the database and
listed the users.  It worked fine using the same parameters that were in
the server.xml for Tomcat.
So, I started to scratch my head some more and took a harder look at
catalina.bat.
Even though I had my NT classpath pointing to the mysql.jar, I decided
to add the mysql.jar path
to the following line in catalina.bat:

---> set
CP=%CATALINA_HOME%\bin\bootstrap.jar;%JAVA_HOME%\lib\tools.jar;c:\javali
b\mysql.jar

Voila!...it worked.
Can you tell me why it didn't pick up the jar file from my NT classpath
or from the lib directory in the TOMCAT_HOME?

Maybe the instructions for setting up a JDBCRealm need to be modified to
add this little tidbit of info.

Thanks for the help,
Bob Epling

-----Original Message-----
From: Craig R. McClanahan [mailto:craigmcc@apache.org]
Sent: Monday, October 01, 2001 8:52 PM
To: tomcat-user@jakarta.apache.org
Subject: Re: tomcat4 and JDBCRealm problem


The fact that you are getting a SQLException (rather than a
ClassNotFoundException) implies that the problem is *not* in locating
the
driver - it is in the parameters you are specifying to establish the
database connection.  Double (and triple) check your values for the
"connectionName", "connectionPassword", and "connectionURL" parameters,
as
well as the security permissions you have set up in the MySQL database
itself.

Craig McClanahan


On Mon, 1 Oct 2001, Epling, Bob wrote:

> Date: Mon, 1 Oct 2001 16:50:41 -0600
> From: "Epling, Bob" <Bob.Epling@twtelecom.com>
> Reply-To: tomcat-user@jakarta.apache.org
> To: tomcat-user@jakarta.apache.org
> Subject: tomcat4 and JDBCRealm problem
>
> Hi all,
>
> I have tomcat4 set up on my winnt machine and it works fine with basic
> Memory realm authentication.
> I followed the steps in setting up a JDBCRealm using mysql and I get
the
> following error when starting Tomcat:
>
> Starting service Tomcat-Standalone
> Apache Tomcat/4.0
> Catalina.start: LifecycleException:  Exception opening database
> connection:  java.sql.SQLException: org.gjt.mm.mysql.Dri
> ver
> LifecycleException:  Exception opening database connection:
> java.sql.SQLException: org.gjt.mm.mysql.Driver
>         at
org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:615)
>         at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)
>         at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
>         at
>
org.apache.catalina.core.StandardService.start(StandardService.java:388)
>         at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
>         at
org.apache.catalina.startup.Catalina.start(Catalina.java:776)
>         at
> org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
>         at
> org.apache.catalina.startup.Catalina.process(Catalina.java:179)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:218)
> ----- Root Cause -----
> java.sql.SQLException: org.gjt.mm.mysql.Driver
>         at
org.apache.catalina.realm.JDBCRealm.open(JDBCRealm.java:538)
>         at
org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:613)
>         at
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1108)
>         at
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:307)
>         at
>
org.apache.catalina.core.StandardService.start(StandardService.java:388)
>         at
> org.apache.catalina.core.StandardServer.start(StandardServer.java:505)
>         at
org.apache.catalina.startup.Catalina.start(Catalina.java:776)
>         at
> org.apache.catalina.startup.Catalina.execute(Catalina.java:681)
>         at
> org.apache.catalina.startup.Catalina.process(Catalina.java:179)
>         at java.lang.reflect.Method.invoke(Native Method)
>         at
> org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:218)
>
> I've tried putting the mysql jar in c:\javalib and also under
> c:\tomcat4.0\lib
> but no luck.  This is my server.xml file currently:
>
>
>       <!-- Because this Realm is here, an instance will be shared
> globally -->
>
> <!--     <Realm className="org.apache.catalina.realm.MemoryRealm" />
-->
>
>       <!-- Replace the above Realm with one of the following to get a
> Realm
>            stored in a database and accessed via JDBC -->
>
>
>       <Realm  className="org.apache.catalina.realm.JDBCRealm"
debug="99"
>          driverName="org.gjt.mm.mysql.Driver"
>
> connectionURL="jdbc:mysql://localhost:3306/tomcatusers?user=root"
>          userTable="users" userNameCol="user_name"
> userCredCol="user_pass"
>          userRoleTable="user_roles" roleNameCol="role_name" />
>
>
> I can see the tables I have setup on my nt box in mysql.
> I can query those tables using mysql.
>
> Any help is appreciated.
>
> Thanks,
> Bob
>





Mime
View raw message