DataSourcePool service injection failure
I'm trying to use the OOB DataSourcePool service to connect to a MySQL from AEM in order to run a basic query Nothing fancy. After installing my driver and setting up the connection parameters through the system console, I'm able to fetch data from the DB without any problem when accessing the DataSourcePool from a jsp page as follows:
DataSourcePool service = sling.getService(DataSourcePool.class);
However, I'm unable to fetch data from the DB when I try to access the DataSourcePool from another OSGI service through service injection as follows:
@Reference
private DataSourcePool service;
The latter throws an exception at the time the system is attempting to inject the service (I believe), which says the following:
The bindSource method has thrown an exception (java.lang.IllegalArgumentException: argument type mismatch)
Subsequently the service variable is null when I attempt to de-reference it.
Any ideas?
Thanks!
