So, I am attempting to use the Day Commons JDBC Connection Pool feature of AEM to hit my SQL Server instance. I am getting the impression, based on the thread I have linked in (below) that it is not really possible?
So, on my local instance I am getting the following error (on startup) even though I have the class in question loaded to the environment as part of an OSGi bundle. Any ideas what might be going on and/or how to fix it?
21.03.2016 15:26:36.728 *ERROR* [CM Event Dispatcher (Fire ConfigurationEvent: pid=com.day.commons.datasource.jdbcpool.JdbcPoolService.2cfd4c3b-61c9-44ce-9f0b-266b71bbb41e)] day.commons.datasource.jdbcpool [com.day.commons.datasource.jdbcpool.JdbcPoolService(513)] The activate method has thrown an exception (java.lang.IllegalArgumentException: Cannot initialize driver 'com.microsoft.sqlserver.jdbc.SQLServerDriver') java.lang.IllegalArgumentException: Cannot initialize driver 'com.microsoft.sqlserver.jdbc.SQLServerDriver' at com.day.commons.datasource.jdbcpool.JdbcPoolService.initalizeDriver(JdbcPoolService.java:301) at com.day.commons.datasource.jdbcpool.JdbcPoolService.setupDataSource(JdbcPoolService.java:227) at com.day.commons.datasource.jdbcpool.JdbcPoolService.activate(JdbcPoolService.java:174) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:222) at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:37) at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:615) at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:499) at org.apache.felix.scr.impl.helper.ActivateMethod.invoke(ActivateMethod.java:295) at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:302) at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:113) at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:847) at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:814) at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:763) at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistrationImpl.java:343) at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.java:243) at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:357) at org.apache.felix.framework.Felix.getService(Felix.java:3671) at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:470) at org.apache.felix.scr.impl.manager.SingleRefPair.getServiceObject(SingleRefPair.java:72) at org.apache.felix.scr.impl.helper.BindMethod.getServiceObject(BindMethod.java:646) at org.apache.felix.scr.impl.manager.DependencyManager.getServiceObject(DependencyManager.java:2130) at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager.java:1644) at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.java:1629) at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponentManager.java:370) at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:319) at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedService(DependencyManager.java:295) at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1215) at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.java:1136) at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTracker.java:945) at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.java:881) at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.java:1167) at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComponentActivator.java:120) at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispatcher.java:987) at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java:838) at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:545) at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4547) at org.apache.felix.framework.Felix.registerService(Felix.java:3521) at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348) at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:869) at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentManager.java:857) at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationManager.java:133) at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractComponentManager.java:915) at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:715) at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:627) at org.apache.felix.scr.impl.manager.SingleComponentManager.reconfigure(SingleComponentManager.java:566) at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.configurationUpdated(ConfigurableComponentHolder.java:419) at org.apache.felix.scr.impl.config.ConfigurationSupport.configurationEvent(ConfigurationSupport.java:315) at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.sendEvent(ConfigurationManager.java:2032) at org.apache.felix.cm.impl.ConfigurationManager$FireConfigurationEvent.run(ConfigurationManager.java:2002) at org.apache.felix.cm.impl.UpdateThread.run(UpdateThread.java:103) at java.lang.Thread.run(Unknown Source) Caused by: java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver not found by day.commons.datasource.jdbcpool [208] at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1557) at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:79) at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1998) at java.lang.ClassLoader.loadClass(Unknown Source) at com.day.commons.datasource.jdbcpool.JdbcPoolService.initalizeDriver(JdbcPoolService.java:298) ... 54 common frames omitted
Views
Replies
Total Likes
"com.microsoft.sqlserver.jdbc.SQLServerDriver not found by day.commons.datasource.jdbcpool" this means that the MS Database Driver file (JAR) file has not been placed into an OSGi bundle and deployed. See how we handle the MySQL JAR driver file in this article:
https://helpx.adobe.com/experience-manager/using/datasourcepool.html
Next week - after Digital Marketing summit - we will write an article on this use case
Views
Replies
Total Likes
In the other thread - the only difference was app logic to open a connection to the DB was coded in Java. You can do that or use a DataSourcePool. However - you need to wrap the MS Database driver (SQL server) into an OSGi bundle .
Views
Replies
Total Likes
Hi
As mentioned by Scott,
"com.microsoft.sqlserver.jdbc.SQLServerDriver not found by day.commons.datasource.jdbcpool" this means that the MS Database Driver file (JAR) file has not been placed into an OSGi bundle and deployed.
Please have a look at reference links:
Link1: https://helpx.adobe.com/experience-manager/using/querying-persisting-cq-data-mysql.html
//Querying and Persisting Adobe AEM data into MySQL
Link2: https://helpx.adobe.com/experience-manager/using/creating-cq-web-application-uses.html
//Creating an Adobe CQ web application that uses MySQL
Link3: https://helpx.adobe.com/experience-manager/using/datasourcepool.html
//Injecting a DataSourcePool Service into an Adobe Experience Manager OSGi bundle
I hope this would act as some help to you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies