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

llegal reflective access on JDK > 9 #56

Open
jokarl opened this issue Feb 19, 2019 · 1 comment
Open

llegal reflective access on JDK > 9 #56

jokarl opened this issue Feb 19, 2019 · 1 comment

Comments

@jokarl
Copy link

jokarl commented Feb 19, 2019

With the new module system in Java, this artifact accesses illegal classes.

WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.wildfly.openssl.ByteBufferUtils (file:/home/xx/.m2/repository/com/microsoft/azure/azure-data-lake-store-sdk/2.3.3/azure-data-lake-store-sdk-2.3.3.jar) to method java.nio.DirectByteBuffer.cleaner()
WARNING: Please consider reporting this to the maintainers of org.wildfly.openssl.ByteBufferUtils

This specific error is from the Azure Data Lake SDK, which uses:

<dependency>
	<groupId>org.wildfly.openssl</groupId>
	<artifactId>wildfly-openssl</artifactId>
	<version>1.0.0.CR5</version>
</dependency>

Here's the stacktrace from my use case:

[ERROR] TaskUtils$LoggingErrorHandler - Unexpected error occurred in scheduled task. <java.util.concurrent.CompletionException: java.lang.ExceptionInInitializerError>java.util.concurrent.CompletionException: java.lang.ExceptionInInitializerError
	at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
	at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1739)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ExceptionInInitializerError
	at org.wildfly.openssl.ByteBufferUtils.<clinit>(ByteBufferUtils.java:39)
	at org.wildfly.openssl.OpenSSLEngine.readEncryptedData(OpenSSLEngine.java:338)
	at org.wildfly.openssl.OpenSSLEngine.wrap(OpenSSLEngine.java:444)
	at java.base/javax.net.ssl.SSLEngine.wrap(SSLEngine.java:479)
	at org.wildfly.openssl.OpenSSLSocket.write(OpenSSLSocket.java:501)
	at org.wildfly.openssl.OpenSSLOutputStream.write(OpenSSLOutputStream.java:46)
	at java.base/java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:81)
	at java.base/java.io.BufferedOutputStream.flush(BufferedOutputStream.java:142)
	at java.base/java.io.PrintStream.flush(PrintStream.java:417)
	at java.base/sun.net.www.MessageHeader.print(MessageHeader.java:301)
	at java.base/sun.net.www.http.HttpClient.writeRequests(HttpClient.java:655)
	at java.base/sun.net.www.http.HttpClient.writeRequests(HttpClient.java:666)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.writeRequests(HttpURLConnection.java:711)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1602)
	at java.base/sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1509)
	at java.base/java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:527)
	at java.base/sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:329)
	at com.microsoft.azure.datalake.store.HttpTransport.makeSingleCall(HttpTransport.java:307)
	at com.microsoft.azure.datalake.store.HttpTransport.makeCall(HttpTransport.java:90)
	at com.microsoft.azure.datalake.store.Core.mkdirs(Core.java:429)
	at com.microsoft.azure.datalake.store.ADLStoreClient.createDirectory(ADLStoreClient.java:591)
	at storemanager.azure.DataLakeController.createFolder(DataLakeController.java:50)
	at storemanager.azure.DataLakeController.createAndWriteToFile(DataLakeController.java:92)
	at storemanager.socket.GateMasterConnection.uploadLogs(GateMasterConnection.java:154)
	at storemanager.azure.gatemaster.ManagedGateMaster.uploadLogs(ManagedGateMaster.java:129)
	at storemanager.azure.gatemaster.ManagedGateMaster.lambda$1(ManagedGateMaster.java:98)
	at java.base/java.util.concurrent.CompletableFuture$AsyncRun.run(CompletableFuture.java:1736)
	... 3 more
Caused by: java.lang.IllegalAccessException: class org.wildfly.openssl.ByteBufferUtils cannot access class jdk.internal.ref.Cleaner (in module java.base) because module java.base does not export jdk.internal.ref to unnamed module @19e7a160
	at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)
	at java.base/java.lang.reflect.AccessibleObject.checkAccess(AccessibleObject.java:591)
	at java.base/java.lang.reflect.Method.invoke(Method.java:558)
	at org.wildfly.openssl.ByteBufferUtils.<clinit>(ByteBufferUtils.java:36)
	... 29 more

It is manageable right now by appending --add-exports java.base/jdk.internal.ref=ALL-UNNAMED to your JVM launch arguments, that way you only get warned and the execution works as before the module system.

@jaikiran
Copy link
Contributor

jaikiran commented Jun 4, 2019

Any chance you can try against 1.0.6.Final of wildfly-openssl?

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

2 participants