No "read" FilePermission for JTREG "test.classes" - on Windows only (was Re: RFR 9: 8068578: ...)

Brent Christian brent.christian at
Thu Jan 29 17:44:53 UTC 2015


I ran my updated test through our automated testing system, and it 
failed *on Windows only*.  The toURI() call I added came back with an 
AccessControlException due to not being able to read the "test.classes" 
directory.  The test uses its own security policy.

I added

   permission "<<ALL FILES>>", "read";

to the policy file and the test now passes on all platforms.  So I'll be 
pushing this additional change to the test's policy file.

Anybody know what might be going on - why Windows isn't able to read the 
directory that jtreg creates for test classes?

-Brent access denied 
	at java.lang.SecurityManager.checkPermission(
	at java.lang.SecurityManager.checkRead(
	at SubclassGC.main(
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.lang.reflect.Method.invoke(
	at com.sun.javatest.regtest.MainWrapper$

On 1/23/15 4:15 PM, Brent Christian wrote:
> Hi,
> Please review this test case update.
> Bug:
> Webrev:
> The test relies on creating a new URLClassLoader and using it to load a
> subclass of ObjectOutputStream.  The system classloader is cast to a
> URLClassLoader in order to call getURLs(), but the test can be made to
> work without this URL[].  We can instead create a URL based on the value
> of the "test.classes" system property.
> I have confirmed that the test still detects the original bug (6232010)
> in 5u6, and passes with later JDKs.
> Thanks,
> -Brent

More information about the jtreg-use mailing list