>>>>> Jean-Baptiste Onofré <[email protected]>: > The "classic" workaround for Class.forName() is to use a TCCL > (ThreadContextClassLoader).
Thanks for the tip. Turns out it was a Class.forName() issue, but not in the PostgreSQL JDBC driver, but in rt.jar where it could not easily be fixed: https://github.com/pgjdbc/pgjdbc/issues/1476 The comparison between the class of the driver and result of Class.forName() of the driver's name returns false: private static boolean isDriverAllowed(Driver driver, ClassLoader classLoader) { boolean result = false; if(driver != null) { Class<?> aClass = null; try { aClass = Class.forName(driver.getClass().getName(), true, classLoader); } catch (Exception ex) { result = false; } result = ( aClass == driver.getClass() ) ? true : false; } return result; } Before the bundle reload, this comparison works (I've remote debugged through the getConnection() method for both cases).
