Re: Self-study tutorial and permissions

2021-08-06 Thread Art O Cathain
Thanks. I created https://issues.apache.org/jira/browse/DERBY-7122

Art

On Sat, 7 Aug 2021 at 01:06, Rick Hillegas  wrote:
>
> You can also hack around this problem by starting the server without a
> security manager (see
> https://db.apache.org/derby/docs/10.15/security/tsecnetservopen.html):
>
>java -jar $DERBY_HOME/lib/derbyrun.jar server start -noSecurityManager
>
> I doubt that the Open JDK team will give this issue much attention,
> given their plan to deprecate the security manager:
> https://openjdk.java.net/jeps/411
>
>
> On 8/6/21 7:52 AM, Rick Hillegas wrote:
> > I agree with Bryan that this looks like a platform-specific Open JDK
> > bug. In your bug report, please include the version numbers for the
> > Derby, Open JDK, and Ubuntu distros which you use to trigger this
> > exception. It would be interesting to know if the bug turns up when
> > you use the latest Open JDK 17 distro.
> >
> > Thanks,
> > -Rick
> >
> > On 8/6/21 7:22 AM, Bryan Pendleton wrote:
> >> That's very interesting! I don't know what it means, but the stack
> >> trace is very explicit and clear and shows us exactly where we are
> >> getting the security exception (which, unfortunately, is deep within
> >> the JDK runtime classes; all we are doing is calling
> >> properties.store() here)
> >>
> >> Could you please report this in the Derby JIRA issue tracker, so we
> >> can collect information about the fix?
> >> https://issues.apache.org/jira/browse/DERBY
> >>
> >> The exact line of code in context is:
> >> https://svn.apache.org/viewvc/db/derby/code/branches/10.15/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java?revision=1850575&view=markup#l369
> >>
> >>
> >> Others have had this exact same problem with JDK 11.
> >>
> >> I suspect it may be JDK11 specific; is there any chance you can try a
> >> different JDK version?
> >>
> >> >From this very helpful web page at Chalmers Institute of Technology
> >> (https://chalmers.instructure.com/courses/8915/pages/f-dot-a-q-common-issues),
> >>
> >> here is a simple workaround:
> >>
> >> The solution is to edit `~/.java.policy` or
> >> `[java.home]/lib/security/java.policy` and add the following:
> >>
> >> grant {
> >>  permission java.lang.RuntimePermission
> >> "getenv.SOURCE_DATE_EPOCH", "read";
> >> };
> >>
> >> Thanks again for helping to make Derby better!
> >>
> >> bryan
> >>
> >> On Thu, Aug 5, 2021 at 5:25 PM Art O Cathain  wrote:
> >>> Hi
> >>>
> >>> Here goes...
> >>>
> >>> Fri Aug 06 10:14:45 AEST 2021 : Apache Derby Network Server -
> >>> 10.15.2.0 - (1873585) started and ready to accept connections on port
> >>> 1527
> >>> 
> >>> Fri Aug 06 10:14:53 AEST 2021:
> >>> Booting Derby version The Apache Software Foundation - Apache Derby -
> >>> 10.15.2.0 - (1873585): instance a816c00e-017b-18cf-ef5d-b7bad466
> >>> on database directory /home/art/src/DERBYTUTOR/seconddb with class
> >>> loader jdk.internal.loader.ClassLoaders$AppClassLoader@277050dc
> >>> Loaded from file:/home/art/src/db-derby-10.15.2.0-bin/lib/derby.jar
> >>> java.vendor=Ubuntu
> >>> user.dir=/home/art/src/DERBYTUTOR
> >>> os.name=Linux
> >>> os.arch=amd64
> >>> os.version=5.11.0-25-lowlatency
> >>> derby.system.home=/home/art/src/DERBYTUTOR
> >>> Database Class Loader started - derby.database.classpath=''
> >>> 
> >>> Fri Aug 06 10:14:54 AEST 2021:
> >>> Shutting down instance a816c00e-017b-18cf-ef5d-b7bad466 on
> >>> database directory /home/art/src/DERBYTUTOR/seconddb with class loader
> >>> jdk.internal.loader.ClassLoaders$AppClassLoader@277050dc
> >>> Fri Aug 06 10:14:54 AEST 2021 Thread[DRDAConnThread_2,5,main] Cleanup
> >>> action starting
> >>> ERROR XBM01: Startup failed due to an exception. See next exception
> >>> for details.
> >>>  at
> >>> org.apache.derby.shared.common.error.StandardException.newException(StandardException.java:300)
> >>>  at
> >>> org.apache.derby.iapi.services.monitor.Monitor.exceptionStartingModule(Monitor.java:743)
> >>>  at
> >>> org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1857)
> >>>  at
> >>> org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(BaseMonitor.java:1022)
> >>>  at
> >>> org.apache.derby.impl.services.monitor.FileMonitor.createPersistentService(FileMonitor.java:48)
> >>>  at
> >>> org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Monitor.java:650)
> >>>  at
> >>> org.apache.derby.impl.jdbc.EmbedConnection$5.run(EmbedConnection.java:4067)
> >>>  at java.base/java.security.AccessController.doPrivileged(Native
> >>> Method)
> >>>  at
> >>> org.apache.derby.impl.jdbc.EmbedConnection.createPersistentService(EmbedConnection.java:4061)
> >>>  at
> >>> org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(EmbedConnection.java:2654)
> >>>  at
> >>> org.apa

Re: Self-study tutorial and permissions

2021-08-06 Thread Rick Hillegas
You can also hack around this problem by starting the server without a 
security manager (see 
https://db.apache.org/derby/docs/10.15/security/tsecnetservopen.html):


  java -jar $DERBY_HOME/lib/derbyrun.jar server start -noSecurityManager

I doubt that the Open JDK team will give this issue much attention, 
given their plan to deprecate the security manager: 
https://openjdk.java.net/jeps/411



On 8/6/21 7:52 AM, Rick Hillegas wrote:
I agree with Bryan that this looks like a platform-specific Open JDK 
bug. In your bug report, please include the version numbers for the 
Derby, Open JDK, and Ubuntu distros which you use to trigger this 
exception. It would be interesting to know if the bug turns up when 
you use the latest Open JDK 17 distro.


Thanks,
-Rick

On 8/6/21 7:22 AM, Bryan Pendleton wrote:

That's very interesting! I don't know what it means, but the stack
trace is very explicit and clear and shows us exactly where we are
getting the security exception (which, unfortunately, is deep within
the JDK runtime classes; all we are doing is calling
properties.store() here)

Could you please report this in the Derby JIRA issue tracker, so we
can collect information about the fix?
https://issues.apache.org/jira/browse/DERBY

The exact line of code in context is:
https://svn.apache.org/viewvc/db/derby/code/branches/10.15/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java?revision=1850575&view=markup#l369 



Others have had this exact same problem with JDK 11.

I suspect it may be JDK11 specific; is there any chance you can try a
different JDK version?

>From this very helpful web page at Chalmers Institute of Technology
(https://chalmers.instructure.com/courses/8915/pages/f-dot-a-q-common-issues), 


here is a simple workaround:

The solution is to edit `~/.java.policy` or
`[java.home]/lib/security/java.policy` and add the following:

grant {
 permission java.lang.RuntimePermission 
"getenv.SOURCE_DATE_EPOCH", "read";

};

Thanks again for helping to make Derby better!

bryan

On Thu, Aug 5, 2021 at 5:25 PM Art O Cathain  wrote:

Hi

Here goes...

Fri Aug 06 10:14:45 AEST 2021 : Apache Derby Network Server -
10.15.2.0 - (1873585) started and ready to accept connections on port
1527

Fri Aug 06 10:14:53 AEST 2021:
Booting Derby version The Apache Software Foundation - Apache Derby -
10.15.2.0 - (1873585): instance a816c00e-017b-18cf-ef5d-b7bad466
on database directory /home/art/src/DERBYTUTOR/seconddb with class
loader jdk.internal.loader.ClassLoaders$AppClassLoader@277050dc
Loaded from file:/home/art/src/db-derby-10.15.2.0-bin/lib/derby.jar
java.vendor=Ubuntu
user.dir=/home/art/src/DERBYTUTOR
os.name=Linux
os.arch=amd64
os.version=5.11.0-25-lowlatency
derby.system.home=/home/art/src/DERBYTUTOR
Database Class Loader started - derby.database.classpath=''

Fri Aug 06 10:14:54 AEST 2021:
Shutting down instance a816c00e-017b-18cf-ef5d-b7bad466 on
database directory /home/art/src/DERBYTUTOR/seconddb with class loader
jdk.internal.loader.ClassLoaders$AppClassLoader@277050dc
Fri Aug 06 10:14:54 AEST 2021 Thread[DRDAConnThread_2,5,main] Cleanup
action starting
ERROR XBM01: Startup failed due to an exception. See next exception 
for details.
 at 
org.apache.derby.shared.common.error.StandardException.newException(StandardException.java:300)
 at 
org.apache.derby.iapi.services.monitor.Monitor.exceptionStartingModule(Monitor.java:743)
 at 
org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1857)
 at 
org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(BaseMonitor.java:1022)
 at 
org.apache.derby.impl.services.monitor.FileMonitor.createPersistentService(FileMonitor.java:48)
 at 
org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Monitor.java:650)
 at 
org.apache.derby.impl.jdbc.EmbedConnection$5.run(EmbedConnection.java:4067)
 at java.base/java.security.AccessController.doPrivileged(Native 
Method)
 at 
org.apache.derby.impl.jdbc.EmbedConnection.createPersistentService(EmbedConnection.java:4061)
 at 
org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(EmbedConnection.java:2654)
 at 
org.apache.derby.impl.jdbc.EmbedConnection.(EmbedConnection.java:435)
 at 
org.apache.derby.iapi.jdbc.InternalDriver$1.run(InternalDriver.java:660) 

 at 
org.apache.derby.iapi.jdbc.InternalDriver$1.run(InternalDriver.java:656) 

 at java.base/java.security.AccessController.doPrivileged(Native 
Method)
 at 
org.apache.derby.iapi.jdbc.InternalDriver.getNewEmbedConnection(InternalDriver.java:654)
 at 
org.apache.derby.iapi.jdbc.InternalDriver.connect(InternalDriver.java:300)
 at 
org.apache.derby.iapi.jdbc.InternalDriver.connect(InternalDriver.java:967)
 at 
org.apache.derby.jdbc.EmbeddedDriver.connect(Embedded

Re: Self-study tutorial and permissions

2021-08-06 Thread Rick Hillegas
I agree with Bryan that this looks like a platform-specific Open JDK 
bug. In your bug report, please include the version numbers for the 
Derby, Open JDK, and Ubuntu distros which you use to trigger this 
exception. It would be interesting to know if the bug turns up when you 
use the latest Open JDK 17 distro.


Thanks,
-Rick

On 8/6/21 7:22 AM, Bryan Pendleton wrote:

That's very interesting! I don't know what it means, but the stack
trace is very explicit and clear and shows us exactly where we are
getting the security exception (which, unfortunately, is deep within
the JDK runtime classes; all we are doing is calling
properties.store() here)

Could you please report this in the Derby JIRA issue tracker, so we
can collect information about the fix?
https://issues.apache.org/jira/browse/DERBY

The exact line of code in context is:
https://svn.apache.org/viewvc/db/derby/code/branches/10.15/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java?revision=1850575&view=markup#l369

Others have had this exact same problem with JDK 11.

I suspect it may be JDK11 specific; is there any chance you can try a
different JDK version?

>From this very helpful web page at Chalmers Institute of Technology
(https://chalmers.instructure.com/courses/8915/pages/f-dot-a-q-common-issues),
here is a simple workaround:

The solution is to edit `~/.java.policy` or
`[java.home]/lib/security/java.policy` and add the following:

grant {
 permission java.lang.RuntimePermission "getenv.SOURCE_DATE_EPOCH", "read";
};

Thanks again for helping to make Derby better!

bryan

On Thu, Aug 5, 2021 at 5:25 PM Art O Cathain  wrote:

Hi

Here goes...

Fri Aug 06 10:14:45 AEST 2021 : Apache Derby Network Server -
10.15.2.0 - (1873585) started and ready to accept connections on port
1527

Fri Aug 06 10:14:53 AEST 2021:
Booting Derby version The Apache Software Foundation - Apache Derby -
10.15.2.0 - (1873585): instance a816c00e-017b-18cf-ef5d-b7bad466
on database directory /home/art/src/DERBYTUTOR/seconddb with class
loader jdk.internal.loader.ClassLoaders$AppClassLoader@277050dc
Loaded from file:/home/art/src/db-derby-10.15.2.0-bin/lib/derby.jar
java.vendor=Ubuntu
user.dir=/home/art/src/DERBYTUTOR
os.name=Linux
os.arch=amd64
os.version=5.11.0-25-lowlatency
derby.system.home=/home/art/src/DERBYTUTOR
Database Class Loader started - derby.database.classpath=''

Fri Aug 06 10:14:54 AEST 2021:
Shutting down instance a816c00e-017b-18cf-ef5d-b7bad466 on
database directory /home/art/src/DERBYTUTOR/seconddb with class loader
jdk.internal.loader.ClassLoaders$AppClassLoader@277050dc
Fri Aug 06 10:14:54 AEST 2021 Thread[DRDAConnThread_2,5,main] Cleanup
action starting
ERROR XBM01: Startup failed due to an exception. See next exception for details.
 at 
org.apache.derby.shared.common.error.StandardException.newException(StandardException.java:300)
 at 
org.apache.derby.iapi.services.monitor.Monitor.exceptionStartingModule(Monitor.java:743)
 at 
org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1857)
 at 
org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(BaseMonitor.java:1022)
 at 
org.apache.derby.impl.services.monitor.FileMonitor.createPersistentService(FileMonitor.java:48)
 at 
org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Monitor.java:650)
 at 
org.apache.derby.impl.jdbc.EmbedConnection$5.run(EmbedConnection.java:4067)
 at java.base/java.security.AccessController.doPrivileged(Native Method)
 at 
org.apache.derby.impl.jdbc.EmbedConnection.createPersistentService(EmbedConnection.java:4061)
 at 
org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(EmbedConnection.java:2654)
 at 
org.apache.derby.impl.jdbc.EmbedConnection.(EmbedConnection.java:435)
 at org.apache.derby.iapi.jdbc.InternalDriver$1.run(InternalDriver.java:660)
 at org.apache.derby.iapi.jdbc.InternalDriver$1.run(InternalDriver.java:656)
 at java.base/java.security.AccessController.doPrivileged(Native Method)
 at 
org.apache.derby.iapi.jdbc.InternalDriver.getNewEmbedConnection(InternalDriver.java:654)
 at 
org.apache.derby.iapi.jdbc.InternalDriver.connect(InternalDriver.java:300)
 at 
org.apache.derby.iapi.jdbc.InternalDriver.connect(InternalDriver.java:967)
 at org.apache.derby.jdbc.EmbeddedDriver.connect(EmbeddedDriver.java:125)
 at org.apache.derby.impl.drda.Database.makeConnection(Database.java:253)
 at 
org.apache.derby.impl.drda.DRDAConnThread.getConnFromDatabaseName(DRDAConnThread.java:1476)
 at 
org.apache.derby.impl.drda.DRDAConnThread.verifyUserIdPassword(DRDAConnThread.java:1426)
 at 
org.apache.derby.impl.drda.DRDAConnThread.parseSECCHK(DRDAConnThread.java:3380)
 at 
org.apache.derby.impl.drda.DRDAConnThread.parseDRDAConnection(DRDAC

Re: Self-study tutorial and permissions

2021-08-06 Thread Bryan Pendleton
That's very interesting! I don't know what it means, but the stack
trace is very explicit and clear and shows us exactly where we are
getting the security exception (which, unfortunately, is deep within
the JDK runtime classes; all we are doing is calling
properties.store() here)

Could you please report this in the Derby JIRA issue tracker, so we
can collect information about the fix?
https://issues.apache.org/jira/browse/DERBY

The exact line of code in context is:
https://svn.apache.org/viewvc/db/derby/code/branches/10.15/java/org.apache.derby.engine/org/apache/derby/impl/services/monitor/StorageFactoryService.java?revision=1850575&view=markup#l369

Others have had this exact same problem with JDK 11.

I suspect it may be JDK11 specific; is there any chance you can try a
different JDK version?

>From this very helpful web page at Chalmers Institute of Technology
(https://chalmers.instructure.com/courses/8915/pages/f-dot-a-q-common-issues),
here is a simple workaround:

The solution is to edit `~/.java.policy` or
`[java.home]/lib/security/java.policy` and add the following:

grant {
permission java.lang.RuntimePermission "getenv.SOURCE_DATE_EPOCH", "read";
};

Thanks again for helping to make Derby better!

bryan

On Thu, Aug 5, 2021 at 5:25 PM Art O Cathain  wrote:
>
> Hi
>
> Here goes...
>
> Fri Aug 06 10:14:45 AEST 2021 : Apache Derby Network Server -
> 10.15.2.0 - (1873585) started and ready to accept connections on port
> 1527
> 
> Fri Aug 06 10:14:53 AEST 2021:
> Booting Derby version The Apache Software Foundation - Apache Derby -
> 10.15.2.0 - (1873585): instance a816c00e-017b-18cf-ef5d-b7bad466
> on database directory /home/art/src/DERBYTUTOR/seconddb with class
> loader jdk.internal.loader.ClassLoaders$AppClassLoader@277050dc
> Loaded from file:/home/art/src/db-derby-10.15.2.0-bin/lib/derby.jar
> java.vendor=Ubuntu
> user.dir=/home/art/src/DERBYTUTOR
> os.name=Linux
> os.arch=amd64
> os.version=5.11.0-25-lowlatency
> derby.system.home=/home/art/src/DERBYTUTOR
> Database Class Loader started - derby.database.classpath=''
> 
> Fri Aug 06 10:14:54 AEST 2021:
> Shutting down instance a816c00e-017b-18cf-ef5d-b7bad466 on
> database directory /home/art/src/DERBYTUTOR/seconddb with class loader
> jdk.internal.loader.ClassLoaders$AppClassLoader@277050dc
> Fri Aug 06 10:14:54 AEST 2021 Thread[DRDAConnThread_2,5,main] Cleanup
> action starting
> ERROR XBM01: Startup failed due to an exception. See next exception for 
> details.
> at 
> org.apache.derby.shared.common.error.StandardException.newException(StandardException.java:300)
> at 
> org.apache.derby.iapi.services.monitor.Monitor.exceptionStartingModule(Monitor.java:743)
> at 
> org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1857)
> at 
> org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(BaseMonitor.java:1022)
> at 
> org.apache.derby.impl.services.monitor.FileMonitor.createPersistentService(FileMonitor.java:48)
> at 
> org.apache.derby.iapi.services.monitor.Monitor.createPersistentService(Monitor.java:650)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection$5.run(EmbedConnection.java:4067)
> at java.base/java.security.AccessController.doPrivileged(Native Method)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection.createPersistentService(EmbedConnection.java:4061)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(EmbedConnection.java:2654)
> at 
> org.apache.derby.impl.jdbc.EmbedConnection.(EmbedConnection.java:435)
> at 
> org.apache.derby.iapi.jdbc.InternalDriver$1.run(InternalDriver.java:660)
> at 
> org.apache.derby.iapi.jdbc.InternalDriver$1.run(InternalDriver.java:656)
> at java.base/java.security.AccessController.doPrivileged(Native Method)
> at 
> org.apache.derby.iapi.jdbc.InternalDriver.getNewEmbedConnection(InternalDriver.java:654)
> at 
> org.apache.derby.iapi.jdbc.InternalDriver.connect(InternalDriver.java:300)
> at 
> org.apache.derby.iapi.jdbc.InternalDriver.connect(InternalDriver.java:967)
> at org.apache.derby.jdbc.EmbeddedDriver.connect(EmbeddedDriver.java:125)
> at org.apache.derby.impl.drda.Database.makeConnection(Database.java:253)
> at 
> org.apache.derby.impl.drda.DRDAConnThread.getConnFromDatabaseName(DRDAConnThread.java:1476)
> at 
> org.apache.derby.impl.drda.DRDAConnThread.verifyUserIdPassword(DRDAConnThread.java:1426)
> at 
> org.apache.derby.impl.drda.DRDAConnThread.parseSECCHK(DRDAConnThread.java:3380)
> at 
> org.apache.derby.impl.drda.DRDAConnThread.parseDRDAConnection(DRDAConnThread.java:1210)
> at 
> org.apache.derby.impl.drda.DRDAConnThread.processCommands(DRDAConnThread.java:1010)
> at org.apache.derby.impl.drda.DRDAConnThread.run(DRDAConnThread.java:300)
> Caused by: java.security.AccessControlException: acce