Class#getResource returns null in JDK9 b140 if security manager is enabled (was: RE: [JENKINS-EA] Lucene-Solr-master-Linux (32bit/jdk-9-ea+140) - Build # 18064 - Unstable!)

Sean Mullan sean.mullan at oracle.com
Mon Oct 17 17:35:06 UTC 2016


Weijun Wang is the best person to respond as he is the RE of JDK-8164705 
- right now it is the middle of the night for him, but I would expect a 
response from him once he comes online.

--Sean


On 10/16/2016 06:09 PM, Uwe Schindler wrote:
> Hi again,
>
> with jdk.io.permissionsUseCanonicalPath=true it also works, so it is related to the new FilePermission code, so my first guess was true, the issue is JDK-8164705.
>
> Uwe
>
>> > (I cc'ed jdk-dev at openjdk, reader there please read the previous mails
>> > below, too).
>> >
>> > I analyzed the problem, although I don't know exactly why it happens:
>> > - On Windows it does not happen on my machine (no idea why!)
>> > - On Linux it happens when tests are running with security manager (this is
>> > the default for Lucene and Jenkins does this)
>> > - On Linux it does not happen if I run Lucene tests with "-
>> > Dtests.useSecurityManager=false"
>> >
>> > This makes me think it is related to this: "Remove pathname canonicalization
>> > from FilePermission" (https://bugs.openjdk.java.net/browse/JDK-8164705)
>> >
>> > What seems to happen: The code calls Class.getResource to get back an URL.
>> > As the JAR file is somehow outside of the FilePermissions given to the test
>> > suite, it seems to fail. Maybe because some of the checks failed,
>> > Class.getResource then returns a null reference, because it was not able to
>> > access the JAR file.
>> >
>> > Were there some changes related to this: URLClassLoader and FilePermission
>> > checks?
>> >
>> > How should we proceed?


More information about the jdk9-dev mailing list