cancel
Showing results for 
Search instead for 
Did you mean: 
Data Engineering
Join discussions on data engineering best practices, architectures, and optimization strategies within the Databricks Community. Exchange insights and solutions with fellow data engineers.
cancel
Showing results for 
Search instead for 
Did you mean: 

JDBC Error: Error occured while deserializing arrow data

mattmunz
New Contributor III

I am getting the following error in my Java application.

java.sql.SQLException: [Databricks][DatabricksJDBCDriver](500618) Error occured while deserializing arrow data: sun.misc.Unsafe or java.nio.DirectByteBuffer.<init>(long, int) not available

I believe this is the same issue described here.

Java version:

java version "18.0.1.1" 2022-04-22
Java(TM) SE Runtime Environment (build 18.0.1.1+2-6)
Java HotSpot(TM) 64-Bit Server VM (build 18.0.1.1+2-6, mixed mode, sharing)

I am using the recommended flag:

-Dio.netty.tryReflectionSetAccessible=true

Is the source code for the JDBC driver available? Any suggestions on how to fix this would be appreciated. Also if there is an example app that uses the JDBC driver, I'd be interested in trying that as well. Thanks!

2 REPLIES 2

User16753725469
Contributor II

Please try adding the below(--add-opens flag) java command line flags in your jvm call:

% javac -classpath SparkJDBC42Example.jar:. jdbc_example.java                   

% java --add-opens=java.base/java.nio=ALL-UNNAMED -classpath SparkJDBC42Example.jar:. jdbc_example

cvcore
New Contributor II

For anyone encountering this issue in 2025, I was able to solve it by using the 

--add-opens=jdk.unsupported/sun.misc=ALL-UNNAMED

option in combination with the latest jdbc driver (v2.7.1). I was using the driver in dbeaver, but I assume the issue could be also solved in similar environments.

Pointer: https://github.com/dbeaver/dbeaver/issues/18962