You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by "Epling, Bob" <Bo...@twtelecom.com> on 2001/10/02 00:50:41 UTC

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

Re: tomcat4 and JDBCRealm problem

Posted by "Craig R. McClanahan" <cr...@apache.org>.
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" <Bo...@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
>