You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Miguel Angel Medina Lopez <ma...@logic-factory.com> on 2001/09/27 09:32:17 UTC

Form Based authentication problem

Hi all:

I'm working with Tomcat 3.2.3 and postgres 7.0. I want to use form-based
authentication and i have included the next lines in the server.xml file:
        <RequestInterceptor
            className="org.apache.tomcat.request.JDBCRealm"
            debug="0"
            driverName="org.postgresql.Driver"
            connectionURL="jdbc:postgresql://192.168.0.17/tomcat_users"
            connectionName="tomcat"
            connectionPassword="tomcat"
            userTable="usuarios"
            userNameCol="login"
            userCredCol="password"
            userRoleTable="usuarios"
            roleNameCol="role" />

The connection to the db is opened succesfully but when I put a valid
username and password the query doesn't work. The error in the tomcat.log
file is:
    JDBCRealm: The database connection is null or was found to be closed.
Trying to re-open it.

and the user isn't authenticated.

Thank you all

-------------------------------------------------------------
Miguel Ángel Medina López
Logic Factory: www.logic-factory.com
Granada - España




Re: Form Based authentication problem

Posted by Miguel Angel Medina Lopez <ma...@logic-factory.com>.
Hi:

Thanks Kaneda but the parameter autoReconnect doesn't work in Postgres.
I have found the error in the server.xml file and now I can't authenticate
fine. Now the problem is that I need the user name in differents context.
How can I do that? How can I keep client state in different contexts?

Miguel Ángel Medina López


----- Original Message -----
From: "Kaneda K" <ka...@dedaletechnology.com>
To: <to...@jakarta.apache.org>
Sent: Thursday, September 27, 2001 10:01 AM
Subject: Re: Form Based authentication problem


> This might be (I had a probleme that look the same with Mysql)
> so this might be that it need to be autoReconnect=true:
>
>   connectionURL="jdbc:postgresql://192.168.0.17/tomcat_users"
>
> became :
>
connectionURL="jdbc:postgresql://192.168.0.17/tomcat_users?autoReconnect=tru
e"
>
> Try and give me your feed back, please.
>
> At 09:32 27/09/2001 +0200, you wrote:
> >Hi all:
> >
> >I'm working with Tomcat 3.2.3 and postgres 7.0. I want to use form-based
> >authentication and i have included the next lines in the server.xml file:
> >         <RequestInterceptor
> >             className="org.apache.tomcat.request.JDBCRealm"
> >             debug="0"
> >             driverName="org.postgresql.Driver"
> >             connectionURL="jdbc:postgresql://192.168.0.17/tomcat_users"
> >             connectionName="tomcat"
> >             connectionPassword="tomcat"
> >             userTable="usuarios"
> >             userNameCol="login"
> >             userCredCol="password"
> >             userRoleTable="usuarios"
> >             roleNameCol="role" />
> >
> >The connection to the db is opened succesfully but when I put a valid
> >username and password the query doesn't work. The error in the tomcat.log
> >file is:
> >     JDBCRealm: The database connection is null or was found to be
closed.
> >Trying to re-open it.
> >
> >and the user isn't authenticated.
> >
> >Thank you all
> >
> >-------------------------------------------------------------
> >Miguel Ángel Medina López
> >Logic Factory: www.logic-factory.com
> >Granada - España


Re: Form Based authentication problem

Posted by Kaneda K <ka...@dedaletechnology.com>.
This might be (I had a probleme that look the same with Mysql)
so this might be that it need to be autoReconnect=true:

  connectionURL="jdbc:postgresql://192.168.0.17/tomcat_users"

became :
  connectionURL="jdbc:postgresql://192.168.0.17/tomcat_users?autoReconnect=true"

Try and give me your feed back, please.

At 09:32 27/09/2001 +0200, you wrote:
>Hi all:
>
>I'm working with Tomcat 3.2.3 and postgres 7.0. I want to use form-based
>authentication and i have included the next lines in the server.xml file:
>         <RequestInterceptor
>             className="org.apache.tomcat.request.JDBCRealm"
>             debug="0"
>             driverName="org.postgresql.Driver"
>             connectionURL="jdbc:postgresql://192.168.0.17/tomcat_users"
>             connectionName="tomcat"
>             connectionPassword="tomcat"
>             userTable="usuarios"
>             userNameCol="login"
>             userCredCol="password"
>             userRoleTable="usuarios"
>             roleNameCol="role" />
>
>The connection to the db is opened succesfully but when I put a valid
>username and password the query doesn't work. The error in the tomcat.log
>file is:
>     JDBCRealm: The database connection is null or was found to be closed.
>Trying to re-open it.
>
>and the user isn't authenticated.
>
>Thank you all
>
>-------------------------------------------------------------
>Miguel Ángel Medina López
>Logic Factory: www.logic-factory.com
>Granada - España