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 255524 - "New RESTful webservices from databases" throws IllegalStateException
Summary: "New RESTful webservices from databases" throws IllegalStateException
Status: RESOLVED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Code (show other bugs)
Version: 8.1
Hardware: All All
: P3 normal (vote)
Assignee: matthias42
URL:
Keywords:
: 255170 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-09-23 19:54 UTC by matthias42
Modified: 2015-09-25 01:47 UTC (History)
1 user (show)

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 matthias42 2015-09-23 19:54:48 UTC
Steps to reproduce:

1. Create Java Web Application project
2. Assoziate a glassfish server with a datasource in netbeans format (DriverClass property is present) and ensure that no matching connection is present in netbeans
3. Enter the "New RESTful webservices from databases" wizard
4. click on the datasource in the connection dropdown
5. The "New database connection" dialog popsup
6. Cancel it

=> An IllegalStateException is raised, complaining about trying to get the JDBC connection for a databaseConnection that is not yet added to the ConnectionManager.

Analysis: The AddConnectionWizard also returned a database connection if it was canceled. The called expects NULL as result if wizard is canceled.
Comment 1 matthias42 2015-09-23 20:03:47 UTC
The relevant stack trace:

java.lang.IllegalStateException: This connection is not added to the ConnectionManager.
	at org.netbeans.api.db.explorer.DatabaseConnection.getJDBCConnection(DatabaseConnection.java:337)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.DBSchemaManager$2.isEnabled(DBSchemaManager.java:132)
	at org.netbeans.modules.j2ee.core.api.support.progress.ProgressSupport$ActionInvoker.invokeNextActionsOfSameKind(ProgressSupport.java:247)
	at org.netbeans.modules.j2ee.core.api.support.progress.ProgressSupport$ActionInvoker.invoke(ProgressSupport.java:186)
	at org.netbeans.modules.j2ee.core.api.support.progress.ProgressSupport.invoke(ProgressSupport.java:112)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.DBSchemaManager.getSchemaElement(DBSchemaManager.java:233)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.DatabaseTablesPanel.updateSourceSchema(DatabaseTablesPanel.java:553)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.DatabaseTablesPanel.datasourceComboBoxActionPerformed(DatabaseTablesPanel.java:975)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.DatabaseTablesPanel.access$1000(DatabaseTablesPanel.java:108)
	at org.netbeans.modules.j2ee.persistence.wizard.fromdb.DatabaseTablesPanel$5.actionPerformed(DatabaseTablesPanel.java:705)
	at javax.swing.JComboBox.fireActionEvent(JComboBox.java:1260)
	at javax.swing.JComboBox.setSelectedItem(JComboBox.java:588)
	at javax.swing.JComboBox.setSelectedIndex(JComboBox.java:624)
	at javax.swing.plaf.basic.BasicComboPopup$Handler.mouseReleased(BasicComboPopup.java:835)
	at java.awt.AWTEventMulticaster.mouseReleased(AWTEventMulticaster.java:290)
	at java.awt.Component.processMouseEvent(Component.java:6516)
	at javax.swing.JComponent.processMouseEvent(JComponent.java:3312)
	at javax.swing.plaf.basic.BasicComboPopup$1.processMouseEvent(BasicComboPopup.java:499)
	at java.awt.Component.processEvent(Component.java:6281)
	at java.awt.Container.processEvent(Container.java:2229)
	at java.awt.Component.dispatchEventImpl(Component.java:4872)
	at java.awt.Container.dispatchEventImpl(Container.java:2287)
	at java.awt.Component.dispatchEvent(Component.java:4698)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4832)
	at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4492)
	at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4422)
	at java.awt.Container.dispatchEventImpl(Container.java:2273)
	at java.awt.Window.dispatchEventImpl(Window.java:2719)
	at java.awt.Component.dispatchEvent(Component.java:4698)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:747)
	at java.awt.EventQueue.access$300(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:706)
	at java.awt.EventQueue$3.run(EventQueue.java:704)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:87)
	at java.awt.EventQueue$4.run(EventQueue.java:720)
	at java.awt.EventQueue$4.run(EventQueue.java:718)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:717)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
[catch] at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:154)
	at java.awt.WaitDispatchSupport$2.run(WaitDispatchSupport.java:182)
	at java.awt.WaitDispatchSupport$4.run(WaitDispatchSupport.java:221)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.awt.WaitDispatchSupport.enter(WaitDispatchSupport.java:219)
	at java.awt.Dialog.show(Dialog.java:1082)
	at org.netbeans.core.windows.services.NbPresenter.superShow(NbPresenter.java:1065)
	at org.netbeans.core.windows.services.NbPresenter.doShow(NbPresenter.java:1115)
	at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:1087)
	at org.netbeans.core.windows.services.NbPresenter.run(NbPresenter.java:128)
	at org.netbeans.modules.openide.util.NbMutexEventProvider$Event.doEventAccess(NbMutexEventProvider.java:138)
	at org.netbeans.modules.openide.util.NbMutexEventProvider$Event.readAccess(NbMutexEventProvider.java:98)
	at org.netbeans.modules.openide.util.LazyMutexImplementation.readAccess(LazyMutexImplementation.java:94)
	at org.openide.util.Mutex.readAccess(Mutex.java:218)
	at org.netbeans.core.windows.services.NbPresenter.show(NbPresenter.java:1072)
	at java.awt.Component.show(Component.java:1655)
	at java.awt.Component.setVisible(Component.java:1607)
	at java.awt.Window.setVisible(Window.java:1014)
	at java.awt.Dialog.setVisible(Dialog.java:1005)
	at org.netbeans.core.windows.services.DialogDisplayerImpl$1AWTQuery.showDialog(DialogDisplayerImpl.java:266)
	at org.netbeans.core.windows.services.DialogDisplayerImpl$1AWTQuery.run(DialogDisplayerImpl.java:192)
	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:312)
	at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:745)
	at java.awt.EventQueue.access$300(EventQueue.java:103)
	at java.awt.EventQueue$3.run(EventQueue.java:706)
	at java.awt.EventQueue$3.run(EventQueue.java:704)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(ProtectionDomain.java:76)
	at java.awt.EventQueue.dispatchEvent(EventQueue.java:715)
	at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:159)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:242)
	at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:161)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:150)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:146)
	at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:138)
	at java.awt.EventDispatchThread.run(EventDispatchThread.java:91)
Comment 2 matthias42 2015-09-23 20:09:40 UTC
Fix was pushed as:

http://hg.netbeans.org/core-main/rev/02c5b6b5b71d
Comment 3 matthias42 2015-09-23 20:12:41 UTC
*** Bug 255170 has been marked as a duplicate of this bug. ***
Comment 4 Quality Engineering 2015-09-25 01:47:15 UTC
Integrated into 'main-silver', will be available in build *201509250002* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/02c5b6b5b71d
User: Matthias Blaesing <matthias42@netbeans.org>
Log: #255524: Ensure AddConnectionWizard returns NULL if it is canceled and not an invalid connection object