Giter Site home page Giter Site logo

Comments (9)

howryu avatar howryu commented on June 2, 2024

@shanhija Adding a dependency is easy, but we want to keep list short and minimize the class files that will be added to self-contained-jar. I did a quick search in my projects and could not find any place that is using ArrayUtils.

Could you provide me a test case to reproduce the issue?

from snowflake-jdbc.

jianshenghuang avatar jianshenghuang commented on June 2, 2024

from snowflake-jdbc.

shanhija avatar shanhija commented on June 2, 2024

Here's the stack trace:

java.lang.NoClassDefFoundError: net/snowflake/client/jdbc/internal/apache/commons/lang3/ArrayUtils
	at net.snowflake.client.jdbc.internal.apache.commons.lang3.StringUtils.splitWorker(StringUtils.java:3042)
	at net.snowflake.client.jdbc.internal.apache.commons.lang3.StringUtils.split(StringUtils.java:2593)
	at net.snowflake.client.jdbc.SnowflakeConnectionV1.processParameters(SnowflakeConnectionV1.java:392)
	at net.snowflake.client.jdbc.SnowflakeConnectionV1.<init>(SnowflakeConnectionV1.java:201)
	at net.snowflake.client.jdbc.SnowflakeDriver.connect(SnowflakeDriver.java:344)
	at org.jkiss.dbeaver.model.impl.jdbc.JDBCDataSource.openConnection(JDBCDataSource.java:176)
	... 11 more

ArrayUtils is referenced in commons-lang3/StringUtils

from snowflake-jdbc.

howryu avatar howryu commented on June 2, 2024

It seems happening when dealing with connection parameters
@smtakeda @jianshenghuang I cannot reproduce it locally

javac TestJdbc.java
java -cp :snowflake-jdbc-3.4.1.jar TestJdbc

Note I only specified only jdbc jar file in classpath.

But anyway, I can see two solutions

  1. Add ArrayUtils to self-contained-jar
  2. Remove the dependency on StringUtils. Ideally, I want to remove the dependency on commons-lang3 completely so that no conflict would happen.

I prefer second solution. Do you have any idea/comment?

from snowflake-jdbc.

jianshenghuang avatar jianshenghuang commented on June 2, 2024

from snowflake-jdbc.

smtakeda avatar smtakeda commented on June 2, 2024

+1 for the second option.

from snowflake-jdbc.

shanhija avatar shanhija commented on June 2, 2024

+1 for the second option.

The problem emerges when the connection parameters are empty. Here's a test class that reproduces the issue when run with above commands :

import java.sql.DriverManager;
import java.sql.SQLException;

public class TestJdbc {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("net.snowflake.client.jdbc.SnowflakeDriver");
        DriverManager.getConnection("jdbc:snowflake://dummy.eu-central-1.snowflakecomputing.com/?");
    }
}

from snowflake-jdbc.

howryu avatar howryu commented on June 2, 2024

Ok. I will go with second one. It seems a trivial change.

from snowflake-jdbc.

howryu avatar howryu commented on June 2, 2024

This is fixed in 9f7904e and already released in JDBC 3.5.3

from snowflake-jdbc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.