You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Peter Ivarsson <Pe...@aus.teleca.se> on 2003/10/14 13:35:35 UTC

Problem using realm to connect to a database

Hi,

I have problem with connecting to a Realm database.

I get this error.
Catalina.start: LifecycleException:  Exception opening database connection:
java.sql.SQLException: twz1.jdbc.mysql.jdbcMysqlDriver
LifecycleException:  Exception opening database connection:
java.sql.SQLException: twz1.jdbc.mysql.jdbcMysqlDriver
	at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:681)
	at
org.apache.catalina.core.StandardContext.start(StandardContext.java:3543)
	at
org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)

Useing driver com.mysql.jdbc.Driver version 3.09
MySQL version 3.23.38
Tomcat version 4.1.24

I have put the folowing rows into the server.xml:

<Context path="/esadmin" reloadable="true" docBase="C:\Program Files\Apache
Group\Tomcat 4.1\webapps\esadmin">
<Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
      driverName="com.mysql.jdbc.Driver"
      connectionName="XXX"
      connectionPassword="YYYY"
      connectionURL="jdbc:mysql://localhost:3306/estid2"
      userTable="admins" 
      userNameCol="user_name"
      userCredCol="user_pass"
      userRoleTable="user_roles" 
      roleNameCol="role_name" />
</Context>

Please helpTanks

/ Peter Ivarsson


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Re: Problem using realm to connect to a database

Posted by Martin Jacobson <ma...@libero.it>.
Peter Ivarsson wrote:
> 
> I get this error.
> Catalina.start: LifecycleException:  Exception opening database connection:
> java.sql.SQLException: twz1.jdbc.mysql.jdbcMysqlDriver
> LifecycleException:  Exception opening database connection:
> java.sql.SQLException: twz1.jdbc.mysql.jdbcMysqlDriver
> 
> Useing driver com.mysql.jdbc.Driver version 3.09
> MySQL version 3.23.38
> Tomcat version 4.1.24
> 
> I have put the folowing rows into the server.xml:
> 
> <Context path="/esadmin" reloadable="true" docBase="C:\Program Files\Apache
> Group\Tomcat 4.1\webapps\esadmin">
> <Realm className="org.apache.catalina.realm.JDBCRealm" debug="99"
>       driverName="com.mysql.jdbc.Driver"
>       connectionName="XXX"
>       connectionPassword="YYYY"
>       connectionURL="jdbc:mysql://localhost:3306/estid2"
>       userTable="admins" 
>       userNameCol="user_name"
>       userCredCol="user_pass"
>       userRoleTable="user_roles" 
>       roleNameCol="role_name" />
> </Context>
> 

Are you sure of your configuration? There used to be 2 jdbc drivers for 
MySQL, the twzl driver, and Mark Matthews mm driver. twzl stopped being 
maintained (IIRC), and the mm driver became the 'official' driver. Do 
you have both drivers visible to the classloader? If so, it looks as 
though it's choosing the wrong one. Delete (or move out of harms way) 
the twzl driver, and see if things improve.

HTH
Martin


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org