You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by DIGLLOYD INC <di...@diglloyd.com> on 2009/07/30 18:48:04 UTC

DigestAuthenticator failure: java.sql.SQLException: Operation not allowed after ResultSet closed

How can I resolve this issue?  It takes Tomcat own on a regular basis,  
locking out legitimate users.  Looks like JDBCRealm has some kind of  
bug.

Thanks!

Jul 29, 2009 1:46:41 PM org.apache.catalina.realm.JDBCRealm getRoles
SEVERE: Exception performing authentication
java.sql.SQLException: Operation not allowed after ResultSet closed
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
	at com.mysql.jdbc.ResultSetImpl.checkClosed(ResultSetImpl.java:768)
	at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:7008)
	at org.apache.catalina.realm.JDBCRealm.getRoles(JDBCRealm.java:632)
	at org.apache.catalina.realm.JDBCRealm.getPrincipal(JDBCRealm.java:596)
	at org.apache.catalina.realm.RealmBase.authenticate(RealmBase.java:400)
	at  
org 
.apache 
.catalina 
.authenticator 
.DigestAuthenticator.findPrincipal(DigestAuthenticator.java:283)
	at  
org 
.apache 
.catalina 
.authenticator 
.DigestAuthenticator.authenticate(DigestAuthenticator.java:176)
	at  
org 
.apache 
.catalina 
.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
	at com.diglloyd.tomcat.BadInputValve.invoke(BadInputValve.java:284)
	at  
org 
.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java: 
128)
	at  
org 
.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java: 
102)
	at  
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java: 
568)
	at  
org 
.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java: 
394)
	at  
org 
.apache 
.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
	at  
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 
286)
	at  
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java: 
844)
	at org.apache.coyote.http11.Http11Protocol 
$Http11ConnectionHandler.process(Http11Protocol.java:583)
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java: 
447)
	at java.lang.Thread.run(Thread.java:613)


diglloyd:bin lloyd$ ./version
-bash: ./version: No such file or directory
diglloyd:bin lloyd$ ./version.sh
Using CATALINA_BASE:   /web/tomcat
Using CATALINA_HOME:   /web/tomcat
Using CATALINA_TMPDIR: /web/tomcat/temp
Using JRE_HOME:       /System/Library/Frameworks/JavaVM.framework/ 
Versions/CurrentJDK/Home
Server version: Apache Tomcat/6.0.16
Server built:   Jan 28 2008 11:35:29
Server number:  6.0.16.0
OS Name:        Mac OS X
OS Version:     10.5.7
Architecture:   i386
JVM Version:    1.5.0_19-b02-304
JVM Vendor:     Apple Inc.



Lloyd Chambers
http://diglloyd.com
http://macperformanceguide.com/
[Mac OS X 10.5.2 Intel, Tomcat 6.0.16]






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


Re: DigestAuthenticator failure: java.sql.SQLException: Operation not allowed after ResultSet closed

Posted by DIGLLOYD INC <di...@diglloyd.com>.
Thank you, looks like 6.0.19 should fix it, I've upgraded to that.

Lloyd

Lloyd Chambers
http://diglloyd.com
http://macperformanceguide.com/
[Mac OS X 10.5.2 Intel, Tomcat 6.0.16]





On Jul 30, 2009, at 10:28 AM, Konstantin Kolinko wrote:

> 2009/7/30 DIGLLOYD INC <di...@diglloyd.com>:
>> How can I resolve this issue?  It takes Tomcat own on a regular  
>> basis,
>> locking out legitimate users.  Looks like JDBCRealm has some kind  
>> of bug.
>>
>> Thanks!
>>
>> Jul 29, 2009 1:46:41 PM org.apache.catalina.realm.JDBCRealm getRoles
>> SEVERE: Exception performing authentication
>> java.sql.SQLException: Operation not allowed after ResultSet closed
>>        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java: 
>> 1055)
>>        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java: 
>> 956)
>>        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java: 
>> 926)
>>        at  
>> com.mysql.jdbc.ResultSetImpl.checkClosed(ResultSetImpl.java:768)
>>        at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:7008)
>>        at  
>> org.apache.catalina.realm.JDBCRealm.getRoles(JDBCRealm.java:632)
>>        at
>> org.apache.catalina.realm.JDBCRealm.getPrincipal(JDBCRealm.java:596)
>>        at
>> org.apache.catalina.realm.RealmBase.authenticate(RealmBase.java:400)
>>        at
>> org 
>> .apache 
>> .catalina 
>> .authenticator 
>> .DigestAuthenticator.findPrincipal(DigestAuthenticator.java:283)
>>        at
>> org 
>> .apache 
>> .catalina 
>> .authenticator 
>> .DigestAuthenticator.authenticate(DigestAuthenticator.java:176)
>>        at
>> org 
>> .apache 
>> .catalina 
>> .authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
>>        at  
>> com.diglloyd.tomcat.BadInputValve.invoke(BadInputValve.java:284)
>>        at
>> org 
>> .apache 
>> .catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>>        at
>> org 
>> .apache 
>> .catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>>        at
>> org 
>> .apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java: 
>> 568)
>>        at
>> org 
>> .apache 
>> .catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:394)
>>        at
>> org 
>> .apache 
>> .catalina.core.StandardEngineValve.invoke(StandardEngineValve.java: 
>> 109)
>>        at
>> org 
>> .apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java: 
>> 286)
>>        at
>> org 
>> .apache.coyote.http11.Http11Processor.process(Http11Processor.java: 
>> 844)
>>        at
>> org.apache.coyote.http11.Http11Protocol 
>> $Http11ConnectionHandler.process(Http11Protocol.java:583)
>>        at
>> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java: 
>> 447)
>>        at java.lang.Thread.run(Thread.java:613)
>>
>>
>> diglloyd:bin lloyd$ ./version
>> -bash: ./version: No such file or directory
>> diglloyd:bin lloyd$ ./version.sh
>> Using CATALINA_BASE:   /web/tomcat
>> Using CATALINA_HOME:   /web/tomcat
>> Using CATALINA_TMPDIR: /web/tomcat/temp
>> Using JRE_HOME:
>> /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
>> Server version: Apache Tomcat/6.0.16
>> Server built:   Jan 28 2008 11:35:29
>> Server number:  6.0.16.0
>> OS Name:        Mac OS X
>> OS Version:     10.5.7
>> Architecture:   i386
>> JVM Version:    1.5.0_19-b02-304
>> JVM Vendor:     Apple Inc.
>>
>>
>>
>> Lloyd Chambers
>> http://diglloyd.com
>> http://macperformanceguide.com/
>> [Mac OS X 10.5.2 Intel, Tomcat 6.0.16]
>
> It should be the following issue:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=45453
>
> It was fixed in rev.685696
> (http://svn.apache.org/viewvc?view=rev&revision=685696)
>
> Best regards,
> Konstantin Kolinko
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


Re: DigestAuthenticator failure: java.sql.SQLException: Operation not allowed after ResultSet closed

Posted by DIGLLOYD INC <di...@diglloyd.com>.
Thank you!

(and thanks to Chuck also)

Lloyd Chambers
http://diglloyd.com
http://macperformanceguide.com/
[Mac OS X 10.5.7 Intel, Tomcat 6.0.20]






On Aug 3, 2009, at 3:05 PM, Christopher Schultz wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Digilloyd,
>
> On 7/31/2009 1:59 PM, DIGLLOYD INC wrote:
>> Thank you.  Any snippet on the right way to to the Realm/Resource  
>> thing?
>> It's been so long I don't remember the right way
>
> Simple: just put this in your WEB-INF/context.xml file:
>
>   <Resource name="jdbc/MyDataSource"
>    description="[whatever]"
>        auth="Container"
>        type="javax.sql.DataSource"
>        maxActive="1"
>        maxIdle="1"
>        maxWait="10000"
>        url="@DATABASE_URL@"
>        username="@DATABASE_USERNAME@"
>        password="@DATABASE_PASSWORD@"
>        driverClassName="@DATABASE_DRIVER@"
>        removeAbandoned="true"
>        removeAbandonedTimeout="30"
>        logAbandoned="true"
>    testOnBorrow="true"
>    validationQuery="/* ping */ SELECT 1"
>    />
>
> Obviously, fill-in the appropriate values above.
>
> You should also have in your web.xml something like this:
>
>    <resource-ref>
>           <description>[whatever]</description>
>           <res-ref-name>jdbc/MyDataSource</res-ref-name>
>           <res-type>javax.sql.DataSource</res-type>
>           <res-auth>Container</res-auth>
>    </resource-ref>
>
> ...but I've found that it is not strictly necessary. I think it's
> because Tomcat knows that any <Resource> in WEB-INF/context.xml should
> automatically be available in the visible JNDI context for the webapp.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkp3XxcACgkQ9CaO5/Lv0PDGcgCePI8NTUrVpCUyYKPBBOhhRnnW
> aUQAoJAJEt2j0asnrgCDla49v5G1FQ7F
> =F0rT
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


RE: DigestAuthenticator failure: java.sql.SQLException: Operationnot allowed after ResultSet closed

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Christopher Schultz [mailto:chris@christopherschultz.net]
> Subject: Re: DigestAuthenticator failure: java.sql.SQLException:
> Operationnot allowed after ResultSet closed
> 
> Simple: just put this in your WEB-INF/context.xml file:

Make that your META-INF/context.xml file, not WEB-INF.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.

Re: DigestAuthenticator failure: java.sql.SQLException: Operation not allowed after ResultSet closed

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Digilloyd,

On 7/31/2009 1:59 PM, DIGLLOYD INC wrote:
> Thank you.  Any snippet on the right way to to the Realm/Resource thing?
> It's been so long I don't remember the right way

Simple: just put this in your WEB-INF/context.xml file:

   <Resource name="jdbc/MyDataSource"
    description="[whatever]"
        auth="Container"
        type="javax.sql.DataSource"
        maxActive="1"
        maxIdle="1"
        maxWait="10000"
        url="@DATABASE_URL@"
        username="@DATABASE_USERNAME@"
        password="@DATABASE_PASSWORD@"
        driverClassName="@DATABASE_DRIVER@"
        removeAbandoned="true"
        removeAbandonedTimeout="30"
        logAbandoned="true"
    testOnBorrow="true"
    validationQuery="/* ping */ SELECT 1"
    />

Obviously, fill-in the appropriate values above.

You should also have in your web.xml something like this:

    <resource-ref>
           <description>[whatever]</description>
           <res-ref-name>jdbc/MyDataSource</res-ref-name>
           <res-type>javax.sql.DataSource</res-type>
           <res-auth>Container</res-auth>
    </resource-ref>

...but I've found that it is not strictly necessary. I think it's
because Tomcat knows that any <Resource> in WEB-INF/context.xml should
automatically be available in the visible JNDI context for the webapp.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkp3XxcACgkQ9CaO5/Lv0PDGcgCePI8NTUrVpCUyYKPBBOhhRnnW
aUQAoJAJEt2j0asnrgCDla49v5G1FQ7F
=F0rT
-----END PGP SIGNATURE-----

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


Re: DigestAuthenticator failure: java.sql.SQLException: Operation not allowed after ResultSet closed

Posted by DIGLLOYD INC <di...@diglloyd.com>.
Chris,

Thank you.  Any snippet on the right way to to the Realm/Resource  
thing? It's been so long I don't remember the right way

Lloyd

On Jul 30, 2009, at 12:13 PM, Christopher Schultz wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Diglloyd,
>
> On 7/30/2009 1:28 PM, Konstantin Kolinko wrote:
>> It should be the following issue:
>> https://issues.apache.org/bugzilla/show_bug.cgi?id=45453
>
> For whatever reason, JDBCRealm has always been a steaming POS. I would
> highly recommend using DataSourceRealm along with a <Resource> element
> in your context.xml file: it's a much more stable Realm to use.
>
> - -chris
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (MingW32)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAkpx8NAACgkQ9CaO5/Lv0PCzPQCfTkBFyQhTJnE/N/BnwmkQw2bC
> 148AoL+2dqYEfAVZPVOwS1ZyGxjWFRay
> =RZ5b
> -----END PGP SIGNATURE-----
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
> For additional commands, e-mail: users-help@tomcat.apache.org
>


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


Re: DigestAuthenticator failure: java.sql.SQLException: Operation not allowed after ResultSet closed

Posted by Christopher Schultz <ch...@christopherschultz.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Diglloyd,

On 7/30/2009 1:28 PM, Konstantin Kolinko wrote:
> It should be the following issue:
> https://issues.apache.org/bugzilla/show_bug.cgi?id=45453

For whatever reason, JDBCRealm has always been a steaming POS. I would
highly recommend using DataSourceRealm along with a <Resource> element
in your context.xml file: it's a much more stable Realm to use.

- -chris
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkpx8NAACgkQ9CaO5/Lv0PCzPQCfTkBFyQhTJnE/N/BnwmkQw2bC
148AoL+2dqYEfAVZPVOwS1ZyGxjWFRay
=RZ5b
-----END PGP SIGNATURE-----

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


Re: DigestAuthenticator failure: java.sql.SQLException: Operation not allowed after ResultSet closed

Posted by Konstantin Kolinko <kn...@gmail.com>.
2009/7/30 DIGLLOYD INC <di...@diglloyd.com>:
> How can I resolve this issue?  It takes Tomcat own on a regular basis,
> locking out legitimate users.  Looks like JDBCRealm has some kind of bug.
>
> Thanks!
>
> Jul 29, 2009 1:46:41 PM org.apache.catalina.realm.JDBCRealm getRoles
> SEVERE: Exception performing authentication
> java.sql.SQLException: Operation not allowed after ResultSet closed
>        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)
>        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
>        at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
>        at com.mysql.jdbc.ResultSetImpl.checkClosed(ResultSetImpl.java:768)
>        at com.mysql.jdbc.ResultSetImpl.next(ResultSetImpl.java:7008)
>        at org.apache.catalina.realm.JDBCRealm.getRoles(JDBCRealm.java:632)
>        at
> org.apache.catalina.realm.JDBCRealm.getPrincipal(JDBCRealm.java:596)
>        at
> org.apache.catalina.realm.RealmBase.authenticate(RealmBase.java:400)
>        at
> org.apache.catalina.authenticator.DigestAuthenticator.findPrincipal(DigestAuthenticator.java:283)
>        at
> org.apache.catalina.authenticator.DigestAuthenticator.authenticate(DigestAuthenticator.java:176)
>        at
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:491)
>        at com.diglloyd.tomcat.BadInputValve.invoke(BadInputValve.java:284)
>        at
> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
>        at
> org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
>        at
> org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:568)
>        at
> org.apache.catalina.authenticator.SingleSignOn.invoke(SingleSignOn.java:394)
>        at
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>        at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
>        at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>        at
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
>        at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>        at java.lang.Thread.run(Thread.java:613)
>
>
> diglloyd:bin lloyd$ ./version
> -bash: ./version: No such file or directory
> diglloyd:bin lloyd$ ./version.sh
> Using CATALINA_BASE:   /web/tomcat
> Using CATALINA_HOME:   /web/tomcat
> Using CATALINA_TMPDIR: /web/tomcat/temp
> Using JRE_HOME:
> /System/Library/Frameworks/JavaVM.framework/Versions/CurrentJDK/Home
> Server version: Apache Tomcat/6.0.16
> Server built:   Jan 28 2008 11:35:29
> Server number:  6.0.16.0
> OS Name:        Mac OS X
> OS Version:     10.5.7
> Architecture:   i386
> JVM Version:    1.5.0_19-b02-304
> JVM Vendor:     Apple Inc.
>
>
>
> Lloyd Chambers
> http://diglloyd.com
> http://macperformanceguide.com/
> [Mac OS X 10.5.2 Intel, Tomcat 6.0.16]

It should be the following issue:
https://issues.apache.org/bugzilla/show_bug.cgi?id=45453

It was fixed in rev.685696
(http://svn.apache.org/viewvc?view=rev&revision=685696)

Best regards,
Konstantin Kolinko

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