You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by mtod <mt...@thetods.net> on 2015/09/10 23:21:12 UTC

ActiveMQ JDBC persistence with MSSql

I'm trying to setup a MSSQL JDBC persistence and I keep getting the same
error.

My setup is ActiveMQ 5.12.0 on Windows 2012 R2 with JAVA 1.8

I downloaded and installed the MS Drivers.

*My ActiveMQ.xml is using the default and the only thing I added was :*

	
	<bean id="mssql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
		<property name="driverClassName"
value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
		<property name="url"
value="jdbc:sqlserver://dbdev003.corp.local:1433;databaseName=ActiveMQJournal;user=srv_activemqDEV;password=srv_activemqDEV1"/>
		<property name="username" value="srv_activemqDEV"/>
		<property name="password" value="srv_activemqDEV1"/>
	</bean>


*Console Error:*

ERROR: *org.springframework.beans.factory.CannotLoadBeanClassException:
Cannot find class [org.apache.commons.dbcp.BasicDataSource]* for bean with
name 'mssql-ds' defined in class path resource [activemq.xml
]; nested exception is java.lang.ClassNotFoundException:
org.apache.commons.dbcp.BasicDataSource
org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
class [org.apache.commons.dbcp.BasicDataSource] for bean with name
'mssql-ds' defined in class path resource [activemq.xml]; nest
ed exception is java.lang.ClassNotFoundException:
org.apache.commons.dbcp.BasicDataSource


I tried placing the commons-dbcp2-2.1 into the /lib folder and no luck same
with the drivers.

Thanks

Mike



--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-JDBC-persistence-with-MSSql-tp4701883.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ JDBC persistence with MSSql

Posted by Tim Bain <tb...@alumni.duke.edu>.
Can you provide a link to the documentation you're referring to?
On Sep 10, 2015 3:52 PM, "mtod" <mt...@thetods.net> wrote:

> Thanks for the quick reply.
>
> Good catch that resolved the problem.
>
> I was using the default activemq config and I guess they have not updated
> the documentation.
>
> Mike
>
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-JDBC-persistence-with-MSSql-tp4701883p4701885.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>

Re: ActiveMQ JDBC persistence with MSSql

Posted by mtod <mt...@thetods.net>.
Thanks for the quick reply.

Good catch that resolved the problem.

I was using the default activemq config and I guess they have not updated
the documentation.

Mike




--
View this message in context: http://activemq.2283324.n4.nabble.com/ActiveMQ-JDBC-persistence-with-MSSql-tp4701883p4701885.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Re: ActiveMQ JDBC persistence with MSSql

Posted by Christopher Shannon <ch...@gmail.com>.
The class can't be found because it isn't part of dbcp 2.
 org.apache.commons.dbcp.BasicDataSource is the package for dbcp 1.x not 2.x

Take a look at:
https://commons.apache.org/proper/commons-dbcp/apidocs/org/apache/commons/dbcp2/BasicDataSource.html

You should be using org.apache.commons.dbcp2.BasicDataSource if you want to
use dbcp2

-Chris

On Thu, Sep 10, 2015 at 5:21 PM, mtod <mt...@thetods.net> wrote:

> I'm trying to setup a MSSQL JDBC persistence and I keep getting the same
> error.
>
> My setup is ActiveMQ 5.12.0 on Windows 2012 R2 with JAVA 1.8
>
> I downloaded and installed the MS Drivers.
>
> *My ActiveMQ.xml is using the default and the only thing I added was :*
>
>
>         <bean id="mssql-ds" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
>                 <property name="driverClassName"
> value="com.microsoft.sqlserver.jdbc.SQLServerDriver"/>
>                 <property name="url"
>
> value="jdbc:sqlserver://dbdev003.corp.local:1433;databaseName=ActiveMQJournal;user=srv_activemqDEV;password=srv_activemqDEV1"/>
>                 <property name="username" value="srv_activemqDEV"/>
>                 <property name="password" value="srv_activemqDEV1"/>
>         </bean>
>
>
> *Console Error:*
>
> ERROR: *org.springframework.beans.factory.CannotLoadBeanClassException:
> Cannot find class [org.apache.commons.dbcp.BasicDataSource]* for bean with
> name 'mssql-ds' defined in class path resource [activemq.xml
> ]; nested exception is java.lang.ClassNotFoundException:
> org.apache.commons.dbcp.BasicDataSource
> org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find
> class [org.apache.commons.dbcp.BasicDataSource] for bean with name
> 'mssql-ds' defined in class path resource [activemq.xml]; nest
> ed exception is java.lang.ClassNotFoundException:
> org.apache.commons.dbcp.BasicDataSource
>
>
> I tried placing the commons-dbcp2-2.1 into the /lib folder and no luck same
> with the drivers.
>
> Thanks
>
> Mike
>
>
>
> --
> View this message in context:
> http://activemq.2283324.n4.nabble.com/ActiveMQ-JDBC-persistence-with-MSSql-tp4701883.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>