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 212875 - AssertionError: Inconsistent state when driverName is null but other parameters (url?jdbc:sqlserver://sqlserver1;databaseName=WebRequest;IntegratedSecurity=true;, class?null, user? false are not
Summary: AssertionError: Inconsistent state when driverName is null but other paramete...
Status: RESOLVED FIXED
Alias: None
Product: javaee
Classification: Unclassified
Component: Web Project (show other bugs)
Version: 7.2
Hardware: All All
: P3 normal (vote)
Assignee: David Konecny
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-23 07:39 UTC by muellermi
Modified: 2012-10-31 02:55 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 188242


Attachments
stacktrace (5.97 KB, text/plain)
2012-05-23 07:39 UTC, muellermi
Details
stacktrace (5.96 KB, text/plain)
2012-05-23 08:03 UTC, muellermi
Details
Patch (4.02 KB, patch)
2012-05-24 11:02 UTC, Jaroslav Havlin
Details | Diff
stacktrace (5.97 KB, text/plain)
2012-05-24 12:31 UTC, muellermi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description muellermi 2012-05-23 07:39:40 UTC
This bug was originally marked as duplicate of bug 193925, that is already resolved. This bug is still valid, so this seems to be another bug, but it might be related.

Build: NetBeans IDE Dev (Build 201205200400)
VM: Java HotSpot(TM) Client VM, 23.0-b21, Java(TM) SE Runtime Environment, 1.7.0_04-b22
OS: Windows XP

User Comments:
muellermi: click on add connection of resolve data sources

GUEST: 1) Opened a project with a missing datasource warning
2) Right-clicked the project and chose "resolve data sources"
3) Clicked on "Add Connection..." and got the warning




Stacktrace: 
java.lang.AssertionError: Inconsistent state when driverName is null but other parameters (url?jdbc:sqlserver://sqlserver1;databaseName=WebRequest;IntegratedSecurity=true;, class?null, user? false are not
   at org.netbeans.modules.db.explorer.dlg.AddConnectionWizard.<init>(AddConnectionWizard.java:102)
   at org.netbeans.modules.db.explorer.dlg.AddConnectionWizard.showWizard(AddConnectionWizard.java:114)
   at org.netbeans.modules.db.explorer.action.ConnectUsingDriverAction$NewConnectionDialogDisplayer.showDialog(ConnectUsingDriverAction.java:117)
   at org.netbeans.modules.db.explorer.action.ConnectUsingDriverAction$NewConnectionDialogDisplayer.showDialog(ConnectUsingDriverAction.java:113)
   at org.netbeans.api.db.explorer.ConnectionManager.showAddConnectionDialogFromEventThread(ConnectionManager.java:328)
   at org.netbeans.modules.j2ee.common.ui.MissingDatabaseConnectionWarning$2.run(MissingDatabaseConnectionWarning.java:379)
Comment 1 muellermi 2012-05-23 07:39:44 UTC
Created attachment 119758 [details]
stacktrace
Comment 2 muellermi 2012-05-23 08:03:10 UTC
Created attachment 119759 [details]
stacktrace

This problem is serious. Even when I delete the data source and re-create a fresh one, I'll get a reference problem which can't be resolved because of this bug.
SQLServer is commonly configured using windows authentication (integrated security), thus no user and password is provided!
But a driver name is provided. I double-checked this.
Comment 3 Jaroslav Havlin 2012-05-23 13:43:05 UTC
I'm sorry, I cannot reproduce.
Please, could you attach your datasource configuration?
Comment 4 Jaroslav Havlin 2012-05-23 14:14:37 UTC
> I'm sorry, I cannot reproduce.
> Please, could you attach your datasource configuration?
Reproduced.
Comment 5 Jaroslav Havlin 2012-05-24 08:15:20 UTC
(In reply to comment #2)
> SQLServer is commonly configured using windows authentication (integrated
> security), thus no user and password is provided!
> But a driver name is provided. I double-checked this.
It seems that the problem is not caused by missing user name, but the driver specified in context.xml//Context/Resource/@driverClassName is not registered in Netbeans (Services window/Databases/Drivers).
Please, try to add the specified driver, and let me know whether it helped. Thank you.
Comment 6 Jaroslav Havlin 2012-05-24 11:01:39 UTC
Maybe this should be fixed in the  Web Project module. If correct driver is not found for the data source, users should be notified about it. Otherwise they could create a connection that is not related to the broken data source, and the problem would not be resolved.

Reassigning. Please check the patch. (The notification dialogs are not very nice, but showing the messages in Add Driver dialog would require an API change).

By the way, is this feature still necessary (after the visual web support was dropped)?
Comment 7 Jaroslav Havlin 2012-05-24 11:02:43 UTC
Created attachment 119809 [details]
Patch
Comment 8 muellermi 2012-05-24 12:31:50 UTC
Created attachment 119815 [details]
stacktrace

Still the same problem with build 201205240002
Comment 9 muellermi 2012-05-31 13:54:25 UTC
> It seems that the problem is not caused by missing user name, but the driver specified in context.xml//Context/Resource/@driverClassName is not registered in Netbeans (Services window/Databases/Drivers).
> Please, try to add the specified driver, and let me know whether it helped. Thank you.

Yep, this helped. 
No need for this in previous versions:
if a driver was not present, click to add data source and NetBeans asked for the driver in that dialog.
Comment 10 David Konecny 2012-10-30 00:53:18 UTC
Patch looks OK so I committed it. Thanks jhavlin!
a8b7d765852c
Comment 11 Quality Engineering 2012-10-31 02:55:14 UTC
Integrated into 'main-golden', will be available in build *201210310001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main-golden/rev/a8b7d765852c
User: David Konecny <dkonecny@netbeans.org>
Log: #212875 - AssertionError: Inconsistent state when driverName is null but other parameters (url?jdbc:sqlserver://sqlserver1;databaseName=WebRequest;IntegratedSecurity=true;, class?null, user? false are not
applying patch from jhavlin@netbeans.org  - Thanks!