db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Zaun <Martin.Z...@Sun.COM>
Subject solution to 'ant junit-core' throwing AccessControlException ?
Date Thu, 04 Oct 2007 17:28:23 GMT

Hi All,

there's been reporting of 'ant junit-core' failing with
AccessControlException because of missing FilePermissions for file
   junitvmwatcherXXXXXXXXX.properties

Was there a solution?

I run into the same 'access denied' issue on the current trunk.
Tried without success
     ant -Djava.security.policy=... junit-core
with either no policy file or one granting universal FilePermission.

Not sure Derby code's even involved.  Any idea?

Using out-of-box: ant-1.7.0/1.6.5, jdk-1.5.0_09, junit-3.8.1.

Thanks,
Martin

Tried extending
   java/testing/org/apache/derbyTesting/functionTests/util/derby_tests.policy
for generous

junit-core:
     [junit] Running org.apache.derbyTesting.functionTests.tests.jdbcapi.Autoload
Test
     [junit] Tests run: 3, Failures: 0, Errors: 2, Time elapsed: 0.953 sec
     [junit] java.security.AccessControlException: access denied (java.io.FilePer
mission g:\olsen\derby\trunk\junitvmwatcher965905307.properties write)
     [junit]     at java.security.AccessControlContext.checkPermission(AccessCont
rolContext.java:269)
     [junit]     at java.security.AccessController.checkPermission(AccessControll
er.java:401)
     [junit]     at java.lang.SecurityManager.checkPermission(SecurityManager.jav
a:524)
     [junit]     at java.lang.SecurityManager.checkWrite(SecurityManager.java:954
)
     [junit]     at java.io.FileOutputStream.<init>(FileOutputStream.java:169)
     [junit]     at java.io.FileOutputStream.<init>(FileOutputStream.java:70)
     [junit]     at java.io.FileWriter.<init>(FileWriter.java:46)
     [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
registerNonCrash(JUnitTestRunner.java:924)
     [junit]     at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.
main(JUnitTestRunner.java:772)
     [junit] Exception in thread "main"



Mime
View raw message