Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
Ashish Agre
Ranch Hand
Posts: 73
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Michael Ernest
High Plains Drifter
Sheriff
Posts: 7292
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Ashish Agre
Ranch Hand
Posts: 73
Java Linux Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1
Java Mac OS X MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic