[CONJ-904] Fails with javax.sql.rowset.serial.SerialException Created: 2021-11-14  Updated: 2022-03-04  Resolved: 2022-03-04

Status: Closed
Project: MariaDB Connector/J
Component/s: JDBC 4.2 compatibility
Affects Version/s: 2.7.2, 2.7.3, 2.7.4
Fix Version/s: N/A

Type: Bug Priority: Major
Reporter: Andy Gegg Assignee: Diego Dupin
Resolution: Not a Bug Votes: 2
Labels: None
Environment:

Windows 10


Issue Links:
Blocks
blocks CONJ-871 OSGi: Missing Import-Package in Conne... Closed

 Description   

Attempt to connect with DriverManager.getConnection fails with
java.lang.NoClassDefFoundError: javax/sql/rowset/serial/SerialException
at org.mariadb.jdbc.internal.util.Utils.retrieveProxy(Utils.java:632)
at org.mariadb.jdbc.internal.util.pool.Pool.addConnection(Pool.java:215)
at org.mariadb.jdbc.internal.util.pool.Pool.<init>(Pool.java:125)
at org.mariadb.jdbc.internal.util.pool.Pools.retrievePool(Pools.java:54)
at org.mariadb.jdbc.MariaDbConnection.newConnection(MariaDbConnection.java:147)
at org.mariadb.jdbc.Driver.connect(Driver.java:89)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:681)
at java.sql/java.sql.DriverManager.getConnection(DriverManager.java:252)
at sqlimpl/uk.co.gardennotebook.mysql.DBConnection.getConnection(DBConnection.java:224)
at sqlimpl/uk.co.gardennotebook.mysql.DBConnection.setConnection(DBConnection.java:186)
at sqlimpl/uk.co.gardennotebook.mysql.SQLTrug.isAvailable(SQLTrug.java:191)
at spi@3.0.0-SNAPSHOT/uk.co.gardennotebook.spi.TrugServer.checkTrug(TrugServer.java:146)
at gui@3.0.0-SNAPSHOT/uk.co.gardennotebook.NotebookConfig.handleApplyForLogin(NotebookConfig.java:1007)
at gui@3.0.0-SNAPSHOT/uk.co.gardennotebook.NotebookConfig.btnApplyOnAction(NotebookConfig.java:481)
... 61 more
Caused by: java.lang.ClassNotFoundException: javax.sql.rowset.serial.SerialException
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)
... 75 more

The parameter value for getConnection is:
jdbc:mariadb://synology215:3307/mydatabase?user=user&password=password&useSSL=false&allowPublicKeyRetrieval=true&sslMode=DISABLED&pool&minPoolSize=2&connectTimeout=1000

Version 2.7.0 works OK. I've not tried 3.0.0.
This is similar to CONJ-871 but the environment is plain vanilla Java, desktop application.



 Comments   
Comment by Florian Dickbauer [ 2022-01-21 ]

Hi,

I'm observing the same error on all versions higher than 2.7.1. Haven't tried 3.0.0 yet.

Running it on Java 11.0.13 with Spring Boot version 2.6.2 and Hibernate 5.6.3.

BR

Comment by Diego Dupin [ 2022-01-21 ]

NoClassDefFoundError error, not ClassNotFoundException.

Do you use some module-info for your project ? if so can you add dependency "java.sql.rowset" ?

Comment by Andy Gegg [ 2022-01-21 ]

Hi DIego,
I added

requires java.sql.rowset;

to the module-info class and it now works without problem (version 2.7.4, no others tested).
I will try 3.0.0 and report any problems.

Many thanks,
Andy

Comment by Andy Gegg [ 2022-01-21 ]

Hi,
Further to this, I've tried 3.0.2-rc in Maven (there's no download
available) and this also works ok.  It also seems to work without adding
java.sql.rowset to the module-info.

I hope this has been of help,
Andy

Comment by Florian Dickbauer [ 2022-01-21 ]

Hi,

I found the error. The JVM we're using was missing the module "java.sql.rowset". Added the missing module now everything is running fine.

Sorry for reporting this as and error and wasting your time.

Many thanks,
Florian

Generated at Thu Feb 08 03:19:10 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.