Bug 239962 - Cannot connect to Derby DB after NB74 + JDK7u51 bundle
Cannot connect to Derby DB after NB74 + JDK7u51 bundle
Status: RESOLVED WONTFIX
Product: platform
Classification: Unclassified
Component: JDK Problems
7.4
PC All
: P1 (vote)
: TBD
Assigned To: Antonin Nebuzelsky
issues@platform
jdk_bug_8031192
:
: 240504 241792 241941 (view as bug list)
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-01-03 15:34 UTC by Tomas Danek
Modified: 2014-02-19 07:05 UTC (History)
7 users (show)

See Also:
Issue Type: DEFECT
:


Attachments
Proposed Patch - Workaround for NetBeans 8 (5.62 KB, patch)
2014-02-05 09:15 UTC, Jaroslav Havlin
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomas Danek 2014-01-03 15:34:50 UTC
Product Version: NetBeans IDE 7.4 (Build 201310111528)
Updates: NetBeans IDE is updated to version NetBeans 7.4 Patch 2
Java: 1.7.0_51; Java HotSpot(TM) 64-Bit Server VM 24.51-b03
Runtime: Java(TM) SE Runtime Environment 1.7.0_51-b13
System: Mac OS X version 10.9.1 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/7.4
Cache directory: /Users/tomas/Library/Caches/NetBeans/7.4
------------------------------
- services tab, Databases, Derby connection
- try to connect - result is:

Fri Jan 03 16:34:17 CET 2014 : Security manager installed using the Basic server security policy.
Fri Jan 03 16:34:18 CET 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:372)
	at java.security.AccessController.checkPermission(AccessController.java:559)
...
Comment 1 Marian Mirilovic 2014-01-03 16:04:23 UTC
Please investigate, if this is regression in JDK or NB 7.4 bundle with latest JDK we need to fix it.
Comment 2 Libor Fischmeistr 2014-01-06 14:29:33 UTC
I can confirm the regression between JDK 7u45 and 7u51. And also confirm that this bug is problem of JDK. In 7u45 starting of the Java DB works well but on 7u51 the AccessControlException appears.

How to reproduce:

Install JDK 7u51.
Set JAVA_HOME to 7u51.
Run <path to JDK>/db/bin/startNetworkServer (make sure that the db is really launched on 7u51)

It behaves same on Windows, Mac and Linux.
Comment 3 Libor Fischmeistr 2014-01-06 14:52:14 UTC
java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:1527" "listen,resolve")
	at java.security.AccessControlContext.checkPermission(AccessControlContext.java:372)
	at java.security.AccessController.checkPermission(AccessController.java:559)
	at java.lang.SecurityManager.checkPermission(SecurityManager.java:549)
	at java.lang.SecurityManager.checkListen(SecurityManager.java:1134)
	at java.net.ServerSocket.bind(ServerSocket.java:375)
	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)
Comment 4 Antonin Nebuzelsky 2014-01-06 15:13:01 UTC
https://bugs.openjdk.java.net/browse/JDK-8031192
Comment 5 Libor Fischmeistr 2014-01-08 12:55:23 UTC
Workaround described on wiki page: http://wiki.netbeans.org/JavaDB_grant_permissions
Comment 6 Stepan Zebra 2014-01-08 13:10:10 UTC
Just a note - I can see the issue on my 64bit Win7 and Mac machines, but I don't see it on my Windows XP 32 bit machine. I can't view the status of the issue, so I don't know if this is already known.
Comment 7 Libor Fischmeistr 2014-01-16 07:13:21 UTC
*** Bug 240504 has been marked as a duplicate of this bug. ***
Comment 8 Jaroslav Havlin 2014-02-05 09:15:44 UTC
Created attachment 144818 [details]
Proposed Patch - Workaround for NetBeans 8
Comment 9 Jaroslav Havlin 2014-02-05 14:24:02 UTC
(In reply to Jaroslav Havlin from comment #8)
> Created attachment 144818 [details]
> Proposed Patch - Workaround for NetBeans 8
After discussion with Tomas, we chose a better solution.
If the problem is detected in the standard output of the "start derby" process, a notification that offers disabling of the security manager in JavaDB is shown.
(So no checking of JDK version is needed.)

Many thanks to Tomas and Standa for help.

http://hg.netbeans.org/core-main/rev/8af7a7d673bc
Comment 10 Quality Engineering 2014-02-07 02:40:32 UTC
Integrated into 'main-silver', will be available in build *201402070001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/8af7a7d673bc
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #239962: Offer disabling of security manager in JavaDB
Comment 11 Quality Engineering 2014-02-08 04:29:35 UTC
Integrated into 'main-silver', will be available in build *201402080001* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress)

Changeset: http://hg.netbeans.org/main-silver/rev/99714a5112be
User: Jaroslav Havlin <jhavlin@netbeans.org>
Log: #239962: Extend info message
Comment 12 Libor Fischmeistr 2014-02-13 07:50:40 UTC
*** Bug 241792 has been marked as a duplicate of this bug. ***
Comment 13 Libor Fischmeistr 2014-02-19 07:05:46 UTC
*** Bug 241941 has been marked as a duplicate of this bug. ***


By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo