tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Thomas <ma...@apache.org>
Subject Re: Connection.close() has already been called during login
Date Mon, 23 Jan 2012 08:49:07 GMT
On 23/01/2012 03:49, removeps-code@yahoo.com wrote:
> Am running Tomcat 7 and see this in the logs:
> 
> SEVERE: Exception performing authentication
> com.mysql.jdbc.exceptions.jdbc4.MySQLNonTransientConnectionException: Connection.close()
has already been called. Invalid operation in this state.
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
> 	at com.mysql.jdbc.Util.handleNewInstance(Util.java:406)
> 	at com.mysql.jdbc.Util.getInstance(Util.java:381)
> 	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:984)
> 	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)
> 	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:926)
> 	at com.mysql.jdbc.ConnectionImpl.getMutex(ConnectionImpl.java:3018)
> 	at com.mysql.jdbc.ConnectionImpl.commit(ConnectionImpl.java:1512)
> 	at org.apache.catalina.realm.JDBCRealm.getPassword(JDBCRealm.java:579)
> 	at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:408)
> 	at org.apache.catalina.realm.JDBCRealm.authenticate(JDBCRealm.java:355)
> 	at pacific.tomcat.RootJDBCRealm.authenticate(SourceFile:71)

The above line is key. You are not using Tomcat's JDBCRealm.

> 	at org.apache.catalina.authenticator.FormAuthenticator.authenticate(FormAuthenticator.java:295)
> 	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:450)
> 	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
> 	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
> 	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
> 	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
> 	at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
> 	at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
> 	at org.apache.tomcat.util.net.AprEndpoint$SocketWithOptionsProcessor.run(AprEndpoint.java:1773)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> 	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> 	at java.lang.Thread.run(Thread.java:662)
> 
> 
> could the reason be ROOT/META-INF/context.xml which says
> 
> <Context>
> 
>   <Realm className="pacific.tomcat.RootJDBCRealm"
>          driverName="pacific.driver.PacificMysqlDriver"
>          connectionName="auth" connectionPassword="..."
>          connectionURL="pacific@jdbc:mysql://localhost:3306"
>          userTable="user" userNameCol="username" userCredCol="password"
>          userRoleTable="user_role" roleNameCol="rolename"
>          digest="SHA1"/>
> 
> That is, should I be using a datasource realm instead?

Yes.

Mark

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


Mime
View raw message