After consultation with Carson McDonald I send this problem further to the
dev list:

I hope gain some help in solving a problem with the
Tomcat 3.2b6 version of JDBCRealm.

I'm using Postgresql as the underlying DB (I hope it's not that!).  What I'm
experiencing is that the usename/password pair are validated (user=paul
below) but that the realm verification fails for unclear reasons.  Then the
object seems to go into some sort of stasis and won't handle anything
correctly until Tomcat is restarted.  Here is a log excerpt:

> 2000-11-03 03:40:58 - PoolTcpConnector: Starting HttpConnectionHandler on 8080
> 2000-11-03 03:41:12 - ContextManager: JDBCRealm: JDBCRealm.authenticate:
> SELECT 
> passwd FROM users WHERE name = ?
> 2000-11-03 03:41:12 - ContextManager: JDBCRealm: Authentication unsuccessful
> for
> user null

This null attempt seems to precede the initiation of a browser challenge.
(?)

> 2000-11-03 03:41:18 - ContextManager: JDBCRealm: Authentication successful for
> u
> ser paul
> 2000-11-03 03:41:18 - ContextManager: JDBCRealm: Auth ok, user=paul
> 2000-11-03 03:41:18 - ContextManager: JDBCRealm: Controled access for paul R(
> /a
> pps + /admin/index.jsp + null) Ct
> (jsp(org.apache.jasper.servlet.JspServlet/null
> ) )

User 'paul' is verified ...

> 2000-11-03 03:41:18 - ContextManager: JDBCRealm: JDBCRealm.roles: SELECT role
> FR
> OM user_roles WHERE name = ?
> 2000-11-03 03:41:18 - ContextManager: JDBCRealm: There was an SQLException
> while
> in getUserRoles: paul

The initial error is here, and I can't figure out where it comes from.  If I
execute the SQL manually from the command line (double checking all variable
names etc. and enclosing paul in \'\s) it works correctly.

> 2000-11-03 03:41:18 - Ctx( /apps ): Exception in: R( /apps + /admin/index.jsp
> + 
> null) - java.lang.NullPointerException
>       at org.apache.tomcat.request.JDBCRealm.authorize(JDBCRealm.java:509)
>       at org.apache.tomcat.core.ContextManager.doAuthorize(ContextManager.java
> :844)
>       at org.apache.tomcat.core.ContextManager.internalService(ContextManager.
> java:778)
>       at org.apache.tomcat.core.ContextManager.service(ContextManager.java:732
> )
>       at org.apache.tomcat.service.http.HttpConnectionHandler.processConnectio
> n(HttpConnectionHandler.java:210)
>       at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:
> 407)
>       at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java
> :498)
>       at java.lang.Thread.run(Thread.java:498)
> 

This traceback reflects the fact that roles[0] in line 509 is not there.


> 2000-11-03 04:12:35 - ContextManager: JDBCRealm: The database connection is
> null or was found to be closed. Trying to re-open it.
> 2000-11-03 04:12:35 - ContextManager: JDBCRealm: There was an SQLException
> while in authenticate: paul
> 2000-11-03 04:12:35 - ContextManager: JDBCRealm: The database connection is
> null or was found to be closed. Trying to re-open it.
> 2000-11-03 04:12:35 - ContextManager: JDBCRealm: There was an SQLException
> while in authenticate: paul
> 2000-11-03 04:12:35 - ContextManager: JDBCRealm: The database connection is
> null or was found to be closed. Trying to re-open it.
> 2000-11-03 04:12:35 - ContextManager: JDBCRealm: There was an SQLException
> while in authenticate: null
> 2000-11-03 04:12:46 - ContextManager: JDBCRealm: The database connection is
> null or was found to be closed. Trying to re-open it.
> 2000-11-03 04:12:46 - ContextManager: JDBCRealm: There was an SQLException
> while in authenticate: paul

Here is where the postgres driver or JDBCRealm object has gone into some
sort of lock.

Best,

Paul Mayer
Please respond to [EMAIL PROTECTED] as well as the list.





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to