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 252715 - Cannot start Java DB server in order to connect to database
Summary: Cannot start Java DB server in order to connect to database
Status: VERIFIED FIXED
Alias: None
Product: db
Classification: Unclassified
Component: Derby (show other bugs)
Version: 8.1
Hardware: PC Windows 10 x64
: P2 normal (vote)
Assignee: matthias42
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-06-01 06:37 UTC by Jiri Kovalsky
Modified: 2016-03-13 18:03 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Full thread dump taken during never ending waiting for Java DB server to start. (22.94 KB, application/octet-stream)
2015-06-01 06:37 UTC, Jiri Kovalsky
Details
Video showing the never ending loop of attempts to start Java DB server. (3.08 MB, video/ogg)
2015-06-01 06:40 UTC, Jiri Kovalsky
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Jiri Kovalsky 2015-06-01 06:37:53 UTC
Created attachment 153982 [details]
Full thread dump taken during never ending waiting for Java DB server to start.

Product Version: NetBeans IDE Dev (Build 201505310001)
Java: 1.8.0_45; Java HotSpot(TM) 64-Bit Server VM 25.45-b02
Runtime: Java(TM) SE Runtime Environment 1.8.0_45-b14
System: Linux version 3.13.0-37-generic running on amd64; UTF-8; cs_CZ (nb)
User directory: /home/cesilko/.netbeans/dev
Cache directory: /home/cesilko/.cache/netbeans/dev

Description:
============
User can't connect to JDBC database, because Java DB server fails to start. When user's patience is gone, it even can't be cancelled. I am attaching full thread dump and video showing the problem.

Steps to reproduce:
===================
1. Launch NetBeans, switch to "Services" explorer and expand "Databases" node.
2. Right click "jdbc:derby://localhost..." node and invoke "Connect..." action from its popup menu.

Expected: "Connecting to Database" dialog shows up and after a while it disappears with "jdbc:derby://localhost..." database being connected.
Actual: "Connecting to Database" dialog shows up and never disappears. Status bar never ending "Starting the Java DB Server" task.

3. Close the "Connecting to Database" dialog.
4. Right click the "Starting the Java DB Server" task in status bar and invoke "Show Processes" action from its popup menu.
5. Right click the "Starting the Java DB Server" process and invoke "Cancel Process" action from its popup menu.
6. "Cancel Running Task" confirmation dialog shows up. Click "Yes" button.

Expected: Another "Java DB Database" confirmation dialog shows up with question "The Java DB server did not start in 30 seconds. Do you want to wait another 30 seconds?"
Actual: Another "Java DB Database" confirmation dialog shows up with question "The Java DB server did not start in 0 seconds. Do you want to wait another 0 seconds?"

7. Click "Yes" button.
8. After a while repeat step 4 and 5.

Expected: "Cancel Running Task" confirmation dialog shows up allowing you to click either "Yes" or "No".
Actual: Nothing happens and you must only close the NetBeans IDE.
Comment 1 Jiri Kovalsky 2015-06-01 06:40:15 UTC
Created attachment 153983 [details]
Video showing the never ending loop of attempts to start Java DB server.
Comment 2 matthias42 2015-06-04 19:39:21 UTC
Thank you for your report. I was not able to reproduce a "real" problem, so I improvised by using a fake java binary, that is basicly a "sleep 600". With that I reproduced the problem. 

The implemented change:

- suppresses the "Wait for another X seconds" dialog if wait time is set to 0 (wait for ever)
- suppresses the dialog if the process was terminated by "Cancel Task"
- If the startup fails terminate the startup process

The fix was pushed as:

http://hg.netbeans.org/core-main/rev/908ce2dbd8dd

It would be nice if found out why javadb did not come up. Thank you!
Comment 3 Quality Engineering 2015-06-06 07:16:57 UTC
Integrated into 'main-silver', will be available in build *201506060001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/908ce2dbd8dd
User: Matthias Blaesing <matthias42@netbeans.org>
Log: #252715: Terminate starter for javadb if starting failes and don't show "Failed to start in X. Want to wait further X seconds?" if starting javadb was canceled
Comment 4 Jiri Kovalsky 2015-06-08 09:48:01 UTC
I wanted to verify this bug fix but in today's build [1] I cannot see the "jdbc:derby://localhost..." node. Do you happen to know why it does not show up?

[1] Product Version: NetBeans IDE Dev (Build 201506080001)
Java: 1.7.0_76; Java HotSpot(TM) 64-Bit Server VM 24.76-b04
Runtime: Java(TM) SE Runtime Environment 1.7.0_76-b13
System: Linux version 3.13.0-37-generic running on amd64; UTF-8; cs_CZ (nb)
Comment 5 Jiri Kovalsky 2015-06-08 11:49:45 UTC
I gave it another try with a clean userdir and now everything works like a charm. Verifying, thanks for the fix.
Comment 6 matthias42 2015-06-08 17:16:43 UTC
(In reply to Jiri Kovalsky from comment #5)
> I gave it another try with a clean userdir and now everything works like a
> charm. Verifying, thanks for the fix.

Thanks for rechecking :-) I remember last time I tracked such a problem bisecting took me a few hours.
Comment 7 tejeskv 2016-03-12 22:40:47 UTC
I have just encountered the same exact bug today with the 8.1 build on Windows 10 64bit. I didn't bother providing more information because they are the same as demonstrated on the attached video. This is the only post I found regarding this exact issue and the provided fix does not work! Even after numerous clean installs and a lot of trial and error nothing seems to work.
Comment 8 matthias42 2016-03-13 10:15:02 UTC
Please verify that you really saw the same errors. If not: What was different?
Comment 9 tejeskv 2016-03-13 12:27:58 UTC
I do have the same errors. I want to create a simple database but in order to do so my understanding is to Right click on the Java DB under the Services tab and click Start server. Now when I do this the Output tab shows up but those 2 lines that confirms that the server is started doesn't show up and I can click on the Start server again. If I try to connect to derby it just starts that tedious process that the video demonstrates. By the way I have just reinstalled my operating system but did not solve the issue.
Comment 10 matthias42 2016-03-13 15:38:05 UTC
Please check the comments in this bug (starting from 7):

https://netbeans.org/bugzilla/show_bug.cgi?id=257948#c7

This sounds _very_ similar: No output, javadb does not start.
Comment 11 tejeskv 2016-03-13 16:46:21 UTC
Yes it is so far exactly the same issue. I have done what you have suggested jsvelta to do and just like him when I set "DERBY_OPTS=-Duser.language=en" this along with your lines it finally starts in command prompt. But what do I do afterwards? In netbeans it is still the same like nothing has changed. What am I missing here?
Comment 12 matthias42 2016-03-13 17:27:35 UTC
(In reply to tejeskv from comment #11)
> Yes it is so far exactly the same issue. I have done what you have suggested
> jsvelta to do and just like him when I set "DERBY_OPTS=-Duser.language=en"
> this along with your lines it finally starts in command prompt. But what do
> I do afterwards? In netbeans it is still the same like nothing has changed.
> What am I missing here?

Well - you could try an older derby release, I don't know when the regression in derby was introduced and which version was pulled into the JDK as JavaDB:

https://db.apache.org/derby/

I'm reclosing this bug at this point.
Comment 13 matthias42 2016-03-13 17:27:56 UTC
And resetting to VERIFIED ...
Comment 14 tejeskv 2016-03-13 17:38:52 UTC
Thank you for the help, although I'm still at 0 but at least it is VERIFIED ...
Comment 15 matthias42 2016-03-13 17:46:42 UTC
(In reply to tejeskv from comment #14)
> Thank you for the help, although I'm still at 0 but at least it is VERIFIED
> ...

What did you expect? This bug was not your problem, you hijacked it - I took time to help you (no I'm not paid to do that).

I pointed you to the right bug and there the resolution is, that the bug lies outside the netbeans scope. The fix could be to use an older derby release (JavaDB is derby relabeled and integrated into the JDK), that does not show this bug.
Comment 16 tejeskv 2016-03-13 18:03:11 UTC
(In reply to matthias42 from comment #15)
> (In reply to tejeskv from comment #14)
> > Thank you for the help, although I'm still at 0 but at least it is VERIFIED
> > ...
> 
> What did you expect? This bug was not your problem, you hijacked it - I took
> time to help you (no I'm not paid to do that).
> 
> I pointed you to the right bug and there the resolution is, that the bug
> lies outside the netbeans scope. The fix could be to use an older derby
> release (JavaDB is derby relabeled and integrated into the JDK), that does
> not show this bug.

What do you mean it was not my problem? That I hijacked it?

Also it still eludes me how do these two problems differ... Only difference is that with this bug a clean userdir solved the issue which is not working for me and with the other bug was just simply closed not sure if the guys problem has been fixed since he hasn't verified it or anything. 

It might just be me being stupid since I'm not getting the picture here. How does the problem lies outside the netbeans scope when all I did was to confirm that I can manually start the server yet netbeans still can't.

I do appreciate the time it took you to remember that there was an other problem such as this. I am grateful trust me.