Could not find or load main class org.hsqldb.cmdline.SqlTool when launching hsqldb-sqltool

Bug #1909811 reported by Michael von Glasow
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
hsqldb (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

To reproduce:

1. Ensure libhsqldb-hava and hsqldb-utils are installed.
2. Open a terminal window and run hsqldb-sqltool

Alternatively:

1. Start HSQLDB in server mode
2. Try to stop the running instance by running:
java -cp $CLASSPATH:/usr/share/java/hsqldbutil.jar:/usr/share/java/hsqldb.jar "org.hsqldb.cmdline.SqlTool" --inlineRc=url=jdbc:hsqldb:hsql://localhost/$DB_NAME,user=SA,password= --sql="SHUTDOWN;"

Expected result:

I get the HSQLDB command-line interface (or at least a message about missing parameters). For the alternative use case, the DB shuts down.

Actual result:

In both cases, the CLI fails to launch with the following error:

    Error: Could not find or load main class org.hsqldb.cmdline.SqlTool
    Caused by: java.lang.ClassNotFoundException: org.hsqldb.cmdline.SqlTool

Additional information:

This worked without issues on Ubuntu 18.04 but stopped working after I upgraded to 20.04. I suspect there is something wrong with the JARs in the libhsqldb-java package on 20.04.

Looking at the contents of libhsqldb-java, I see it installs two jar files: hsqldb-2.4.1.jar and hsqldbutil-2.5.0.jar. This looks to me as if the two JARs are taken from different versions. As Fred Toussi (maintainer of HSQLDB) writes at https://stackoverflow.com/questions/65514193/hsqldb-command-line-shutdown-no-longer-works-after-upgrade, mixing JARs from different releases will not work properly.

ProblemType: Bug
DistroRelease: Ubuntu 20.04
Package: libhsqldb-java 2.5.0-1build2
ProcVersionSignature: Ubuntu 5.4.0-56.62-generic 5.4.73
Uname: Linux 5.4.0-56-generic x86_64
ApportVersion: 2.20.11-0ubuntu27.14
Architecture: amd64
CasperMD5CheckResult: skip
CurrentDesktop: MATE
Date: Fri Jan 1 15:45:56 2021
Dependencies: libservlet-api-java 4.0.1-2
EcryptfsInUse: Yes
InstallationDate: Installed on 2014-12-09 (2214 days ago)
InstallationMedia: Ubuntu MATE 14.10 "Utopic Unicorn" - amd64 (20141023)
PackageArchitecture: all
SourcePackage: hsqldb
UpgradeStatus: Upgraded to focal on 2020-11-17 (44 days ago)

Revision history for this message
Michael von Glasow (michael-vonglasow) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in hsqldb (Ubuntu):
status: New → Confirmed
Revision history for this message
Christian Sarrasin (sxc731) wrote :

A manual workaround that works on Jammy: https://stackoverflow.com/a/71350461/645016

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.