Return-Path: X-Original-To: apmail-tomcat-users-archive@www.apache.org Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 930C79D0E for ; Mon, 23 Jan 2012 19:55:20 +0000 (UTC) Received: (qmail 8936 invoked by uid 500); 23 Jan 2012 19:55:16 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 8779 invoked by uid 500); 23 Jan 2012 19:55:16 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 8769 invoked by uid 99); 23 Jan 2012 19:55:15 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2012 19:55:15 +0000 X-ASF-Spam-Status: No, hits=2.5 required=5.0 tests=FREEMAIL_FORGED_REPLYTO,RCVD_IN_DNSWL_NONE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [98.139.44.139] (HELO nm12.access.bullet.mail.sp2.yahoo.com) (98.139.44.139) by apache.org (qpsmtpd/0.29) with SMTP; Mon, 23 Jan 2012 19:55:06 +0000 Received: from [98.139.44.103] by nm12.access.bullet.mail.sp2.yahoo.com with NNFMP; 23 Jan 2012 19:54:44 -0000 Received: from [98.139.44.71] by tm8.access.bullet.mail.sp2.yahoo.com with NNFMP; 23 Jan 2012 19:54:44 -0000 Received: from [127.0.0.1] by omp1008.access.mail.sp2.yahoo.com with NNFMP; 23 Jan 2012 19:54:44 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 190060.46249.bm@omp1008.access.mail.sp2.yahoo.com Received: (qmail 16782 invoked by uid 60001); 23 Jan 2012 19:54:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1327348483; bh=NrZcH5Q89DIUZBZKOD4TvbinAoK1TeEofa/4ghooEiU=; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=XEuEG0z6PzzpNBBO/x+0O4yHLkTcs0sHg3hdH69N8WdYrJTNdpAtVtSQtKOPEsmuHTLd8JzTudpGjOcFLar16W9rsbcMvVMH7ic/KlhjLVGH8cMnQB8Z3bSYf54mxdoEGLdv6VZFVtCMuBXYk67Pq9jLpAglKiVuM2qWj2MglIk= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=kcaCn8YGT+5JOzaifZ/ulk6vmh7e7qpOZbZzXy7sv7L5pftFtuWS2E84QTp743VPJVrYLi8EWpfZtwxHEGFxctDf4zHmjGdlRkW7qbnIxv+3rQu1k9eSuetiol3VkptuF5cyIrQ7poNrHBRMWxZS1EH7OZEkri5/9SZwYo9pscA=; X-YMail-OSG: 0.EV1AoVM1naqGBrtk9vy.TItMUIF7oPyEb4JYOsgeubjUu 1WMzHbGXmOufS2dSVZnc6C9SDuKqtZSJ18Mm1uVifhAklLwJ4HH3aNV4LtwF 2IZi8iUZ1GOP0cfYhreDMOmI9_6gf5wbXeAq2sXCKDQUfSvdZRKtwjwlF_vP bX4GOWgUxnPw5xEjBCkmNt8ItrRgyWxu0auxNYj6Xo5LXPvTlCl2.n1Et0Jy dQUtPMLe9aex9M2.8DCrzQxXgkl0fU9gw8eHZsl3f9izgH7el92GZK11lcda y4V187.y7hfY_m.c5moWWoyPMbehDaDKSg8AyQH3CFnOuwz9pJFzgYtf__Cr s.ffCW7iGK72eencoukYsEEpfQbOwdVL45dP_3UWI.XhH5RoHhO8GItITleR oNjxpvoaD.neQdIGRGByWOM8DJUXAhGYjmw_pbkIScbYa0Vpnbm2g0O_egMX LARQxOuI_WF6fgDgyHTeQOP8- Received: from [148.87.67.202] by web181615.mail.ne1.yahoo.com via HTTP; Mon, 23 Jan 2012 11:54:43 PST X-Mailer: YahooMailClassic/15.0.4 YahooMailWebService/0.8.115.331698 Message-ID: <1327348483.89829.YahooMailClassic@web181615.mail.ne1.yahoo.com> Date: Mon, 23 Jan 2012 11:54:43 -0800 (PST) From: removeps-code@yahoo.com Reply-To: removeps-code@yahoo.com Subject: Re: Connection.close() has already been called during login To: Tomcat Users List In-Reply-To: <1327344924.2805.59.camel@cleveland.mikusa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org --- On Mon, 1/23/12, Daniel Mikusa wrote:=0A=0A> From:= Daniel Mikusa =0A> Subject: Re: Connection.close() has= already been called during login=0A> To: "Tomcat Users List" =0A> Date: Monday, January 23, 2012, 10:55 AM=0A> On Mon, 2012-= 01-23 at 10:21 -0800, removeps-code@yahoo.com=0A> wrote:=0A> > Initially I = thought that my RootJDBCRealm might be the=0A> problem, but how can that be= ?=A0 =0A> =0A> > RootJDBCRealm extends Tomcat's own JDBCRealm.=A0 It=0A> ov= errides authenticate to call super.authenticate and if=0A> there are 3 fail= ures (in that super.authenticate returns=0A> null), then it locks out the u= ser.=0A> =0A> Sounds a lot like the LockOutRealm.=0A> =0A> =A0 https://tomc= at.apache.org/tomcat-7.0-doc/realm-howto.html#LockOutRealm=0A=0A> =0A> Any = reason you opted not to use it?=0A=0A=0ASorry, I did not know about this cl= ass. Will this class work if you have many Tomcats on different machines (= possibly load balancing) so regardless of which exact machine the user is d= irected to, lock realm will know the number of failed login attempts on oth= er machines?=0A=0A=0A=0A> =0A> Dan=0A> =0A> >=A0=A0=A0So could the user of = RootJDBCRealm=0A> still be a problem?=A0 Thanks.=0A> > =0A> > --- On Mon, 1= /23/12, Mark Thomas =0A> wrote:=0A> > =0A> > > From: Mark= Thomas =0A> > > Subject: Re: Connection.close() has alre= ady been=0A> called during login=0A> > > To: "Tomcat Users List" =0A> > > Date: Monday, January 23, 2012, 12:49 AM=0A> > > On= 23/01/2012 03:49, removeps-code@yahoo.com=0A> > > wrote:=0A> > > > Am runn= ing Tomcat 7 and see this in the=0A> logs:=0A> > > > =0A> > > > SEVERE: Exc= eption performing authentication=0A> > > >=0A> > >=0A> com.mysql.jdbc.excep= tions.jdbc4.MySQLNonTransientConnectionException:=0A> > > Connection.close(= ) has already been called.=0A> Invalid=0A> > > operation in this state.=0A>= > > >=A0 =A0=A0=A0at=0A> > >=0A> sun.reflect.NativeConstructorAccessorImpl= .newInstance0(Native=0A> > > Method)=0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> s= un.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcces= sorImpl.java:39)=0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> sun.reflect.Delegatin= gConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java= :27)=0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> java.lang.reflect.Constructor.new= Instance(Constructor.java:513)=0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> com.mys= ql.jdbc.Util.handleNewInstance(Util.java:406)=0A> > > >=A0 =A0=A0=A0at=0A> = > > com.mysql.jdbc.Util.getInstance(Util.java:381)=0A> > > >=A0 =A0=A0=A0at= =0A> > >=0A> com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)= =0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> com.mysql.jdbc.SQLError.createSQLExce= ption(SQLError.java:956)=0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> com.mysql.jdb= c.SQLError.createSQLException(SQLError.java:926)=0A> > > >=A0 =A0=A0=A0at= =0A> > >=0A> com.mysql.jdbc.ConnectionImpl.getMutex(ConnectionImpl.java:301= 8)=0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> com.mysql.jdbc.ConnectionImpl.commi= t(ConnectionImpl.java:1512)=0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> org.apache= .catalina.realm.JDBCRealm.getPassword(JDBCRealm.java:579)=0A> > > >=A0 =A0= =A0=A0at=0A> > >=0A> org.apache.catalina.realm.JDBCRealm.authenticate(JDBCR= ealm.java:408)=0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> org.apache.catalina.rea= lm.JDBCRealm.authenticate(JDBCRealm.java:355)=0A> > > >=A0 =A0=A0=A0at=0A> = > >=0A> pacific.tomcat.RootJDBCRealm.authenticate(SourceFile:71)=0A> > > = =0A> > > The above line is key. You are not using=0A> Tomcat's=0A> > > JDBC= Realm.=0A> > > =0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> org.apache.catalina.au= thenticator.FormAuthenticator.authenticate(FormAuthenticator.java:295)=0A> = > > >=A0 =A0=A0=A0at=0A> > >=0A> org.apache.catalina.authenticator.Authenti= catorBase.invoke(AuthenticatorBase.java:450)=0A> > > >=A0 =A0=A0=A0at=0A> >= >=0A> org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.= java:168)=0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> org.apache.catalina.valves.E= rrorReportValve.invoke(ErrorReportValve.java:98)=0A> > > >=A0 =A0=A0=A0at= =0A> > >=0A> org.apache.catalina.core.StandardEngineValve.invoke(StandardEn= gineValve.java:118)=0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> org.apache.catalin= a.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)=0A> > > >=A0 =A0= =A0=A0at=0A> > >=0A> org.apache.coyote.http11.AbstractHttp11Processor.proce= ss(AbstractHttp11Processor.java:987)=0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> o= rg.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(Abstrac= tProtocol.java:539)=0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> org.apache.tomcat.= util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:1773)= =0A> > > >=A0 =A0=A0=A0at=0A> > >=0A> java.util.concurrent.ThreadPoolExecut= or$Worker.runTask(ThreadPoolExecutor.java:886)=0A> > > >=A0 =A0=A0=A0at=0A= =0A> > >=0A> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolE= xecutor.java:908)=0A> > > >=A0 =A0=A0=A0at=0A> > > java.lang.Thread.run(Thr= ead.java:662)=0A> > > > =0A> > > > =0A> > > > could the reason be=0A> ROOT/= META-INF/context.xml which=0A> > > says=0A> > > > =0A> > > > =0A> = > > > =0A> > > >=A0=A0=A0 > > className=3D"pacific.tomcat.RootJDB= CRealm"=0A> > > >=A0 =A0 =A0 =A0=A0=A0=0A> > > driverName=3D"pacific.driver= .PacificMysqlDriver"=0A> > > >=A0 =A0 =A0 =A0=A0=A0=0A> > > connectionName= =3D"auth" connectionPassword=3D"..."=0A> > > >=A0 =A0 =A0 =A0=A0=A0=0A> > >= =0A> connectionURL=3D"pacific@jdbc:mysql://localhost:3306"=0A> > > >=A0 =A0= =A0 =A0 =A0=0A> userTable=3D"user"=0A> > > userNameCol=3D"username" userCr= edCol=3D"password"=0A> > > >=A0 =A0 =A0 =A0=A0=A0=0A> > > userRoleTable=3D"= user_role" roleNameCol=3D"rolename"=0A> > > >=A0 =A0 =A0 =A0 =A0=0A> digest= =3D"SHA1"/>=0A> > > > =0A> > > > That is, should I be using a datasource=0A= > realm=0A> > > instead?=0A> > > =0A> > > Yes.=0A> > > =0A> > > Mark=0A> > = > =0A> > >=0A> ------------------------------------------------------------= ---------=0A> > > To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.o= rg=0A> > > For additional commands, e-mail: users-help@tomcat.apache.org=0A= > > > =0A> > > =0A> > =0A> >=0A> ------------------------------------------= ---------------------------=0A> > To unsubscribe, e-mail: users-unsubscribe= @tomcat.apache.org=0A> > For additional commands, e-mail: users-help@tomcat= .apache.org=0A> > =0A> --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org