A DESCRIPTION OF THE REQUEST :
When DriverManager loads Drivers using the ServiceLoader, any ServiceConfigurationErrors thrown by ServiceLoader are ignored. There are two issues with this code as it is:
1.) Bogus/Incomplete Drivers are very hard to diagnose, as the ServiceConfigurationError doesn't show up anywhere.
2.) Driver initialization is aborted immediately, i.e. Drivers that would be loaded after a bogus Driver aren't loaded at all.
JUSTIFICATION :
Issues with Driver initialization are right now VERY hard to diagnose, as the corresponding ServiceConfigurationError can only be seen within a debugger. With the ServiceConfigurationError logged properly, it would be immediately obvious what's wrong with that Driver, e.g. missing dependencies or the like.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I propose to improve DriverManager by
a) logging the ServiceConfigurationError using the existing logWriter
b) to keep going with initialization of remaining Drivers after a ServiceConfigurationError
Note that in Java 8 (and also 7), logging from the #loadInitialDrivers method is essentially broken, as that method is called from DriverManager's static initializier and there's no way to set a log writer (using DriverManager#setLogWriter) before that. In Java 9, initialization seems to have been tweaked to be performed lazily (again) (seeJDK-8067904), so logging the initialization process should work fine again.
When DriverManager loads Drivers using the ServiceLoader, any ServiceConfigurationErrors thrown by ServiceLoader are ignored. There are two issues with this code as it is:
1.) Bogus/Incomplete Drivers are very hard to diagnose, as the ServiceConfigurationError doesn't show up anywhere.
2.) Driver initialization is aborted immediately, i.e. Drivers that would be loaded after a bogus Driver aren't loaded at all.
JUSTIFICATION :
Issues with Driver initialization are right now VERY hard to diagnose, as the corresponding ServiceConfigurationError can only be seen within a debugger. With the ServiceConfigurationError logged properly, it would be immediately obvious what's wrong with that Driver, e.g. missing dependencies or the like.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
I propose to improve DriverManager by
a) logging the ServiceConfigurationError using the existing logWriter
b) to keep going with initialization of remaining Drivers after a ServiceConfigurationError
Note that in Java 8 (and also 7), logging from the #loadInitialDrivers method is essentially broken, as that method is called from DriverManager's static initializier and there's no way to set a log writer (using DriverManager#setLogWriter) before that. In Java 9, initialization seems to have been tweaked to be performed lazily (again) (see