Kick Buttowski
Kick Buttowski

Reputation: 6739

Cannot Start Java DB in Netbeans 8

when I want to start Java DB in netbeans 8, Java DB does not start, and it gives me following errors.

Sun Jun 01 21:34:53 PDT 2014 : Security manager installed using the Basic server security policy.
Sun Jun 01 21:34:53 PDT 2014 : access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")
java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")
    at java.security.AccessControlContext.checkPermission(AccessControlContext.java:457)
    at java.security.AccessController.checkPermission(AccessController.java:884)
    at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
    at java.lang.SecurityManager.checkListen(SecurityManager.java:1131)
    at java.net.ServerSocket.bind(ServerSocket.java:374)
    at java.net.ServerSocket.<init>(ServerSocket.java:237)
    at javax.net.DefaultServerSocketFactory.createServerSocket(ServerSocketFactory.java:231)
    at org.apache.derby.impl.drda.NetworkServerControlImpl.createServerSocket(Unknown Source)
    at org.apache.derby.impl.drda.NetworkServerControlImpl.access$000(Unknown Source)
    at org.apache.derby.impl.drda.NetworkServerControlImpl$1.run(Unknown Source)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.apache.derby.impl.drda.NetworkServerControlImpl.blockingStart(Unknown Source)
    at org.apache.derby.impl.drda.NetworkServerControlImpl.executeWork(Unknown Source)
    at org.apache.derby.drda.NetworkServerControl.main(Unknown Source)

my dependencies section pom.xml fiel

<dependencies>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-web-api</artifactId>
            <version>6.0</version>
            <scope>provided</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derbyclient</artifactId>
            <version>10.10.2.0</version>
        </dependency>
        <dependency>
            <groupId>org.apache.derby</groupId>
            <artifactId>derbynet</artifactId>
            <version>10.10.2.0</version>
        </dependency>
    </dependencies>

Is anyone know how I can resolve this issue? if more info is needed, I will provide.

Note: I try to write jsp project by using maven in netbeans 8. First page will ask for name and email address and second page will add these info to the database via dreby client and show the result.Nevertheless, I bump into this problem.

Upvotes: 0

Views: 1578

Answers (1)

npinti
npinti

Reputation: 52185

According to this link, the easiest solution would be to start the Java DB with -noSecurityManager argument.

A more comprehensive walk around is to follow the instructions made available on Oracle's Site (Under Bug **8030961**).

EDIT: This is what you should do. These steps assume that you have a Derby Database instance running on your machine and listening on Port 1527.

  1. Open command prompt and navigate (using the cd command to you Java installation. In my case, it is in C:\Program Files\Java\jdk1.8.0\db\bin. If you cannot find it there, you might want to check your environment variables.

  2. Once you manage to get in that directory, type in stopNetworkServer to stop the server, and then, once that command finishes, type startNetworkServer -noSecurityManager.

Once that the server restarts, you should be ready to go.

Upvotes: 1

Related Questions