RFR 8160359: Improve jlink logging for cases when a plugin throws exception

Sundararajan Athijegannathan sundararajan.athijegannathan at oracle.com
Wed Nov 9 03:43:47 UTC 2016


Mandy,

The exceptions caught are propagated to caller - JlinkTask - which does
print getMessage from exception and exits.  So, if a plugin throws
illegal argument exception from "configure", jlink will print message
and exit - as expected.

Catching PluginException (and IllegalArgumentException in the case of
configure) at precise location is a debugging aid. Plugin name, actual
arguments map passed are dumped in addition to stack trace - only if
system property is defined.

-Sundar


On 11/9/2016 2:12 AM, Mandy Chung wrote:
> Sundar,
>
> Have you considered for plugins to throw different type of exceptions to differentiate if jlink should gracefully exit with no stack trace.  For example if it’s an user-error e.g. invalid option or duplicated entries then jlink can simply print the error message.
>
> For unexpected error such as IOException, the stack trace would be useful for troubleshooting.
>
> Mandy
>
> On Nov 8, 2016, at 7:51 AM, Claes Redestad <claes.redestad at oracle.com> wrote:
>> Hi,
>>
>> I think this looks good as-is, but:
>>
>> Many times I've had the need to enable this kind of logging when
>> building the JDK (as jlink plugins are now essential to creating the
>> standard images), and having to hack the makefiles to add
>> -J-Djlink.debug=true(?) to the right place seems a bit awkward.
>>
>> Should we simply make this added verbosity the default in the build?
>>
>> Thanks!
>>
>> /Claes
>>
>> On 2016-11-08 16:08, Sundararajan Athijegannathan wrote:
>>> Please review for http://cr.openjdk.java.net/~sundar/8160359/webrev.00/
>>> for https://bugs.openjdk.java.net/browse/JDK-8160359
>>>
>>> Thanks,
>>>
>>> -Sundar
>>>



More information about the jigsaw-dev mailing list