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.
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.
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)
Fix was pushed as: http://hg.netbeans.org/core-main/rev/02c5b6b5b71d
*** Bug 255170 has been marked as a duplicate of this bug. ***
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