JavaDB / derbyDB: access denied (“java.net.SocketPermission” “localhost:1527” “listen,resolve”)

Since java update 7u51 there are “better applet networking” changes.
So derbydb will not work in Netbeans 7.4 anymore out of the box.
You have to change the security policy of derbydb.

In MacOS open the terminal:

cd /Library/Java/JavaVirtualMachines/jdk1.7.0_51.jdk/Contents/Home/jre/lib/security

In Linux/Win you will have to change the path.

Make a backup of the policy-file:

sudo cp java.policy java.policy.backup

Edit the policy-file:

sudo nano java.policy

Add to the main permission section the following statement:

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

SocketPermission

Thank you to Wolfgang Mayr for hinting me.

Sources:
Update Release Notes
unable-to-start-derby-database-from-netbeans-7-4

This entry was posted in Derby DB. Bookmark the permalink.

6 Responses to JavaDB / derbyDB: access denied (“java.net.SocketPermission” “localhost:1527” “listen,resolve”)

  1. AlexP says:

    Awesome, worked like a charm, my path under CentOS Linux:
    /usr/java/latest/jre/lib/security

    Thanks!

  2. Andreas says:

    Path for Xubuntu/Ubuntu: /usr/lib/jvm/…

  3. Ever says:

    You are the best

  4. misael says:

    I had tried to solve this problem for about 3 hours you are like a machine my friend

  5. Mourad Yahia says:

    Thank you very much ! This is really clean and awesome tutorial 😀

  6. ahmed says:

    i do that but the same probleme

Leave a comment