How can I solve Modularity related issue ?
Alan.Bateman at oracle.com
Fri Sep 28 08:59:39 UTC 2018
On 28/09/2018 08:28, Ichiroh Takiguchi wrote:
> One of JDBC application with JavaDB did not work on JDK12.
> Following exception happened:
> java.sql.SQLException: No suitable driver found for jdbc:derby:xxxxxx
> I assume, this issue related Modularity feature...
> I could not solve this issue by myself.
I suspect this is related to the de-privileging of the java.sql.rowset
module in JDK 9. The java.sql.rowset module is mapped to the platform
class loader whereas historically the types in this module were defined
by the boot class loader. This is relevant because java.sql.rowset is
making use of the java.sql.DriverManager (in the java.sql module) and
DriverManager is caller sensitive so it sees the caller coming from
java.sql.rowset. This is problematic because the JDBC driver is on the
class path and is not visible to the caller's class loader. The
visibility check has always been in JDBC and I suspect this usage in the
JDBC Rowset implementation only worked by accident in the past because
DriverManager used the TCCL when called from code defined to the
bootstrap class loader. I'm sure Lance will jump in but all previous
investigations into changing behavior going back 20+ has come to nothing
due to compatibility concerns.
More information about the core-libs-dev