Return-Path: X-Original-To: apmail-db-derby-dev-archive@www.apache.org Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 6F372184B7 for ; Sat, 19 Dec 2015 15:34:36 +0000 (UTC) Received: (qmail 7023 invoked by uid 500); 19 Dec 2015 15:34:36 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 6992 invoked by uid 500); 19 Dec 2015 15:34:36 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 6982 invoked by uid 99); 19 Dec 2015 15:34:36 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 19 Dec 2015 15:34:36 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 8DA511A1469 for ; Sat, 19 Dec 2015 15:34:35 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.898 X-Spam-Level: ** X-Spam-Status: No, score=2.898 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, RCVD_IN_MSPIKE_H2=-0.001, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id KuyLDbDlDnDQ for ; Sat, 19 Dec 2015 15:34:32 +0000 (UTC) Received: from mail-pf0-f177.google.com (mail-pf0-f177.google.com [209.85.192.177]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 69C3A42A6A for ; Sat, 19 Dec 2015 15:34:32 +0000 (UTC) Received: by mail-pf0-f177.google.com with SMTP id o64so64580297pfb.3 for ; Sat, 19 Dec 2015 07:34:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type; bh=455tllMJNRzak5D4lagYjBYvqgoMy7SL5XSTg5BXjJI=; b=ybegA5y30m5TTHx6jtQGDnBx0O9KcEnhBCSMRHHYPAerJBuMuPVpXZtQjWQWjap58T A8lMOHLDOmzRnfu9+uLL44y+0pYz0ghAYIBHMNLMpxR/W1/K9yWsw2SNYblxti+Iccaz QBQeUYe3dVkFKw5iV8NCjWxDQiKdkBSyFvNtWiqw7tyyu/Be5OKq+2fmgoBf0d7CPfZO wBa7scE7KdTbAWbUuRkb5LgrbUChFzhG7KJSQfU4LtiZjkqehDE4r5hHizduLLQ+Qdrh iiPxYufbNaU9ZfqQbW8fOHX6OwMBlvWVHGxGYZR016HNvkS3dl9jv7pzbf8trJZYvlN4 cgFg== X-Received: by 10.98.70.29 with SMTP id t29mr14113516pfa.38.1450539266414; Sat, 19 Dec 2015 07:34:26 -0800 (PST) Received: from Richards-MacBook-Pro-2.local (c-98-207-92-179.hsd1.ca.comcast.net. [98.207.92.179]) by smtp.gmail.com with ESMTPSA id q66sm17929726pfi.13.2015.12.19.07.34.25 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 19 Dec 2015 07:34:25 -0800 (PST) Message-ID: <567578FF.2020306@gmail.com> Date: Sat, 19 Dec 2015 07:34:23 -0800 From: Rick Hillegas User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.7; en-US; rv:1.9.2.18) Gecko/20110616 Thunderbird/3.1.11 MIME-Version: 1.0 To: derby-dev@db.apache.org CC: Colm McHugh Subject: Re: Exception running RunOptimizerTest References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------030205020700000405070907" This is a multi-part message in MIME format. --------------030205020700000405070907 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Hi Colm, I agree with Bryan that it appears that this test has not been run since we introduced the BOOLEAN datatype five years ago in release 10.7.1.1. And I agree with Mike that the real problem seems to be that the correct Java security permissions haven't been granted to the Derby engine. The test doesn't appear to be designed to be run under a Java Security Manager. I say this because there is no doPrivileged block wrapping the check for the existence of the database directory at line 69. Here's a theory about what's going on: 1) The test itself is running on a client-side VM which is not governed by a SecurityManager. 2) But the IDE is running the engine in a separate server VM under a SecurityManager. 3) The server-side security policy is missing a permission. It may be that your IDE hasn't been adjusted to account for the new permission which must be granted to derby.jar when you use Derby 10.12.1.1: permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals"; Hope this helps, -Rick On 12/16/15 12:03 PM, Colm McHugh wrote: > Hi Derby devs, > > I am getting the exception below when running RunOptimizerTest (in > org.apache.derbyTesting.system.optimizer). My goal is to step through > the query compilation code to understand how it works. I am using Java > 1.8. I am using netbeans 8.0.1 and the class path includes > derbyrun.jar and derbyTesting.jar. Any help appreciated. > > run: > Running test with url jdbc:derby:testdb;create=true > Initializing db ... > SQL Exception :java.sql.SQLException: XJ041.C : [0] testdb > java.sql.SQLException: XJ041.C : [0] testdb > at > org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:115) > at > org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:141) > at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:255) > at > org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(EmbedConnection.java:2656) > at > org.apache.derby.impl.jdbc.EmbedConnection.(EmbedConnection.java:435) > at org.apache.derby.jdbc.InternalDriver$1.run(InternalDriver.java:663) > at org.apache.derby.jdbc.InternalDriver$1.run( > InternalDriver.java:659) > > ========================= R E S U L T S ========================= > at java.security.AccessController.doPrivileged(Native Method) > > at > org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(InternalDriver.java:657) > at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:306) > at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:963) > at > org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:147) > at java.sql.DriverManager.getConnection(DriverManager.java:664) > at java.sql.DriverManager.getConnection(DriverManager.java:270) > at > org.apache.derbyTesting.system.optimizer.RunOptimizerTest.main(RunOptimizerTest.java:94) > Caused by: ERROR XJ041: XJ041.C : [0] testdb > at > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290) > at > org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:170) > at > org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:75) > ... 14 more > Caused by: ERROR XBM01: XBM01.D > at > org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290) > at > org.apache.derby.iapi.services.monitor.Monitor.exceptionStartingModule(Monitor.java:743) > at > org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1841) > at > org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(BaseMonitor.java:1006) > 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:4062) > at java.security.AccessController.doPrivileged(Native Method) > at > org.apache.derby.impl.jdbc.EmbedConnection.createPersistentService(EmbedConnection.java:4056) > at > org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(EmbedConnection.java:2649) > ... 11 more > Caused by: java.lang.NullPointerException > at > org.apache.derby.impl.store.raw.log.LogToFile.writeControlFile(LogToFile.java:2411) > at org.apache.derby.impl.store.raw.log.LogToFile.boot(LogToFile.java:3383) > at > org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1986) > at > org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334) > at > org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:537) > at > org.apache.derby.impl.services.monitor.FileMonitor.startModule(FileMonitor.java:48) > at > org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:460) > at > org.apache.derby.impl.store.raw.data.BaseDataFileFactory$10.run(BaseDataFileFactory.java:3058) > at java.security.AccessController.doPrivileged(Native Method) > at > org.apache.derby.impl.store.raw.data.BaseDataFileFactory.bootServiceModule(BaseDataFileFactory.java:3052) > at > org.apache.derby.impl.store.raw.data.BaseDataFileFactory.bootLogFactory(BaseDataFileFactory.java:1811) > at > org.apache.derby.impl.store.raw.data.BaseDataFileFactory.setRawStoreFactory(BaseDataFileFactory.java:1287) > at org.apache.derby.impl.store.raw.RawStore.boot(RawStore.java:227) > at > org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1986) > at > org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334) > at > org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:537) > at > org.apache.derby.impl.services.monitor.FileMonitor.startModule(FileMonitor.java:48) > at > org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:460) > at > org.apache.derby.impl.store.access.RAMAccessManager$5.run(RAMAccessManager.java:1393) > at java.security.AccessController.doPrivileged(Native Method) > at > org.apache.derby.impl.store.access.RAMAccessManager.bootServiceModule(RAMAccessManager.java:1387) > at > org.apache.derby.impl.store.access.RAMAccessManager.boot(RAMAccessManager.java:1039) > at > org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1986) > at > org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334) > at > org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:537) > at > org.apache.derby.impl.services.monitor.FileMonitor.startModule(FileMonitor.java:48) > at > org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:460) > at org.apache.derby.impl.db.BasicDatabase$5.run(BasicDatabase.java:1001) > at java.security.AccessController.doPrivileged(Native Method) > at > org.apache.derby.impl.db.BasicDatabase.bootServiceModule(BasicDatabase.java:995) > at > org.apache.derby.impl.db.BasicDatabase.bootStore(BasicDatabase.java:777) > at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:186) > at > org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1986) > at > org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334) > at > org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1814) > ... 18 more > BUILD SUCCESSFUL (total time: 2 seconds) --------------030205020700000405070907 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit Hi Colm,

I agree with Bryan that it appears that this test has not been run since we introduced the BOOLEAN datatype five years ago in release 10.7.1.1. And I agree with Mike that the real problem seems to be that the correct Java security permissions haven't been granted to the Derby engine. The test doesn't appear to be designed to be run under a Java Security Manager. I say this because there is no doPrivileged block wrapping the check for the existence of the database directory at line 69. Here's a theory about what's going on:

1) The test itself is running on a client-side VM which is not governed by a SecurityManager.

2) But the IDE is running the engine in a separate server VM under a SecurityManager.

3) The server-side security policy is missing a permission.

It may be that your IDE hasn't been adjusted to account for the new permission which must be granted to derby.jar when you use Derby 10.12.1.1:

  permission org.apache.derby.security.SystemPermission "engine", "usederbyinternals";

Hope this helps,
-Rick


On 12/16/15 12:03 PM, Colm McHugh wrote:
Hi Derby devs,

I am getting the exception below when running RunOptimizerTest (in org.apache.derbyTesting.system.optimizer). My goal is to step through the query compilation code to understand how it works. I am using Java 1.8. I am using netbeans 8.0.1 and the class path includes derbyrun.jar  and derbyTesting.jar. Any help appreciated.

run:
Running test with url jdbc:derby:testdb;create=true
Initializing db ...
SQL Exception :java.sql.SQLException: XJ041.C : [0] testdb
java.sql.SQLException: XJ041.C : [0] testdb
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:115)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:141)
at org.apache.derby.impl.jdbc.Util.seeNextException(Util.java:255)
at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(EmbedConnection.java:2656)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>(EmbedConnection.java:435)
at org.apache.derby.jdbc.InternalDriver$1.run(InternalDriver.java:663)
at org.apache.derby.jdbc.InternalDriver$1.run(
InternalDriver.java:659)

========================= R E S U L T S =========================
at java.security.AccessController.doPrivileged(Native Method)

at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(InternalDriver.java:657)
at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:306)
at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:963)
at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:147)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:270)
at org.apache.derbyTesting.system.optimizer.RunOptimizerTest.main(RunOptimizerTest.java:94)
Caused by: ERROR XJ041: XJ041.C : [0] testdb
at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.wrapArgsForTransportAcrossDRDA(SQLExceptionFactory.java:170)
at org.apache.derby.impl.jdbc.SQLExceptionFactory.getSQLException(SQLExceptionFactory.java:75)
... 14 more
Caused by: ERROR XBM01: XBM01.D
at org.apache.derby.iapi.error.StandardException.newException(StandardException.java:290)
at org.apache.derby.iapi.services.monitor.Monitor.exceptionStartingModule(Monitor.java:743)
at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1841)
at org.apache.derby.impl.services.monitor.BaseMonitor.createPersistentService(BaseMonitor.java:1006)
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:4062)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.jdbc.EmbedConnection.createPersistentService(EmbedConnection.java:4056)
at org.apache.derby.impl.jdbc.EmbedConnection.createDatabase(EmbedConnection.java:2649)
... 11 more
Caused by: java.lang.NullPointerException
at org.apache.derby.impl.store.raw.log.LogToFile.writeControlFile(LogToFile.java:2411)
at org.apache.derby.impl.store.raw.log.LogToFile.boot(LogToFile.java:3383)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1986)
at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:537)
at org.apache.derby.impl.services.monitor.FileMonitor.startModule(FileMonitor.java:48)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:460)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory$10.run(BaseDataFileFactory.java:3058)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.bootServiceModule(BaseDataFileFactory.java:3052)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.bootLogFactory(BaseDataFileFactory.java:1811)
at org.apache.derby.impl.store.raw.data.BaseDataFileFactory.setRawStoreFactory(BaseDataFileFactory.java:1287)
at org.apache.derby.impl.store.raw.RawStore.boot(RawStore.java:227)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1986)
at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:537)
at org.apache.derby.impl.services.monitor.FileMonitor.startModule(FileMonitor.java:48)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:460)
at org.apache.derby.impl.store.access.RAMAccessManager$5.run(RAMAccessManager.java:1393)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.store.access.RAMAccessManager.bootServiceModule(RAMAccessManager.java:1387)
at org.apache.derby.impl.store.access.RAMAccessManager.boot(RAMAccessManager.java:1039)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1986)
at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:537)
at org.apache.derby.impl.services.monitor.FileMonitor.startModule(FileMonitor.java:48)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:460)
at org.apache.derby.impl.db.BasicDatabase$5.run(BasicDatabase.java:1001)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.derby.impl.db.BasicDatabase.bootServiceModule(BasicDatabase.java:995)
at org.apache.derby.impl.db.BasicDatabase.bootStore(BasicDatabase.java:777)
at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:186)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1986)
at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334)
at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1814)
... 18 more
BUILD SUCCESSFUL (total time: 2 seconds)
 

--------------030205020700000405070907--