-
Notifications
You must be signed in to change notification settings - Fork 167
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
Version 3.13.33 throws NoClassDefFoundError when retrieving data #1442
Comments
Can you try as a workaround this before executing the query: statement.execute("ALTER SESSION SET JDBC_QUERY_RESULT_FORMAT='JSON';"); this is most probably related to the Arrow resultset format but I want to understand if the workaround works for you. |
Yes as reported in the linked forum post executing the statement or setting the JDBC_QUERY_RESULT_FORMAT with value JSON solved the issue. |
Thanks for confirming @koettert, I was expecting it to work with JSON result format. I cannot completely reproduce your issue as when using Windows 10 and JDK17 I get the following stacktrace: Jun 26, 2023 3:52:17 PM net.snowflake.client.core.SFStatement executeQueryInternal
SEVERE: Exception creating result
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
at net.snowflake.client.jdbc.internal.apache.arrow.memory.BaseAllocator.<clinit>(BaseAllocator.java:46)
at net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1.create(SnowflakeResultSetSerializableV1.java:591)
at net.snowflake.client.jdbc.SnowflakeResultSetSerializableV1.create(SnowflakeResultSetSerializableV1.java:490)
at net.snowflake.client.core.SFResultSetFactory.getResultSet(SFResultSetFactory.java:34)
at net.snowflake.client.core.SFStatement.executeQueryInternal(SFStatement.java:227)
at net.snowflake.client.core.SFStatement.executeQuery(SFStatement.java:133)
at net.snowflake.client.core.SFStatement.execute(SFStatement.java:767)
at net.snowflake.client.core.SFStatement.execute(SFStatement.java:676)
at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:274)
at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQuery(SnowflakeStatementV1.java:140)
at GithubIssue1442.main(GithubIssue1442.java:42)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:568)
at jdk.compiler/com.sun.tools.javac.launcher.Main.execute(Main.java:419)
at jdk.compiler/com.sun.tools.javac.launcher.Main.run(Main.java:192)
at jdk.compiler/com.sun.tools.javac.launcher.Main.main(Main.java:132)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:520)
... 18 more
Exception in thread "main" net.snowflake.client.jdbc.SnowflakeSQLException: JDBC driver internal error: exception creating result java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory at net.snowflake.client.jdbc.internal.apache.arrow.memory.BaseAllocator.<clinit>(BaseAllocator.java:46).
at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQueryInternal(SnowflakeStatementV1.java:291)
at net.snowflake.client.jdbc.SnowflakeStatementV1.executeQuery(SnowflakeStatementV1.java:140)
at GithubIssue1442.main(GithubIssue1442.java:42) Is there a chance you enable logging so I can see the log file? |
I enabled JDBC logging and this is an extract from the log file without the sensitive information
This is the full stacktrace from within our application:
|
Hi @koettert , thanks for the additional information.
on a Windows 10 VM and I am not able to reproduce this issue. |
Hello @sfc-gh-spanaite ! We are facing the same problem with Liquibase builds when upgrading to Snowflake jdbc driver It happens at On 3.13.32 the same piece of code works, so maybe it's related to some dependencies version change or build issues? Btw, for me it fails with java 8 and 11 but works fine with 17 and 20. |
Hello @filipelautert @koettert I am able to reproduce the issue using DBeaver. Fails in 3.13.33 but works fine in 3.13.32. Give us some time to verify what's happening and we will come back with some updates. |
I'm closing this issue as this should be fixed within the new release after [PR1474(]#1474). We confirmed with reproduction and fix. |
This might be related to #589 but I'm not sure since it is working as expected with 3.13.32 and only failing with 3.13.33.
Might work with 3.13.32 since we add the flag
--add-opens=java.base/sun.nio=ALL-UNNAMED
to our application. For more details you can also have a look at the post in our forum.What version of JDBC driver are you using?
Affected version: 3.13.33
Unaffected version: 3.13.32 and older e.g. 3.13.24
What operating system and processor architecture are you using?
Windows 10
What version of Java are you using?
JDK17
What did you do?
Connecting to database works but retrieving data results in the following stacktrace:
What did you expect to see?
The data :-) Executing the exact same operations using version 3.13.32 returns the expected result.
Can you set logging to DEBUG and collect the logs?
See stacktrace above.
The text was updated successfully, but these errors were encountered: