JDK-8160359 : Improve jlink logging for cases when a plugin throws exception
  • Type: Bug
  • Component: tools
  • Sub-Component: jlink
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2016-06-27
  • Updated: 2016-12-08
  • Resolved: 2016-11-30
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 9
9 b148Fixed
Related Reports
Relates :  
Description
Currently if a jlink plugin throws an exception, only getMessage() is printed. 

Consider allowing users to enable more detailed output as a debugging aid, primarily dumping the stacktrace. Information about which plugin threw the exception together with the input to jlink and to the specific plugin (useful when you're note the one explicitly running jlink, say, via the JDK build) could also be helpful.

Comments
I think we need this debugging enabled in the JDK build, essentially important when touching the system modules plugin.
27-11-2016

I added stack trace printing around plugin configure and transform calls - controlled by jlink.debug property. But, I get two test failures!! Checking..
08-11-2016

I agree troubleshooting of jlink plugin exceptions should be improved. The spec of jlink plugin API should also be made it clear what exceptions are for what condition so that jlink can differentiate what cases should print the stack trace and when it does not need to. For example IAE is thrown for invalid option/arguments and PluginException may be for plugin unexpected error cases. Sundar added a workaround to dump the stack trace if `jlink.debug` system property is set. jlink -J-Djlink.debug=true
27-06-2016