RFR: 8173943: Change error reporting of LauncherHelper to include actual Error class name

David Holmes david.holmes at oracle.com
Mon Feb 6 03:34:01 UTC 2017


Hi Ramanand,

On 6/02/2017 1:22 PM, Ramanand Patil wrote:
> Hi David,
>
> I have updated the bug report with the below sample output error message as suggested.
>
> Here is the sample error output for comparison(taken from the test case of JDK-8167063):

Thanks. I expect this does fix the test failures, but to honest I much 
prefer the original

Exception in thread "main" ...

form of the message. I'm really not sure why that needed to change.


Thanks,
David

> 1. Before Fixing JDK-8167063:
> Error: A JNI error has occurred, please check your installation and try again
> Exception in thread "main" java.lang.IllegalAccessError: superclass access check failed: class pkg.b.Bar (in module mod.b) cannot access class pkg.a.Foo (in module mod.a) because module mod.a does not export pkg.a to module mod.b
> at java.lang.ClassLoader.defineClass1(java.base at 9-ea/Native Method)
> at java.lang.ClassLoader.defineClass(java.base at 9-ea/ClassLoader.java:947)
> at java.lang.ClassLoader.defineClass(java.base at 9-ea/ClassLoader.java:1024)
> at java.security.SecureClassLoader.defineClass(java.base at 9-ea/SecureClassLoader.java:182)
> at jdk.internal.loader.BuiltinClassLoader.defineClass(java.base at 9-ea/BuiltinClassLoader.java:512)
> at jdk.internal.loader.BuiltinClassLoader.lambda$findClassInModuleOrNull$2(java.base at 9-ea/BuiltinClassLoader.java:449)
> at java.security.AccessController.doPrivileged(java.base at 9-ea/Native Method)
> at jdk.internal.loader.BuiltinClassLoader.findClassInModuleOrNull(java.base at 9-ea/BuiltinClassLoader.java:450)
> at jdk.internal.loader.BuiltinClassLoader.findClass(java.base at 9-ea/BuiltinClassLoader.java:354)
> at java.lang.ClassLoader.loadLocalClass(java.base at 9-ea/ClassLoader.java:536)
> at java.lang.Class.forName(java.base at 9-ea/Class.java:446)
> at sun.launcher.LauncherHelper.loadModuleMainClass(java.base at 9-ea/LauncherHelper.java:544)
> at sun.launcher.LauncherHelper.checkAndLoadMain(java.base at 9-ea/LauncherHelper.java:496)
>
> 2. After Fixing JDK-8167063:
> Error: Unable to load main class pkgB.ClassB from module mod.b
> superclass access check failed: class pkgB.ClassB (in module mod.b) cannot access class pkgA.ClassA (in module mod.a) because module mod.a does not export pkgA to module mod.b
>
> [Here the complete stacktrace was removed to be consistent with the error handling mechanism of LauncherHelper, where only the important error message is printed and the complete stack trace is shown in diagnostic ("-Xdiag") mode.]
>
> 3. After fixing the current Bug( JDK-8173943 ):
> Error: Unable to load main class pkgB.ClassB from module mod.b
> java.lang.IllegalAccessError: superclass access check failed: class pkgB.ClassB (in module mod.b) cannot access class pkgA.ClassA (in module mod.a) because module mod.a does not export pkgA to module mod.b
>
>
> Regards,
> Ramanand.
> -----Original Message-----
> From: David Holmes
> Sent: Monday, February 06, 2017 3:10 AM
> To: Ramanand Patil <ramanand.patil at oracle.com>; core-libs-dev <core-libs-dev at openjdk.java.net>
> Subject: Re: RFR: 8173943: Change error reporting of LauncherHelper to include actual Error class name
>
> Hi Ramanand,
>
> On 6/02/2017 5:14 AM, Ramanand Patil wrote:
>> Hi all,
>> Please review the following trivial bug fix:
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8173943
>> Webrev: http://cr.openjdk.java.net/~rpatil/8173943/webrev.00/
>>
>> LinkageError message added by - https://bugs.openjdk.java.net/browse/JDK-8167063 is updated to include the Error Class name.
>
> For changes like this it would be useful to show (in the RFR and/or the bug report) how the error messages appear before and after the change as that is what we need to verify. And in this case we need to compare against what was reported prior to JDK-8167063 being fixed.
>
> Thanks,
> David
> -----
>
>> Regards,
>> Ramanand.
>>


More information about the core-libs-dev mailing list