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 101785 - Cannot connect to Derby
Summary: Cannot connect to Derby
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Derby (show other bugs)
Version: 6.x
Hardware: PC Windows XP
: P2 blocker (vote)
Assignee: Andrei Badea
URL:
Keywords: RANDOM
: 97648 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-04-19 14:30 UTC by Roman Mostyka
Modified: 2007-09-03 10:21 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Screeshot (17.33 KB, image/jpeg)
2007-04-19 14:36 UTC, Roman Mostyka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Roman Mostyka 2007-04-19 14:30:39 UTC
1. Installed full Standard NetBeans (Java IDE + WebPack + Mobility Pack +
GlassFish).
2. Start IDE.
3. Select 'Runtime' tab and expand 'Databases' node.
4. Rightclick default DB (bound to GlassFish and added by default to 'Databases'
node) and click 'Connect'.

Result: Error message about opening socket appears and connection fails.

See screenshot for full text of error.
Comment 1 Roman Mostyka 2007-04-19 14:36:39 UTC
Created attachment 41256 [details]
Screeshot
Comment 2 Andrei Badea 2007-04-19 18:45:37 UTC
On which JDK?

Is Java DB registered? Look in Tools - Options - Advanced Options - Server and
External Tool Settings - Java DB Location. If registered, can you start it
manually using Tools - Java DB Database - Start Java DB Server?
Comment 3 David Vancouvering 2007-04-19 18:52:38 UTC
One thought, I've had this happen when the Java DB network server is already
running.  I also get this sporadically for reasons that are unclear to me, when
I specifically see Java DB running in the output window at the bottom.   Then
when I try to connect again it works.
Comment 4 John Baker 2007-04-19 22:35:21 UTC
Please check ports used by your system

% netstat | grep 1527

if 1527 is in use then, assuming this port was reserved by Derby, you may have
to kill the jdbc java process

Comment 5 John Baker 2007-04-19 22:35:57 UTC
Please check ports used by your system

% netstat | grep 1527

if 1527 is in use then, assuming this port was reserved by Derby, you may have
to kill the jdbc java process.

I'm marking as INCOMPLETE until more info is provided

Comment 6 Roman Mostyka 2007-04-20 07:41:29 UTC
Reboot, reinstall IDE and everything works fine.
Reinstall second time, everything also works fine.
Comment 7 Andrei Badea 2007-04-20 16:46:22 UTC
I saw this issue today on another computer, I want to investigate more.
Comment 8 Andrei Badea 2007-04-23 20:03:40 UTC
I don't see a way how this can occur except for the Java DB server taking longer
to start than 5 seconds. I added some logging, so now if this happens there will
be a message in the log. If you still happen to encounter the issue, please look
in the message log for something like:

WARNING [org.netbeans.modules.derby.RegisterDerby]: Derby server failed to start
in 5000 ms

and post a commment about it to this issue.

I also think that if the server fails to start in 5 seconds, we should display 
a dialog asking the user whether to wait more instead of just silently giving up
waiting.
Comment 9 Andrei Badea 2007-04-23 20:05:46 UTC
Adding logging.

Checking in src/org/netbeans/modules/derby/RegisterDerby.java;
/cvs/db/derby/src/org/netbeans/modules/derby/RegisterDerby.java,v  <-- 
RegisterDerby.java
new revision: 1.24; previous revision: 1.23
done
Comment 10 Andrei Badea 2007-05-21 13:23:51 UTC
*** Issue 97648 has been marked as a duplicate of this issue. ***
Comment 11 Andrei Badea 2007-05-21 13:25:18 UTC
Just reproduced the error when trying to connect to Derby while the initial scan
was running. Got the message I mentioned in desc9. It seems sometimes Derby
fails to start in 5000 ms.
Comment 12 Andrei Badea 2007-06-25 16:48:54 UTC
Fixed by introducing a confirmation dialog informing that the server did not start in 5 seconds and asking whether to
wait for another 5 seconds.

Checking in src/org/netbeans/modules/derby/Bundle.properties;
/cvs/db/derby/src/org/netbeans/modules/derby/Bundle.properties,v  <--  Bundle.properties
new revision: 1.20; previous revision: 1.19
done
Checking in src/org/netbeans/modules/derby/ExecSupport.java;
/cvs/db/derby/src/org/netbeans/modules/derby/ExecSupport.java,v  <--  ExecSupport.java
new revision: 1.5; previous revision: 1.4
done
Checking in src/org/netbeans/modules/derby/RegisterDerby.java;
/cvs/db/derby/src/org/netbeans/modules/derby/RegisterDerby.java,v  <--  RegisterDerby.java
new revision: 1.26; previous revision: 1.25
done
Checking in src/org/netbeans/modules/derby/StartAction.java;
/cvs/db/derby/src/org/netbeans/modules/derby/StartAction.java,v  <--  StartAction.java
new revision: 1.9; previous revision: 1.8
done
Comment 13 Roman Mostyka 2007-09-03 10:21:00 UTC
Verified with build 070903.