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

LZ4 requires access to java.nio.Buffer raw address field (after upgrade to 2.6.0) #381

Closed
xRomZak opened this issue Nov 11, 2021 · 3 comments · Fixed by #384
Closed

LZ4 requires access to java.nio.Buffer raw address field (after upgrade to 2.6.0) #381

xRomZak opened this issue Nov 11, 2021 · 3 comments · Fixed by #384

Comments

@xRomZak
Copy link

xRomZak commented Nov 11, 2021

Environment

  • JDK version: 16

Error logs

java.lang.ExceptionInInitializerError
	at com.github.housepower.repackaged.io.airlift.compress.lz4.Lz4RawCompressor.encodeRunLength(Lz4RawCompressor.java:297)
	at com.github.housepower.repackaged.io.airlift.compress.lz4.Lz4RawCompressor.emitLastLiteral(Lz4RawCompressor.java:275)
	at com.github.housepower.repackaged.io.airlift.compress.lz4.Lz4RawCompressor.compress(Lz4RawCompressor.java:98)
	at com.github.housepower.repackaged.io.airlift.compress.lz4.Lz4Compressor.compress(Lz4Compressor.java:44)
	at com.github.housepower.buffer.CompressedBuffedWriter.flushToTarget(CompressedBuffedWriter.java:79)
	at com.github.housepower.serde.BinarySerializer.maybeDisableCompressed(BinarySerializer.java:123)
	at com.github.housepower.protocol.DataRequest.writeImpl(DataRequest.java:50)
	at com.github.housepower.protocol.Request.writeTo(Request.java:30)
	at com.github.housepower.protocol.QueryRequest.writeImpl(QueryRequest.java:85)
	at com.github.housepower.protocol.Request.writeTo(Request.java:30)
	at com.github.housepower.client.NativeClient.sendRequest(NativeClient.java:169)
	at com.github.housepower.client.NativeClient.sendQuery(NativeClient.java:163)
	at com.github.housepower.client.NativeClient.sendQuery(NativeClient.java:116)
	at com.github.housepower.jdbc.ClickHouseConnection.sendQueryRequest(ClickHouseConnection.java:270)
	at com.github.housepower.jdbc.statement.ClickHouseStatement.lambda$executeUpdate$0(ClickHouseStatement.java:92)
	at com.github.housepower.misc.ExceptionUtil.rethrowSQLException(ExceptionUtil.java:76)
	at com.github.housepower.jdbc.statement.ClickHouseStatement.executeUpdate(ClickHouseStatement.java:75)
	at com.github.housepower.jdbc.statement.ClickHouseStatement.executeQuery(ClickHouseStatement.java:100)
	at com.github.housepower.jdbc.statement.ClickHouseStatement.execute(ClickHouseStatement.java:69)
	at com.github.housepower.jdbc.statement.ClickHousePreparedQueryStatement.execute(ClickHousePreparedQueryStatement.java:67)
	at com.zaxxer.hikari.pool.ProxyPreparedStatement.execute(ProxyPreparedStatement.java:44)
	at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.execute(HikariProxyPreparedStatement.java)
	at io.vertx.jdbcclient.impl.actions.JDBCPreparedQuery.execute(JDBCPreparedQuery.java:73)
	at io.vertx.jdbcclient.impl.actions.JDBCPreparedQuery.execute(JDBCPreparedQuery.java:39)
	at io.vertx.ext.jdbc.impl.JDBCConnectionImpl.lambda$schedule$3(JDBCConnectionImpl.java:219)
	at io.vertx.core.impl.ContextImpl.lambda$null$0(ContextImpl.java:159)
	at io.vertx.core.impl.AbstractContext.dispatch(AbstractContext.java:100)
	at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:157)
	at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1130)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:630)
	at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
	at java.base/java.lang.Thread.run(Thread.java:831)
Caused by: com.github.housepower.repackaged.io.airlift.compress.IncompatibleJvmException: LZ4 requires access to java.nio.Buffer raw address field
	at app//com.github.housepower.repackaged.io.airlift.compress.lz4.UnsafeUtil.<clinit>(UnsafeUtil.java:53)
	... 33 more

Steps to reproduce

implementation 'com.github.housepower:clickhouse-native-jdbc-shaded:2.6.0'

Other descriptions

2.5.6 version - no issue

@sundy-li
Copy link
Member

Seems https://github.com/airlift/aircompressor needs at least jdk1.8+.

@xRomZak
Copy link
Author

xRomZak commented Nov 12, 2021

Original 'caused by'

Unable to make field long java.nio.Buffer.address accessible: 
module java.base does not "opens java.nio" to unnamed module @18df8434

@xRomZak
Copy link
Author

xRomZak commented Nov 22, 2021

might be fixed by upgrading aircompressor airlift/aircompressor#125
as a workaround:
implementation('com.github.housepower:clickhouse-native-jdbc:2.6.0') { exclude group: 'io.airlift' } implementation 'io.airlift:aircompressor:0.21'

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

Successfully merging a pull request may close this issue.

2 participants