Quick Fix for GlassFish/MySQL NoPasswordCredential Found

Guest Author
Just the other day, I stood up a GlassFish 3.1.2 server in preparation for a new web app we've developed. Since we're using MySQL as the back-end database, I configured it for MySQL (driver) and created the requisite JDBC resource and supporting connection pool. Pinging the finished pool returned a success, and all was well.

Until we fired up the app, that is -- in this case, after a weekend. Funny how things seem to break when you leave them alone for a couple of days. :-) Strangely, the error indicated "No PasswordCredential found". Time to re-check that pool.

All the usual properties and values were there (URL, driverClass, serverName, databaseName, portNumber, user, password) and were populated correctly. Yes, the password field, too. And it had pinged successfully. So why the problem?

A bit of searching online produced enough relevant material to offer promise. I didn't take notes as I was investigating the cause (note to self), but here were the general steps I took to resolve the issue:

First, per some guidance I had found, I tried resetting the password value to nothing (using () for a value). Of course, this didn't fix anything; the database account requires a password. And when I tried to put the value back, GlassFish politely refused. Hmm.

I'd seen that some folks created a new pool to replace the "broken" one, and while that did work for them, it seemed to simply side-step the issue. So I deleted the password property - which GlassFish allowed me to do - and restarted the domain. Once I was back in, I re-added the password property and its value, saved it, and pinged...success! But now to the app for the litmus test.

The web app worked, and everything and everyone was now happy. Not bad for a Monday.  :-D

Hope this helps,


Join the discussion

Comments ( 3 )
  • guest Monday, August 5, 2013

    Just edit domain.xml and add by hand the password and user with a:

    <jdbc-connection-pool datasource-classname="org.h2.jdbcx.JdbcDataSource" res-type="javax.sql.DataSource" name="studentPool">

    <property description="user" name="User" value="sa"></property>

    <property description="url" name="Url" value="jdbc:h2:/home/mark/studentPool"></property>

    <property description="password" name="Password" value=""></property>


  • Hamza Monday, May 11, 2015

    Thank you very much. I had this problem for days!!

  • Mark Heckler Monday, May 11, 2015

    Very welcome, Hamza...glad it helped!



Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.