How can I solve Modularity related issue ?
mandy.chung at oracle.com
Sat Sep 29 00:35:01 UTC 2018
On 9/28/18 1:59 AM, Alan Bateman wrote:
> 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.
It does look like related to the de-privileging of java.sql.rowset
module. JDBC rowset implementation just happened to work in the past as
it was defined to the bootstrap class loader.
I have created JBS issue for this:
More information about the core-libs-dev