Subject Re: [Firebird-Java] Tomcat-Firebird-JDBCRealm
Author Rick Fincher
Hi John,

Some of the parameters in your Realm tag are not spelled correctly. Case is
significant.

usertable should be userTable
usernamecol should be userNameCol
usercredcol should be userCredCol
userroletable should be userRoleTable
rolenamecol should be roleNameCol

When I created the table USER_ROLES I added the following line to prevent
duplication:
PRIMARY KEY ("USER_NAME", "ROLE_NAME")

This isn't required but could prevent problems with duplicates later.

Tomcat works fine with Firebird and the JCA/JDBC driver.

It looks like you almost have it. Give these changes a try and see if it
gets you farther.

Rick

----- Original Message -----



> Hello -
>
> I am trying to setup a JDBCRealm using Tomcat 4.0.4 with JDK1.4 and
> Firebird 1.0.0.796 on Suse 7.2. Below is the declaration of the
> realm and the declarations for the tables. The realm connects but I
> get an exception, also shown below. I looked up the codes and they
> refer to dynamic sql errors but nothing specific. Any help would be
> appreciated.
>
>
> <Realm className="org.apache.catalina.realm.JDBCRealm"
> driverName="org.firebirdsql.jdbc.FBDriver"
>
> connectionURL="jdbc:firebirdsql:localhost/3050:/opt/interbase/bin/USER
> DB.GDB"
> connectionName="SYSDBA" connectionPassword="masterkey"
> usertable="USERS" usernamecol="USER_NAME"
> usercredcol="USER_PASS" userroletable="USER_ROLES"
> rolenamecol="ROLE_NAME"/>
>
> CREATE TABLE ROLES (
> ROLE_NAME VARCHAR(12) NOT NULL
> );
>
> CREATE TABLE USER_ROLES (
> USER_NAME VARCHAR(12) NOT NULL,
> ROLE_NAME VARCHAR(12) NOT NULL
> );
>
> CREATE TABLE USERS (
> USER_NAME VARCHAR(12) NOT NULL,
> USER_PASS VARCHAR(12) NOT NULL
> );
>
> 2002-08-25 18:27:57 JDBCRealm[Standalone]: Exception performing
> authentication
> java.sql.SQLException: GDSException:
> org.firebirdsql.gds.GDSException: No message for code 335544569 found.
> No message for code 335544436 found.
>
> at org.firebirdsql.jdbc.FBPreparedStatement.<init>
> (FBPreparedStatement.java:89)
> at org.firebirdsql.jdbc.FBConnection.prepareStatement
> (FBConnection.java:178)
> at org.apache.catalina.realm.JDBCRealm.credentials
> (JDBCRealm.java:481)
> at org.apache.catalina.realm.JDBCRealm.authenticate
> (JDBCRealm.java:376)
> at org.apache.catalina.realm.JDBCRealm.authenticate
> (JDBCRealm.java:326)
> at
> org.apache.catalina.authenticator.BasicAuthenticator.authenticate
> (BasicAuthenticator.java:161)
> at org.apache.catalina.authenticator.AuthenticatorBase.invoke
> (AuthenticatorBase.java:506)
> at org.apache.catalina.core.StandardPipeline.invokeNext
> (StandardPipeline.java:564)
> ....
>
>
> TIA,
> John Croft