Skip to content

Update Ivy to 2.5.2 to solve NoClassDefFoundError #2

@stariy95

Description

@stariy95

Upgrading Ivy solves an annoying issue with missing classes from the transitive dependencies defined via %maven magic.

Steps to Reproduce

For the record, here are the maximally simplified steps to reproduce:

  1. rm -rf ~/.ivy2
  2. Create a notebook with the sections below (all dependencies are publicly-available on Maven central)
  3. Run it once (you'll get a DB connection error at the end, but that's fine. It is not the one we are chasing)
  4. Close the browser, stop jupyter
  5. Running jupyter and going through this notebook again causes NoClassDefFoundError below when instantiating the connector

I don't know if this is a coincidence, but the NoClassDefFoundError is always on the "invisible" dependency (i.e. the classes we don't interact with directly in the code). The failing class is org/slf4j/LoggerFactory, loaded via the following dependency chain: dflib-jupyter -> dflib-jdbc -> slf4j-api, when a class from dflib-jdbc (SimpleDataSource) is invoked explicitly.

Notebook code

%maven org.dflib:dflib-jupyter:1.0.0-M20
%maven org.postgresql:postgresql:42.7.2
import org.dflib.jupyter.*;
import org.dflib.*;
import org.dflib.jdbc.*;

DFLibJupyter.init(getKernelInstance());
var connector = Jdbc.connector("jdbc:postgresql://localhost:15432/")
    .userName("postgres")
    .password("test")
    .build();

connector

Error

ava.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
	at org.dflib.jdbc.datasource.SimpleDataSource.<clinit>(SimpleDataSource.java:19)
	at org.dflib.jdbc.connector.JdbcConnectorBuilder.createDataSource(JdbcConnectorBuilder.java:97)
	at org.dflib.jdbc.connector.JdbcConnectorBuilder.build(JdbcConnectorBuilder.java:76)
	at .do_it$Aux(#24:4)
	at .(#24:1)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions