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 139959 - NPE in Create DB dialogs in New Project wizard
Summary: NPE in Create DB dialogs in New Project wizard
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: MySQL (show other bugs)
Version: 6.x
Hardware: PC All
: P3 blocker (vote)
Assignee: David Vancouvering
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-07-14 22:58 UTC by Chris Kutler
Modified: 2008-09-18 14:10 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
log file (113.53 KB, text/plain)
2008-07-15 18:23 UTC, Chris Kutler
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Kutler 2008-07-14 22:58:13 UTC
Window 20080710 All download

 In step 3 of the new project wizard for Rails apps, I click the Create DB dialog box. 
I get a MySQL Server Properties window. After I fill out the front tab (Basic Properties) and click OK I get

Unable to connect to the MySQL server. Please check your settings in the Properties and try again.:
java.lang.NullPointerException.

What properties am I supposed to check? How do I get to those properties?
Comment 1 Chris Kutler 2008-07-14 23:12:05 UTC
I have another problem with this UI. When I get to the Create MySQL Database dialog box, it has a check box labeled
Grant full access to user (that should be Grant Full Access to User by the way as it is a label for a checkbox).  There
is only one available name to select from sam@localhost. I don't know where it got that from. I am wondering why I can't
type in a different user.
Comment 2 Erno Mononen 2008-07-15 07:58:23 UTC
Passing to db/mysql. I think the full stack trace would be needed, please attach the messages.log file (it is in the 
[netbeans home]/var/log directory).
Comment 3 Chris Kutler 2008-07-15 18:23:09 UTC
Created attachment 64598 [details]
log file
Comment 4 Chris Kutler 2008-07-15 18:28:49 UTC
For the attached log, here is what I did

I started the IDE.

I created new rails project

On page 3 I clicked the Create DB button 

The MySQL Server Properties dialog box appears

I entered the Administrator password (note that should be Administrator Password -- All of the labels should be
capitalized, but they are not).

I clicked OK and got the error message.
Comment 5 David Vancouvering 2008-07-28 23:44:59 UTC
The main problem is that this is causing a NullPointerException when authentication fails.  If you look at the stack
trace, it says

INFO [org.netbeans.modules.db.mysql.DatabaseServer]
java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: NO)

so you probably typed in the wrong password, and that's the original problem.  It's pretty bad that you get a NPE when
this happens (I never did, but I'll look at the code).

If you think the label is wrong, can you please log another issue, I can't track multiple problems under a single issue.

With your question about the users listed in the "grant access to" drop down, this list of users is the list of users
available in the database.  You can't grant access to users that don't exist, so that's why you can't type in a new one.
 If you were to create a new user in MySQL, that user would show up next time you ran this dialog.
Comment 6 David Vancouvering 2008-07-29 19:08:51 UTC
Since this is caused by an authentication failure and is easily worked around by typing in the correct password, I am
downgrading this to a P3, but we'll get it fixed for 6.5
Comment 7 David Vancouvering 2008-08-30 00:50:51 UTC
I've made a number of fixes in this area and I can't reproduce this.  Please re-open if you can still reproduce using
the next nightly build (I'm pushing a bunch of changes tonight).
Comment 8 David Vancouvering 2008-08-30 00:51:35 UTC
See if this is fixed after changeset 92423a3cd051 is pushed to main-golden.
Comment 9 Chris Kutler 2008-09-02 21:03:11 UTC
I still see the Error dialog box.  (Build 20080902163604) on windows

Unable to connect to the MySQL server. Please check your settings in the Properties and try again.:
java.lang.NullPointerException.

I will leave it up to you as to whether to reopen or not.
Comment 10 David Vancouvering 2008-09-02 21:38:21 UTC
Chris is still seeing this.  Will investigate.
Comment 11 David Vancouvering 2008-09-16 19:38:06 UTC
OK, I reproduced, although now instead of an NPE I get "can not call this method on the event dispatch thread."

I'll take a look.
Comment 12 David Vancouvering 2008-09-16 21:17:43 UTC
OK, I'm pretty sure I fixed this.  What I ended up having to do was move the code that makes sure we are connected to
the Create Database dialog.  Now the Ruby code is actually much simpler - it simply invokes the dialog rather than
having to first check and see if we're connected.

afc3ed5e2850

Please verify once you see the comment that it has been integrated into the nightly build.

Erno, I am pretty sure this also fixes the issue I logged saying you were calling reconnect synchronously on the
dispatch thread.  I'll go ahead and close it.
Comment 13 Quality Engineering 2008-09-18 05:32:32 UTC
Integrated into 'main-golden', will be available in build *200809180201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/afc3ed5e2850
User: David Van Couvering <davidvc@netbeans.org>
Log: #139959: NPE in Create DB dialogs in New Project wizard
Comment 14 Roman Mostyka 2008-09-18 14:10:20 UTC
Verified with build 080918.