1

I'm trying to use Java DB in netbeans but the server doesn't start. I've tried adding

grant {
          permission java.net.SocketPermission "localhost:1527", "listen";
}

but it didn't make any difference. I don't know what causes a problem. I successfully started the server using cmd but I still cannot connect to the database (the window "connecting to database" pops out but nothing happens, I also don't get any output from Java DB Database Proccess) Any help will be very appreciated.

3 Answers 3

2

I have the same problem. I found a workaround. Just change db provided with Java to the one provided with GlassFish:

  1. Make sure you have NetBeans installation with GlassFish (and JavaDB)
  2. Open dialog NetBeans → ProjectManager → Services → Databases → JavaDB(right click) → Properties:

    Original path

  3. My screen is from Linux installation. You probably have something like C:\java\jdk1.8.0_40\db as Java DB Installation.. Change this path to the one from Glassfish. I don't know where it is on Windows, here's mine path:

    Corrected path

This is only workaround, as I don't know why JavaDB server provided by Oracle with Java >= 1.8.0_40 exits immediate after execution. Probably this is some kind of bug.

This may be duplicated issue (Netbeans not starting Java DB Server with JDK 1.8.0_40), but I am not sure.

Sign up to request clarification or add additional context in comments.

1 Comment

This is the strangest thing. I had it working with Glassfish 5.1.0 until yesterday when it suddenly stopped working. I can't figure out why. I've tried removing and re-downloading Glassfish (I've tried Glassfish 5.1.0, Glassfish 3.1.22) but it didn't help. I tried downloading Derby from the Apache website (10.15.2.0) and setting that, still won't start. It gets stuck on "Connecting to Database, please wait..." but it never connects. When I do Java DB -> Start server I see this in the output: pastebin.com/AwUDBxZ2 . And yet it's working fine on a different machine...
0

Try the grant code as:

grant{ 
   permission java.net.SocketPermission "localhost:1527", "listen,resolve"; 
};

Also, read Here (click) about the related bug(fix) in the JDK tool

Comments

0

I had the same problem recently with netbeans 8.2 and JDK 8. I'm writing the solution here for future references.

  • Go to https://db.apache.org/derby/releases/release-10.14.2.0.cgi and download the latest version of derby driver (today is 10.14.2.0).
  • Extract it and place the extracted folder in your %JAVA_HOME%. The result will be something like this: C:\Program Files\Java\jdk1.8.0_92\db-derby-10.14.2.0-bin.
  • Inside netbeans, in the services tab, right click on Java DB > Properties and configure the location of your new derby driver as below.

enter image description here

  • Start again the Java DB server to see it working.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.