JDK-8170113 : jimage extract to readonly directory causes MissingResourceException
  • Type: Bug
  • Component: tools
  • Sub-Component: jlink
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2016-11-21
  • Updated: 2017-02-23
  • Resolved: 2017-02-10
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 10 JDK 9
10Fixed 9 b157Fixed
Related Reports
Relates :  
Relates :  
Description
An attempt to run

% jimage extract --dir some_directory image

where some_directory has readonly permission the following exception is thrown:

java.util.MissingResourceException: Can't find resource for bundle jdk.tools.jlink.resources.plugins, key err.cannot.create.dir
	at java.base/java.util.ResourceBundle.getObject(ResourceBundle.java:536)
	at java.base/java.util.ResourceBundle.getString(ResourceBundle.java:493)
	at jdk.jlink/jdk.tools.jlink.internal.TaskHelper$ResourceBundleHelper.getMessage(TaskHelper.java:428)
	at jdk.jlink/jdk.tools.jlink.internal.TaskHelper$BadArgs.<init>(TaskHelper.java:79)
	at jdk.jlink/jdk.tools.jlink.internal.TaskHelper$BadArgs.<init>(TaskHelper.java:74)
	at jdk.jlink/jdk.tools.jlink.internal.TaskHelper.newBadArgs(TaskHelper.java:697)
	at jdk.jlink/jdk.tools.jimage.JImageTask.extract(JImageTask.java:289)
	at jdk.jlink/jdk.tools.jimage.JImageTask.iterate(JImageTask.java:421)
	at jdk.jlink/jdk.tools.jimage.JImageTask.run(JImageTask.java:432)
	at jdk.jlink/jdk.tools.jimage.JImageTask.run(JImageTask.java:228)
	at jdk.jlink/jdk.tools.jimage.Main.run(Main.java:48)
	at JImageCliTest.jimage(JImageCliTest.java:78)
	at JImageExtractTest.testExtractToReadOnlyDir(JImageExtractTest.java:149)
	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:537)
	at JImageCliTest.runTests(JImageCliTest.java:111)
	at JImageExtractTest.main(JImageExtractTest.java:182)
	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:537)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
	at java.base/java.lang.Thread.run(Thread.java:844)
java.lang.reflect.InvocationTargetException
	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:537)
	at JImageCliTest.runTests(JImageCliTest.java:111)
	at JImageExtractTest.main(JImageExtractTest.java:182)
	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:537)
	at com.sun.javatest.regtest.agent.MainWrapper$MainThread.run(MainWrapper.java:110)
	at java.base/java.lang.Thread.run(Thread.java:844)

The same issue appears when instead of a directory a file is specified.

Tested on jdk 9-ea+144.

Comments
RFR: http://mail.openjdk.java.net/pipermail/core-libs-dev/2017-February/046260.html
09-02-2017