Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File mode permission throwing exception in JDK10 and 11 #70

Closed
robin-anil opened this issue Sep 29, 2018 · 3 comments
Closed

File mode permission throwing exception in JDK10 and 11 #70

robin-anil opened this issue Sep 29, 2018 · 3 comments
Milestone

Comments

@robin-anil
Copy link

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:564)
	at org.rauschig.jarchivelib.FileModeMapper$FileSystemPreferencesReflectionChmodCommand.chmod(FileModeMapper.java:144)
	at org.rauschig.jarchivelib.FileModeMapper$UnixPermissionMapper.chmod(FileModeMapper.java:119)
	at org.rauschig.jarchivelib.FileModeMapper$UnixPermissionMapper.map(FileModeMapper.java:105)
	at org.rauschig.jarchivelib.FileModeMapper.map(FileModeMapper.java:53)
	at org.rauschig.jarchivelib.CommonsArchiver.extract(CommonsArchiver.java:106)
	at org.rauschig.jarchivelib.CommonsArchiver.extract(CommonsArchiver.java:81)
	at pl.allegro.tech.embeddedelasticsearch.ElasticSearchInstaller.unzip(ElasticSearchInstaller.java:76)
Caused by: java.lang.UnsatisfiedLinkError: java.util.prefs.FileSystemPreferences.chmod(Ljava/lang/String;I)I
	at java.prefs/java.util.prefs.FileSystemPreferences.chmod(Native Method)
@cliffcotino
Copy link
Contributor

We are encountering the same issue (also due to our use of the embedded-elasticsearch plugin) We can also reproduce the situation in this library by running mvn clean build with JDK 11.

It seems to me that a fix could be to use java.nio to set file permissions instead.

I would be glad to provide to provide pull requests.
Maybe something based on #66?

@cliffcotino
Copy link
Contributor

I created a pull request that runs on JDK versions >= 9
Pull request: #72

@thrau thrau added this to the v1.0.0 milestone Nov 8, 2018
@thrau
Copy link
Owner

thrau commented Nov 8, 2018

fixed with #72

@thrau thrau closed this as completed Nov 8, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants