Why broker plugin cannot find jdbc driver in JBoss A-MQ ?
Issue
- We have developed a plugin for AMQ but it needs to connect to a database for some information. However it is unable to find the jdbc driver for SQL Server. The plugin itself is working but fails when trying to create the DB connection. We have tried to place the driver
sqljdbc4.jarin thelibdirectory and tried to install it but it is still unable to find the driver.
java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc.SQLServerDriver not found by wrap_file_C__jboss-a-mq-6.1.1.redhat-412_lib_Test_AMQ_Plugin.jar [154]
at org.apache.felix.framework.BundleWiringImpl.findClassOrResourceByDelegation(BundleWiringImpl.java:1532)[org.apache.felix.framework-4.0.3.redhat-611412.jar:]
at org.apache.felix.framework.BundleWiringImpl.access$400(BundleWiringImpl.java:75)[org.apache.felix.framework-4.0.3.redhat-611412.jar:]
at org.apache.felix.framework.BundleWiringImpl$BundleClassLoader.loadClass(BundleWiringImpl.java:1955)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)[:1.7.0_55]
at java.lang.Class.forName0(Native Method)[:1.7.0_55]
at java.lang.Class.forName(Class.java:190)[:1.7.0_55]
at test.custom.plugin.JDBCAuthBroker.DBConnect(JDBCAuthBroker.java:33)[154:wrap_file_C__jboss-a-mq-6.1.1.redhat-412_lib_Test_AMQ_Plugin.jar:0]
at test.custom.plugin.JDBCAuthBroker.<init>(JDBCAuthBroker.java:53)[154:wrap_file_C__jboss-a-mq-6.1.1.redhat-412_lib_Test_AMQ_Plugin.jar:0]
at test.custom.plugin.JDBCAuthPlugin.installPlugin(JDBCAuthPlugin.java:18)[154:wrap_file_C__jboss-a-mq-6.1.1.redhat-412_lib_Test_AMQ_Plugin.jar:0]
at org.apache.activemq.broker.BrokerService.addInterceptors(BrokerService.java:2295)[122:org.apache.activemq.activemq-osgi:5.9.0.redhat-611412]
at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:2156)[122:org.apache.activemq.activemq-osgi:5.9.0.redhat-611412]
at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:937)[122:org.apache.activemq.activemq-osgi:5.9.0.redhat-611412]
at org.apache.activemq.broker.BrokerService.getAdminConnectionContext(BrokerService.java:2426)[122:org.apache.activemq.activemq-osgi:5.9.0.redhat-611412]
at org.apache.activemq.broker.BrokerService.startVirtualConsumerDestinations(BrokerService.java:2566)[122:org.apache.activemq.activemq-osgi:5.9.0.redhat-611412]
at org.apache.activemq.broker.BrokerService.startDestinations(BrokerService.java:2417)[122:org.apache.activemq.activemq-osgi:5.9.0.redhat-611412]
at org.apache.activemq.broker.BrokerService.doStartBroker(BrokerService.java:667)[122:org.apache.activemq.activemq-osgi:5.9.0.redhat-611412]
at org.apache.activemq.broker.BrokerService.startBroker(BrokerService.java:659)[122:org.apache.activemq.activemq-osgi:5.9.0.redhat-611412]
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:595)[122:org.apache.activemq.activemq-osgi:5.9.0.redhat-611412]
at org.fusesource.mq.fabric.ActiveMQServiceFactory$ClusteredConfiguration.org$fusesource$mq$fabric$ActiveMQServiceFactory$ClusteredConfiguration$$doStart(ActiveMQServiceFactory.scala:449)[136:org.jboss.amq.mq-fabric:6.1.1.redhat-412]
at org.fusesource.mq.fabric.ActiveMQServiceFactory$ClusteredConfiguration$$anon$4.run(ActiveMQServiceFactory.scala:378)[136:org.jboss.amq.mq-fabric:6.1.1.redhat-412]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)[:1.7.0_55]
at java.util.concurrent.FutureTask.run(FutureTask.java:262)[:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)[:1.7.0_55]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)[:1.7.0_55]
at java.lang.Thread.run(Thread.java:745)[:1.7.0_55]
Environment
- Red Hat JBoss A-MQ
- 6.1.0
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
