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 81619 - NPE after pressing cancel in New Database Connection Wizard
Summary: NPE after pressing cancel in New Database Connection Wizard
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 5.x
Hardware: All All
: P3 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-08-01 17:26 UTC by Erno Mononen
Modified: 2006-08-25 16:20 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
stacktrace (5.56 KB, text/plain)
2006-08-01 17:27 UTC, Erno Mononen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Erno Mononen 2006-08-01 17:26:31 UTC
A NPE was thrown when pressing cancel in New Database Connection Wizard.

Steps:
1. Create a J2EE 1.4 web app
2. Invoke New Persistence Unit Wizard
3. Choose 'New Connection' from the wizard's database connection combo box
4. Press cancel in the opened wizard => NPE is thrown. 

java.lang.NullPointerException
	at 
org.netbeans.modules.db.explorer.DatabaseConnection.toString(DatabaseConnection.java:667)
	at 
org.netbeans.modules.db.explorer.DatabaseConnection.equals(DatabaseConnection.java:622)
	at 
org.netbeans.modules.db.explorer.ConnectionList.getConnection(ConnectionList.java:86)
	at 
org.netbeans.modules.db.explorer.actions.ConnectUsingDriverAction$NewConnectionDialogDisplayer.showDialog(ConnectUsingDriverAction.java:301)
	at 
org.netbeans.modules.db.explorer.actions.ConnectUsingDriverAction$NewConnectionDialogDisplayer.showDialog(ConnectUsingDriverAction.java:103)
	at 
org.netbeans.api.db.explorer.ConnectionManager$1.run(ConnectionManager.java:163)
...
Comment 1 Erno Mononen 2006-08-01 17:27:32 UTC
Created attachment 32417 [details]
stacktrace
Comment 2 Andrei Badea 2006-08-02 09:33:51 UTC
Probably forgot to check for null when returning the connection for issue 80629,
easy to fix.
Comment 3 Andrei Badea 2006-08-04 11:00:50 UTC
The cause seems to be different, can't reproduce under debugger. Seems to be a
http://en.wikipedia.org/wiki/Heisenbug.
Comment 4 Andrei Badea 2006-08-04 11:28:24 UTC
Fixed.

Checking in src/org/netbeans/modules/db/explorer/DatabaseConnection.java;
/cvs/db/src/org/netbeans/modules/db/explorer/DatabaseConnection.java,v  <-- 
DatabaseConnection.java
new revision: 1.39.2.2.2.5; previous revision: 1.39.2.2.2.4
done
Comment 5 Lukasz Grela 2006-08-25 16:20:46 UTC
v.