It's not a secret anymore!*
The moose likes Glassfish and the fly likes Error while authenticating user throught glassfish jdbc realm mysql connection pool problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Glassfish
Bookmark "Error while authenticating user throught glassfish jdbc realm mysql connection pool problem" Watch "Error while authenticating user throught glassfish jdbc realm mysql connection pool problem" New topic
Author

Error while authenticating user throught glassfish jdbc realm mysql connection pool problem

Ashish Agre
Ranch Hand

Joined: Jan 22, 2011
Posts: 73

I am able to authenticate the user successfully through realm first time when restart the server and deploy the application. But after few minutes when i try to open the webapp in different browser the i'am unable to authenticate the user..
With localhost mysql it works fine but when i try to connect the remote mysql authentication fails after sometime.
I have posted this question in jdbc forum also ... mysql connection pool issue
This is my glassfish-resources.xml




the stack trace of the error is as follows...



I am fed of this error search so many threads but unable to resolve this problem.


| B.E IT | SCJP 6.0 98 % |
Michael Ernest
High Plains Drifter
Sheriff

Joined: Oct 25, 2000
Posts: 7292

The default value for the attribute idle-timeout-in-seconds is 300. The pool may reclaim a any connection that is idle for that duration or longer.

Try adjusting this value to a longer interval and see if that clears the problem you're seeing.


Make visible what, without you, might perhaps never have been seen.
- Robert Bresson
Ashish Agre
Ranch Hand

Joined: Jan 22, 2011
Posts: 73

Hi... Michael... sorry for late reply...
i added this field is-connection-validation-required="true" it worked but there is a new exception... not severe or any other... it should be igored or something else...

INFO: RAR5074 : Table based validation detected invalid connection. Querying the table GROUPS failed. Set resource-adapter log-level to FINE for exception stack trace.
INFO: RAR5074 : Table based validation detected invalid connection. Querying the table GROUPS failed. Set resource-adapter log-level to FINE for exception stack trace.
INFO: RAR5074 : Table based validation detected invalid connection. Querying the table GROUPS failed. Set resource-adapter log-level to FINE for exception stack trace.
INFO: RAR5074 : Table based validation detected invalid connection. Querying the table GROUPS failed. Set resource-adapter log-level to FINE for exception stack trace.
INFO: RAR5074 : Table based validation detected invalid connection. Querying the table GROUPS failed. Set resource-adapter log-level to FINE for exception stack trace.
INFO: RAR5074 : Table based validation detected invalid connection. Querying the table GROUPS failed. Set resource-adapter log-level to FINE for exception stack trace.
INFO: RAR5074 : Table based validation detected invalid connection. Querying the table GROUPS failed. Set resource-adapter log-level to FINE for exception stack trace.
INFO: RAR5074 : Table based validation detected invalid connection. Querying the table GROUPS failed. Set resource-adapter log-level to FINE for exception stack trace.
Andy Hueni
Greenhorn

Joined: May 19, 2014
Posts: 1

Hi all,

I had a similar issue appearing on a CentOS server, the exact reasons are not clear to me; it might be an issue with the MySQL version or the OS version, in any case I had no problems with my initial settings on other servers.
The actual problem manifests thus:
- after a Glassfish (V3.1.2.2) restart the login via a JDBC table based authentication worked fine
- some minutes later the authentication failed: on the client side throwing a HTTP authentication required (401) error while the server glassfish log listed a jdbcrealm.invaliduserreason error with no further details.
- a glassfish restart reset the problem for a few minutes, then it reappeared again ….

A working solution was found by configuring the Glassfish JDBC connection pool advanced settings in the Connection Validation section:
- Connection Validation: Required
- Validation Method: table
- table name: <your database table that holds the user information> (name and password)
- On Any Failure: Close All Connections


Cheers & happy coding!

Andy
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error while authenticating user throught glassfish jdbc realm mysql connection pool problem
 
Similar Threads
Login Exception when using JDBC Realm (Glassfish V3.1 + IceFaces 2 + MySQL)
Error while authenticating user throught glassfish jdbc realm mysql connection pool problem
All glassfish 3.1.1 login modules stopped working
Glassfish with JDBCRealm
JDBC Realm Authentication failed