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:
Open dialog NetBeans → ProjectManager → Services → Databases → JavaDB(right click) → Properties:
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.
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.