Some of DataSourceFactory implementations (namely DriverDataSourceFactory, PropertyDataSourceFactory and XMLPoolingDataSourceFactory) use AdhocObjectFactory to create Driver instance. This have one nasty side effect: DI field injection is used in a process and it can lead to errors.
This is an exception that is thrown by SAP HANA driver in that case:
I believe we should use only getJavaClass() method of AdhocObjectFactory. As a more distant solution we can check usage of DriverManager instead of detecting and using Driver explicitly.