• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Ranch Hand
Posts: 73
Netbeans IDE Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
High Plains Drifter
Posts: 7289
Netbeans IDE VI Editor
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Netbeans IDE Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Greenhorn
Posts: 1
Mac OS X MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I had a similar challenge and almost gave up. Here's what to do. Under the services tab, locate servers and Right-click on the glassfish server and select view admin console. This will launch the glassfish admin console on your default browser. Under "configurations", click "server-config", then "security" and then "realms" . On the pane that displays on the right hand, click "new". Then you fill the details. Basically, that page tells glassfish server where the user table is in the database, the column/field that is used as the username, the name of the table that has the users group, the name of the password field/column, the kind of encryption that is used. Don't forget to also fill the digest algorithm (this is usually the same with the one you filled in the password encryption algorithm). you can also watch this on youtube link https://www.youtube.com/watch?v=a-hUUTHOzsY
 
reply
    Bookmark Topic Watch Topic
  • New Topic