简体   繁体   中英

netbeans - java db server doesn't start

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.

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:

    原始路径

  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:

    修正路径

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.

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

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.

在此输入图像描述

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM