[9] RFR(S): 8178726: Can't load classes from classpath if it is a UNC share
Chris Hegarty
chris.hegarty at oracle.com
Fri Apr 14 13:02:45 UTC 2017
Volker,
On 13/04/17 19:50, Volker Simonis wrote:
> Hi,
>
> can you please review the following change which fixes a problem with
> UNC paths on the Windows class path:
>
> http://cr.openjdk.java.net/~simonis/webrevs/2017/8178726/
> https://bugs.openjdk.java.net/browse/JDK-8178726
>
> I would appreciate if somebody could run this trough JPRT for me. I
> won't be available until Tuesday after Easter so there's some time for
> testing :)
I know that Alan has provided some comments on this, but I just
grabbed your patch and sent it through our internal build and test
system. I observed a few failures:
1)java/nio/file/spi/SetDefaultProvider.java ( all platforms )
STDERR:
Error: A JNI error has occurred, please check your installation and try
again
Exception in thread "main" java.lang.Error: java.lang.NullPointerException
at
java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(FileSystems.java:139)
at
java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.access$100(FileSystems.java:100)
at
java.base/java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:109)
at
java.base/java.nio.file.FileSystems$DefaultFileSystemHolder$1.run(FileSystems.java:107)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at
java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.defaultFileSystem(FileSystems.java:107)
at
java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.<clinit>(FileSystems.java:101)
at java.base/java.nio.file.FileSystems.getDefault(FileSystems.java:188)
at java.base/java.nio.file.Paths.get(Paths.java:138)
at
java.base/jdk.internal.loader.URLClassPath$FileLoader.<init>(URLClassPath.java:1049)
at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:417)
at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:411)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at
java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:410)
at
java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:379)
at
java.base/jdk.internal.loader.URLClassPath.getResource(URLClassPath.java:245)
at
java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:666)
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:592)
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:550)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:473)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:374)
at
java.base/sun.launcher.LauncherHelper.loadMainClass(LauncherHelper.java:628)
at
java.base/sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:524)
Caused by: java.lang.NullPointerException
at java.base/java.nio.file.Paths.get(Paths.java:138)
at
java.base/jdk.internal.loader.URLClassPath$FileLoader.<init>(URLClassPath.java:1049)
at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:417)
at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:411)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at
java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:410)
at
java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:379)
at
java.base/jdk.internal.loader.URLClassPath.getResource(URLClassPath.java:245)
at
java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:666)
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:592)
at
java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:550)
at
java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:185)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:473)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:374)
at
java.base/java.nio.file.FileSystems$DefaultFileSystemHolder.getDefaultProvider(FileSystems.java:129)
... 24 more
2) java/security/Security/ClassLoaderDeadlock/ClassLoaderDeadlock.sh
( all platforms )
Exception in thread "main" java.lang.IllegalArgumentException: URI is
not hierarchical
at java.base/sun.nio.fs.UnixUriUtils.fromUri(UnixUriUtils.java:48)
at
java.base/sun.nio.fs.UnixFileSystemProvider.getPath(UnixFileSystemProvider.java:99)
at java.base/java.nio.file.Paths.get(Paths.java:138)
at
java.base/jdk.internal.loader.URLClassPath$FileLoader.<init>(URLClassPath.java:1049)
at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:417)
at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:411)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at
java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:410)
at
java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:379)
at
java.base/jdk.internal.loader.URLClassPath.getResource(URLClassPath.java:245)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:450)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:447)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:446)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:540)
at
ClassLoaderDeadlock$DelayClassLoader.loadClass(ClassLoaderDeadlock.java:87)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:473)
at ClassLoaderDeadlock.main(ClassLoaderDeadlock.java:38)
3) test\java\net\URLClassLoader\closetest\CloseTest.java ( Windows )
java.lang.IllegalArgumentException: uri
at
java.base/jdk.internal.loader.URLClassPath$FileLoader.<init>(URLClassPath.java:1051)
at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:417)
at java.base/jdk.internal.loader.URLClassPath$3.run(URLClassPath.java:411)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at
java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:410)
at
java.base/jdk.internal.loader.URLClassPath.getLoader(URLClassPath.java:379)
at
java.base/jdk.internal.loader.URLClassPath.getResource(URLClassPath.java:245)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:450)
at java.base/java.net.URLClassLoader$1.run(URLClassLoader.java:447)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:446)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:540)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:473)
at java.base/java.lang.Class.forName0(Native Method)
at java.base/java.lang.Class.forName(Class.java:374)
at Common.loadClass(Common.java:80)
at CloseTest.test(CloseTest.java:109)
at CloseTest.main(CloseTest.java:83)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:563)
at
com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
at java.base/java.lang.Thread.run(Thread.java:844)
Caused by: java.net.URISyntaxException: Illegal character in opaque part
at index 7:
file:C:\jprt\T\P1\101420.chhegar\s\jdk\testoutput\jdk_net\JTwork\classes\java\net\URLClassLoader\closetest/testdir/
at java.base/java.net.URI$Parser.fail(URI.java:2904)
at java.base/java.net.URI$Parser.checkChars(URI.java:3075)
at java.base/java.net.URI$Parser.parse(URI.java:3111)
at java.base/java.net.URI.<init>(URI.java:590)
at java.base/java.net.URL.toURI(URL.java:1018)
at
java.base/jdk.internal.loader.URLClassPath$FileLoader.<init>(URLClassPath.java:1049)
... 23 more
4) java/net/URLClassLoader/closetest/GetResourceAsStream.java ( Windows )
STDOUT:
Doing tests with URL:
file:/C:/jprt/T/P1/101420.chhegar/s/jdk/testoutput/jdk_net/JTwork/classes/java/net/URLClassLoader/closetest/test.jar
... OK
Doing tests with URL:
file:/C:/jprt/T/P1/101420.chhegar/s/jdk/testoutput/jdk_net/JTwork/classes/java/net/URLClassLoader/closetest/test.jar
... OK
Doing tests with URL:
file:/C:/jprt/T/P1/101420.chhegar/s/jdk/testoutput/jdk_net/JTwork/classes/java/net/URLClassLoader/closetest/test.jar
... OK
STDERR:
java.lang.RuntimeException: Dir exists:
C:\jprt\T\P1\101420.chhegar\s\jdk\testoutput\jdk_net\JTwork\classes\java\net\URLClassLoader\closetest\testdir
at Common.copyDir(Common.java:62)
at GetResourceAsStream.main(GetResourceAsStream.java:71)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native
Method)
at
java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at
java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:563)
at
com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:115)
at java.base/java.lang.Thread.run(Thread.java:844)
-Chris.
More information about the core-libs-dev
mailing list