Details
Description
If I try to run DatabaseClassLoadingTest twice in a row, the second run
immediately fails with a AccessControlException.
To reproduce the problem:
1) cd to a fresh empty directory
2) java junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.lang.DatabaseClassLoadingTest
(test will pass)
3) java junit.textui.TestRunner org.apache.derbyTesting.functionTests.tests.lang.DatabaseClassLoadingTest
(test will fail with an AccessControlException)
It's possible that this is due to a problem with the security policy that the
test harness includes for running the unit tests?
I'll include the stack trace in a comment to this issue.
java.security.AccessControlException: access denied ("java.io.FilePermission" "C
:\Users\Bryan\derby\tests\system\wombat\jar\e66540fa-0140-eb6c-e466-00004fd8b4bd
.jar.G1378339326751" "read")
at java.security.AccessControlContext.checkPermission(Unknown Source)
at java.security.AccessController.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkPermission(Unknown Source)
at java.lang.SecurityManager.checkRead(Unknown Source)
at java.io.File.exists(Unknown Source)
at org.apache.derby.impl.store.raw.data.RemoveFileOperation.needsRedo(RemoveFileOperation.java:154)
at org.apache.derby.impl.store.raw.log.FileLogger.redo(FileLogger.java:1395)
at org.apache.derby.impl.store.raw.log.LogToFile.recover(LogToFile.java:932)
at org.apache.derby.impl.store.raw.RawStore.boot(RawStore.java:337)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1991)
at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:541)
at org.apache.derby.impl.services.monitor.FileMonitor.startModule(FileMonitor.java:44)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:423)
at org.apache.derby.impl.store.access.RAMAccessManager.boot(RAMAccessManager.java:1000)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1991)
at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334)
at org.apache.derby.impl.services.monitor.BaseMonitor.startModule(BaseMonitor.java:541)
at org.apache.derby.impl.services.monitor.FileMonitor.startModule(FileMonitor.java:44)
at org.apache.derby.iapi.services.monitor.Monitor.bootServiceModule(Monitor.java:423)
at org.apache.derby.impl.db.BasicDatabase.bootStore(BasicDatabase.java:760)
at org.apache.derby.impl.db.BasicDatabase.boot(BasicDatabase.java:177)
at org.apache.derby.impl.services.monitor.BaseMonitor.boot(BaseMonitor.java:1991)
at org.apache.derby.impl.services.monitor.TopService.bootModule(TopService.java:334)
at org.apache.derby.impl.services.monitor.BaseMonitor.bootService(BaseMonitor.java:1819)
at org.apache.derby.impl.services.monitor.BaseMonitor.startProviderService(BaseMonitor.java:1685)
at org.apache.derby.impl.services.monitor.BaseMonitor.findProviderAndStartService(BaseMonitor.java:1569)
at org.apache.derby.impl.services.monitor.BaseMonitor.startPersistentService(BaseMonitor.java:988)
at org.apache.derby.iapi.services.monitor.Monitor.startPersistentService(Monitor.java:546)
at org.apache.derby.impl.jdbc.EmbedConnection.bootDatabase(EmbedConnection.java:2802)
at org.apache.derby.impl.jdbc.EmbedConnection.<init>EmbedConnection.java:404)
at org.apache.derby.jdbc.InternalDriver.getNewEmbedConnection(InternalDriver.java:628)
at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:282)
at org.apache.derby.jdbc.InternalDriver.connect(InternalDriver.java:913)
at org.apache.derby.jdbc.AutoloadedDriver.connect(AutoloadedDriver.java:147)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at org.apache.derbyTesting.junit.DriverManagerConnector.openConnection(DriverManagerConnector.java:100)
at org.apache.derbyTesting.junit.DriverManagerConnector.openConnection(DriverManagerConnector.java:67)
at org.apache.derbyTesting.junit.DriverManagerConnector.openConnection(DriverManagerConnector.java:43)
at org.apache.derbyTesting.junit.TestConfiguration.openDefaultConnection(TestConfiguration.java:1707)
at org.apache.derbyTesting.junit.BaseJDBCTestSetup.getConnection(BaseJDBCTestSetup.java:72)
at org.apache.derbyTesting.junit.CleanDatabaseTestSetup.setUp(CleanDatabaseTestSetup.java:103)
at junit.extensions.TestSetup$1.protect(TestSetup.java:20)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.extensions.TestSetup.run(TestSetup.java:25)
at org.apache.derbyTesting.junit.BaseTestSetup.run(BaseTestSetup.java:57)
at junit.textui.TestRunner.doRun(TestRunner.java:121)
at junit.textui.TestRunner.start(TestRunner.java:185)
at junit.textui.TestRunner.main(TestRunner.java:143)