This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 181043 - GlassFish JDBC Resource wizard - Connection fails with MySQL empty password as "()"
Summary: GlassFish JDBC Resource wizard - Connection fails with MySQL empty password a...
Status: RESOLVED FIXED
Alias: None
Product: serverplugins
Classification: Unclassified
Component: GlassFish (show other bugs)
Version: 6.x
Hardware: PC Mac OS X
: P2 normal (vote)
Assignee: Vince Kraemer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-22 10:47 UTC by Troy Giunipero
Modified: 2010-02-23 22:44 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Troy Giunipero 2010-02-22 10:47:30 UTC
When using a vanilla installation of MySQL with username/password combination set to "root"/"", the JDBC Resource wizard by default reads in connection properties and sets the password to "()".

When you attempt to ping the connection pool after completing the wizard, you receive the following error:

"java.sql.SQLException: Error in allocating a connection. Cause: Connection could not be allocated because: Access denied for user 'root'@'localhost' (using password: YES)"

Workaround: in the sun-resources.xml file created from the wizard, delete the "()" value set for the password (so that the value becomes an empty string).

Note that the wizard currently does not allow you to delete the Password property, or set the Password property to an empty string.

Strangely, after setting the password to an empty string (and successfully pinging the connection pool), the Password property in the GF Admin Console still lists the value as "()".
Comment 1 Vince Kraemer 2010-02-22 14:11:49 UTC
How do you ping the connection pool after completing the wizard?

You may want to read through this for a bit of background on the mystery of the () value in a password field...  http://blogs.sun.com/vkraemer/entry/no_passwordcredential_found
Comment 2 Troy Giunipero 2010-02-22 16:33:41 UTC
I was pinging via the GlassFish Admin Console (under the 'General' tab for a selected connection pool) after redeploying the app.

I wanted to make sure GlassFish was picking up the changes to the sun-resources.xml file. Sure enough, if you modify the password value and redeploy, you can see the updated value listed under the 'Additional Properties' tab.

But as I suggested in the previous message, when you set

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

in sun-resources.xml, the password value under 'Additional Properties' is listed as "()". As such, the connection seems to work fine.

The JDBC Resource wizard produces

    <property name="Password" value="()"/>

by default, and although the password value under 'Additional Properties' is still listed as "()", this doesn't create a viable connection for me.
Comment 3 Vince Kraemer 2010-02-22 17:20:58 UTC
ok. that is what I thought you meant. 

writing an initial description that provides step by step instructions on how to reproduce a result makes it easier to resolve it and test it.
Comment 4 Quality Engineering 2010-02-23 22:07:42 UTC
Integrated into 'main-golden', will be available in build *201002240200* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/24879323e8e1
User: vince kraemer <vkraemer@netbeans.org>
Log: #181043: cannot ping resource for empty password...
Comment 5 Vince Kraemer 2010-02-23 22:44:45 UTC
fix is in trunk