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

Commons Lang 3 missing from Lib folder #1560

Closed
giamma opened this issue May 24, 2024 · 7 comments
Closed

Commons Lang 3 missing from Lib folder #1560

giamma opened this issue May 24, 2024 · 7 comments
Assignees
Labels

Comments

@giamma
Copy link

giamma commented May 24, 2024

Description

The zip distribution is missing Commons Lang 3 from _schemacrawler/lib folder

How to Reproduce

No response

Relevant log output

No response

SchemaCrawler Version

16.21.2

Java Version

17

Operating System and Version

MacOS Sonoma

Relational Database System and Version

Oracle 19c

JDBC Driver and Version

21.11.00 as bundled with schemacrawler

@sualeh
Copy link
Collaborator

sualeh commented May 27, 2024

@giamma How is this affecting your use of SchemaCrawler? This is not a runtime dependency of SchemaCrawler.

@giamma
Copy link
Author

giamma commented May 28, 2024

Sorry, I did not put further details because I thought this was a trivial packaging mistake and you would be immediately aware of the issue.

In absence of commons-lang 3 I get a stacktrace at runtime due to a NoClassDefFoundError with the following commandline:

./schemacrawler.sh --log-level=CONFIG --url=myjdbcurl --user=user --password=pass --portable-names --info-level=standard --command=brief --output-file=schema.svg --output-format=svg

May 28, 2024 9:29:28 AM us.fatehi.utility.UtilityLogger logFatalStackTrace SEVERE: Could not instantiate class schemacrawler.tools.commandline.command.AvailableServers: schemacrawler.schemacrawler.exceptions.InternalRuntimeException: Could not instantiate class <class schemacrawler.tools.commandline.command.AvailableServers> picocli.CommandLine$InitializationException: Could not instantiate class schemacrawler.tools.commandline.command.AvailableServers: schemacrawler.schemacrawler.exceptions.InternalRuntimeException: Could not instantiate class <class schemacrawler.tools.commandline.command.AvailableServers> at picocli.CommandLine$DefaultFactory.create(CommandLine.java:5687) at picocli.CommandLine$DefaultFactory.createCompletionCandidates(CommandLine.java:5677) at picocli.CommandLine$Model$ArgSpec$Builder.<init>(CommandLine.java:9576) at picocli.CommandLine$Model$OptionSpec$Builder.<init>(CommandLine.java:10137) at picocli.CommandLine$Model$OptionSpec$Builder.<init>(CommandLine.java:10114) at picocli.CommandLine$Model$OptionSpec.builder(CommandLine.java:9990) at picocli.CommandLine$Model$CommandReflection.buildArgForMember(CommandLine.java:12063) at picocli.CommandLine$Model$CommandReflection.initFromAnnotatedTypedMembers(CommandLine.java:11965) at picocli.CommandLine$Model$CommandReflection.initFromAnnotatedMembers(CommandLine.java:11913) at picocli.CommandLine$Model$CommandReflection.extractArgGroupSpec(CommandLine.java:11793) at picocli.CommandLine$Model$CommandReflection.buildArgGroupForMember(CommandLine.java:12069) at picocli.CommandLine$Model$CommandReflection.initFromAnnotatedTypedMembers(CommandLine.java:11947) at picocli.CommandLine$Model$CommandReflection.initFromAnnotatedMembers(CommandLine.java:11913) at picocli.CommandLine$Model$CommandReflection.extractArgGroupSpec(CommandLine.java:11793) at picocli.CommandLine$Model$CommandReflection.buildArgGroupForMember(CommandLine.java:12069) at picocli.CommandLine$Model$CommandReflection.initFromAnnotatedTypedMembers(CommandLine.java:11949) at picocli.CommandLine$Model$CommandReflection.initFromAnnotatedMembers(CommandLine.java:11913) at picocli.CommandLine$Model$CommandReflection.extractCommandSpec(CommandLine.java:11846) at picocli.CommandLine$Model$CommandSpec.forAnnotatedObject(CommandLine.java:6388) at picocli.CommandLine$Model$CommandReflection.buildMixinForMember(CommandLine.java:12054) at picocli.CommandLine$Model$CommandReflection.initFromAnnotatedTypedMembers(CommandLine.java:11934) at picocli.CommandLine$Model$CommandReflection.initFromAnnotatedMembers(CommandLine.java:11913) at picocli.CommandLine$Model$CommandReflection.extractCommandSpec(CommandLine.java:11846) at picocli.CommandLine$Model$CommandSpec.forAnnotatedObject(CommandLine.java:6388) at picocli.CommandLine.<init>(CommandLine.java:230) at picocli.CommandLine.<init>(CommandLine.java:224) at schemacrawler.tools.commandline.utility.CommandLineUtility.newCommandLine(CommandLineUtility.java:161) at schemacrawler.tools.commandline.SchemaCrawlerCommandLine.execute(SchemaCrawlerCommandLine.java:68) at schemacrawler.Main.main(Main.java:67) Caused by: schemacrawler.schemacrawler.exceptions.InternalRuntimeException: Could not instantiate class <class schemacrawler.tools.commandline.command.AvailableServers> at schemacrawler.tools.commandline.state.StateFactory.create(StateFactory.java:55) at picocli.CommandLine$DefaultFactory.create(CommandLine.java:5683) ... 28 more Caused by: java.lang.reflect.InvocationTargetException at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:77) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:499) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:480) at picocli.CommandLine$DefaultFactory.create(CommandLine.java:5658) at schemacrawler.tools.commandline.state.StateFactory.create(StateFactory.java:52) ... 29 more Caused by: schemacrawler.schemacrawler.exceptions.InternalRuntimeException: Could not load database drivers: org/apache/commons/lang3/StringUtils at schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry.loadJdbcDrivers(DatabaseConnectorRegistry.java:131) at schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry.<init>(DatabaseConnectorRegistry.java:141) at schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry.getDatabaseConnectorRegistry(DatabaseConnectorRegistry.java:61) at schemacrawler.tools.commandline.command.AvailableServers.availableServers(AvailableServers.java:42) at schemacrawler.tools.commandline.command.AvailableServers.<init>(AvailableServers.java:53) ... 36 more Caused by: java.lang.NoClassDefFoundError: org/apache/commons/lang3/StringUtils at com.ing.data.cassandra.jdbc.utils.DriverUtil.safeParseVersion(DriverUtil.java:115) at com.ing.data.cassandra.jdbc.CassandraDriver.getMajorVersion(CassandraDriver.java:113) at schemacrawler.tools.databaseconnector.DatabaseConnectorRegistry.loadJdbcDrivers(DatabaseConnectorRegistry.java:123) ... 40 more Caused by: java.lang.ClassNotFoundException: org.apache.commons.lang3.StringUtils ... 43 more

@sualeh
Copy link
Collaborator

sualeh commented May 30, 2024

@giamma I am not able to reproduce the error using Java 17 on Windows. I do not have access to a Mac, but it should not really matter. Try removing the Cassandra driver from the lib folder. Please delete two jars files whose names start with "cassandra". Please let me know if that works.

@sualeh
Copy link
Collaborator

sualeh commented Jun 18, 2024

Closing due to no activity.

@sualeh sualeh closed this as completed Jun 18, 2024
@giamma
Copy link
Author

giamma commented Jun 18, 2024

Hi, I confirm that after removing Cassandra jars from the lib folder I don't need commons lang 3 anymore.

@kyrias
Copy link

kyrias commented Aug 1, 2024

We're also encountering this on Java 17 on Linux. And deleting the two Cassandra JARs indeed resolves it.

@sualeh sualeh reopened this Aug 4, 2024
sualeh added a commit that referenced this issue Aug 4, 2024
Fixes issue #1560 by not distributing the Cassandra drivers
@sualeh
Copy link
Collaborator

sualeh commented Aug 5, 2024

Fixed in SchemaCrawler v16.22.2

@sualeh sualeh closed this as completed Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants