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 145505 - [65cat] org.netbeans.api.db.explorer.DatabaseException: connection already exists
Summary: [65cat] org.netbeans.api.db.explorer.DatabaseException: connection already ex...
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Derby (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: John Baker
URL: http://statistics.netbeans.org/except...
Keywords:
: 145674 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-28 23:57 UTC by sunbiz
Modified: 2008-11-24 16:20 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter: 101219


Attachments
stacktrace (839 bytes, text/plain)
2008-08-28 23:57 UTC, sunbiz
Details
stacktrace (719 bytes, text/plain)
2008-08-30 11:15 UTC, alcmontejo
Details
stacktrace (839 bytes, text/plain)
2008-09-02 18:28 UTC, tonybeckham
Details

Note You need to log in before you can comment on or make changes to this bug.
Description sunbiz 2008-08-28 23:57:20 UTC
Build: NetBeans IDE Dev (Build 200808281401)
VM: Java HotSpot(TM) Client VM, 10.0-b22, Java(TM) SE Runtime Environment, 1.6.0_06-b02
OS: Linux, 2.6.24-19-generic, i386

User Comments: 
Started Netbeans and got this exception

Stacktrace: 
org.netbeans.api.db.explorer.DatabaseException: connection already exists
        at org.netbeans.modules.db.explorer.infos.RootNodeInfo.addConnection(RootNodeInfo.java:237)
        at org.netbeans.api.db.explorer.ConnectionManager.addConnection(ConnectionManager.java:145)
        at org.netbeans.modules.derby.api.DerbyDatabases.registerDatabase(DerbyDatabases.java:365)
        at org.netbeans.modules.derby.api.DerbyDatabases.createSampleDatabase(DerbyDatabases.java:282)
        at org.netbeans.modules.derby.Installer$RegisterJDKDerby.registerSampleDatabase(Installer.java:108)
        at org.netbeans.modules.derby.Installer$RegisterJDKDerby.run(Installer.java:87)
Comment 1 sunbiz 2008-08-28 23:57:26 UTC
Created attachment 68585 [details]
stacktrace
Comment 2 John Baker 2008-08-29 07:49:36 UTC
The Java DB directory must have been removed or the location changed for this exception to occur, is this right?

I suppose a check to see if the connection exists before attempting to add it.
Comment 3 John Baker 2008-08-29 09:40:51 UTC
I need more information please on how to reproduce.    If this is a rare use case then the priority may be lowered.
Comment 4 sunbiz 2008-08-29 11:43:19 UTC
It was quite odd that this exception occurred. I installed a new copy of Ubuntu on this machine. Installed the sun-
java-6, sun-java-5, the other remaining all that had sun and java, which I think also had derby. It may very well be 
that a derby is already started or installed, and when Netbeans starts its .netbeans-derby it may cause the 
exception... Completely unsure, but it was right after the first start on new installation that this happened.
Comment 5 alcmontejo 2008-08-30 11:15:11 UTC
Build: NetBeans IDE Dev (Build 200808281401)
VM: Java HotSpot(TM) Client VM, 1.6.0_02-b06, Java(TM) SE Runtime Environment, 1.6.0_02-b06
OS: Windows XP, 5.1, x86

User Comments: 
got this exception when I am about to create Java DB Database


Stacktrace: 
org.netbeans.api.db.explorer.DatabaseException: connection already exists
        at org.netbeans.modules.db.explorer.infos.RootNodeInfo.addConnection(RootNodeInfo.java:237)
        at org.netbeans.api.db.explorer.ConnectionManager.addConnection(ConnectionManager.java:145)
        at org.netbeans.modules.derby.api.DerbyDatabases.registerDatabase(DerbyDatabases.java:365)
        at org.netbeans.modules.derby.api.DerbyDatabases.createDatabase(DerbyDatabases.java:256)
        at org.netbeans.modules.derby.RegisterDerby$1.run(RegisterDerby.java:183)
        at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:572)
Comment 6 alcmontejo 2008-08-30 11:15:21 UTC
Created attachment 68703 [details]
stacktrace
Comment 7 tonybeckham 2008-09-02 18:28:27 UTC
Build: NetBeans IDE Dev (Build 200809020201)
VM: Java HotSpot(TM) Client VM, 11.0-b15, Java(TM) SE Runtime Environment, 1.6.0_10-rc-b28
OS: Windows Vista, 6.0, x86

User Comments: 
Installed full Nightly IDE and exception thrown when launched IDE from Desktop shortcut on windows vista.

Stacktrace: 
org.netbeans.api.db.explorer.DatabaseException: connection already exists
        at org.netbeans.modules.db.explorer.infos.RootNodeInfo.addConnection(RootNodeInfo.java:238)
        at org.netbeans.api.db.explorer.ConnectionManager.addConnection(ConnectionManager.java:145)
        at org.netbeans.modules.derby.api.DerbyDatabases.registerDatabase(DerbyDatabases.java:365)
        at org.netbeans.modules.derby.api.DerbyDatabases.createSampleDatabase(DerbyDatabases.java:282)
        at org.netbeans.modules.derby.Installer$RegisterJDKDerby.registerSampleDatabase(Installer.java:108)
        at org.netbeans.modules.derby.Installer$RegisterJDKDerby.run(Installer.java:87)
Comment 8 tonybeckham 2008-09-02 18:28:36 UTC
Created attachment 68892 [details]
stacktrace
Comment 9 John Baker 2008-09-02 23:03:04 UTC
a1657941d534
Comment 10 John Baker 2008-09-02 23:10:27 UTC
*** Issue 145674 has been marked as a duplicate of this issue. ***
Comment 11 Quality Engineering 2008-09-03 17:37:19 UTC
Integrated into 'main-golden', will be available in build *200809031401* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)
Changeset: http://hg.netbeans.org/main/rev/a1657941d534
User: John Baker <jbaker@netbeans.org>
Log: #145505 [65cat] org.netbeans.api.db.explorer.DatabaseException: connection already exists
Comment 12 Roman Mostyka 2008-09-11 14:55:11 UTC
sunbiz, can you verify this issue, since we had another similar issue #146732 and probably that issue is duplicate of
this, but reporter said that it isn't fixed.
We need to be sure that both issue are fixed, or they aren't duplicates.
Comment 13 Exceptions Reporter 2008-10-09 03:33:42 UTC
Reopening - reproduced in NetBeans IDE Dev (Build 200810080201)
http://statistics.netbeans.org/exceptions/detail.do?id=125251
Comment 14 John Baker 2008-10-09 06:47:05 UTC
If the user migrates settings from a previous release then I suppose it's possible that the migration could occur at the
same time RegisterDerby checks if the connection exists.

I think Installer should check if settings are migrated or not before trying to register Derby
Comment 15 John Baker 2008-10-09 20:37:20 UTC
wobster, did you import settings from 6.1 while starting NetBeans for the first time?
Comment 16 John Baker 2008-10-10 05:57:00 UTC
I couldn't reproduce using the 10/9 nightly build on Linux, using both JDK 1.5.0_16 and 1.6.0_10.

I tested starting a new installation by both importing 6.1 settings and without importing.

I need more information from wobster
Comment 17 Roman Mostyka 2008-10-22 12:39:40 UTC
wobster, can You update this issue? Are You still able to reproduce this issue?
We can't work on this issue since we don't have enough information. If this issue isn't updated and still in INCOMPLETE
state, then we will think that it isn't valid anymore (probably was fixed with another issue) and this issue will be closed.
Comment 18 Roman Mostyka 2008-11-24 16:16:46 UTC
We haven't got any new info in a month, so I'm closing this issue as FIXED.
Please reopen this issue if it is still valid and add some more information.
Comment 19 Roman Mostyka 2008-11-24 16:20:35 UTC
Verified.