[ 
https://issues.apache.org/jira/browse/DERBY-7122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17395378#comment-17395378
 ] 

Richard N. Hillegas commented on DERBY-7122:
--------------------------------------------

Attaching DERBY_7122.java. This program demonstrates that the problem has 
nothing to do with Derby per se. It shows that Properties.store() fails under a 
SecurityManager when you use the Linux distro for Open JDK 16--and, given Art's 
experience, probably on all Linux JVMs from Open JDK 11 onward.

This program runs cleanly for me on Mac OSX. But it fails on Open JDK 
16.0.1+9-Ubuntu-120.04 on Ubuntu 20.04.2.0. I get the following stack trace:

{noformat}
Exception in thread "main" java.security.AccessControlException: access denied 
("java.lang.RuntimePermission" "getenv.SOURCE_DATE_EPOCH")
        at 
java.base/java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
        at 
java.base/java.security.AccessController.checkPermission(AccessController.java:1036)
        at 
java.base/java.lang.SecurityManager.checkPermission(SecurityManager.java:408)
        at java.base/java.lang.System.getenv(System.java:1016)
        at 
java.base/java.util.Properties.getFormattedTimestamp(Properties.java:1599)
        at java.base/java.util.Properties.store0(Properties.java:926)
        at java.base/java.util.Properties.store(Properties.java:868)
        at DERBY_7122.main(DERBY_7122.java:37)
{noformat}

I will log a bug against the Open JDK and report back on what the experts have 
to say about this.


> java.security.AccessControlException when creating a DB remotely: Permission 
> getenv.SOURCE_DATE_EPOCH
> -----------------------------------------------------------------------------------------------------
>
>                 Key: DERBY-7122
>                 URL: https://issues.apache.org/jira/browse/DERBY-7122
>             Project: Derby
>          Issue Type: Bug
>          Components: Store
>    Affects Versions: 10.14.2.0, 10.15.2.0
>            Reporter: Art O Cathain
>            Priority: Major
>         Attachments: DERBY_7122.java, derby.log
>
>
> Following the tutorial at 
> [https://db.apache.org/derby/docs/10.15/getstart/twwdactivity2.html] I get an 
> AccessControlException in the server log when trying to create a DB (via 
> CONNECT 'jdbc:derby://localhost:1527/seconddb;create=true')
> This is with derby 10.15.2.0 but the same is observed in 10.14
> OS version: Ubuntu 21.04
> Java version:
> openjdk version "11.0.11" 2021-04-20
> OpenJDK Runtime Environment (build 11.0.11+9-Ubuntu-0ubuntu2)
> OpenJDK 64-Bit Server VM (build 11.0.11+9-Ubuntu-0ubuntu2, mixed mode)
> but OpenJDK 16 and 17(early access) have the same problem



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to