If official documentation is wrong, I would like to get working example
from someone who actually uses ms SQL jdbc

On Feb 16, 2018 7:17 PM, "Thiago Veronezi" <thi...@veronezi.org> wrote:

> The official documentation might be out of date. This would be a nice
> opportunity for us to add some contribution. :)
>
> Anyway, I thought 'org.apache.commons.dbcp.BasicDataSource" was something
> installed out of the box. It seems to be missing.
>
> https://mvnrepository.com/artifact/commons-dbcp/commons-dbcp/1.4
> http://commons.apache.org/proper/commons-dbcp/api-1.4/index.html -> you
> will see our missing class here.
>
> Try adding it to the <activemq home>/lib directory.
>
> []s,
> Thiago.
>
>
> On Fri, Feb 16, 2018 at 12:01 PM, Илья Шипицин <chipits...@gmail.com>
> wrote:
>
> > well, I would definetly prefer to use official documentation.
> > why do I ever need to jump over sites and pick random things ?
> >
> > 2018-02-16 18:59 GMT+05:00 Tim Bain <tb...@alumni.duke.edu>:
> >
> > > Try the configuration in the answer to this question:
> > > https://stackoverflow.com/questions/8604229/setting-up-
> > > activemq-with-journaled-mysql-jdbc-persistence?rq=1
> > >
> > > On Feb 16, 2018 6:58 AM, "Илья Шипицин" <chipits...@gmail.com> wrote:
> > >
> > > > 2018-02-16 16:57:21,051 | INFO  | Refreshing
> > > > org.apache.activemq.xbean.XBeanBrokerFactory$1@6fd02e5: startup date
> > > [Fri
> > > > Feb 16 16:57:21 MSK 2018]; root of context hierarc
> > > > hy | org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
> > > > 2018-02-16 16:57:22,099 | WARN  | Exception encountered during
> context
> > > > initialization - cancelling refresh attempt:
> > > > org.springframework.beans.factory.BeanCreationExcepti
> > > > on: Error creating bean with name
> > > > 'org.apache.activemq.xbean.XBeanBrokerService#0' defined in class
> path
> > > > resource [activemq.xml]: Cannot create inner bean '(inner bean)#
> > > > 156b88f5' of type [org.apache.activemq.store.
> > > jdbc.JDBCPersistenceAdapter]
> > > > while setting bean property 'persistenceAdapter'; nested exception is
> > > > org.springframework.beans
> > > > .factory.BeanCreationException: Error creating bean with name
> '(inner
> > > > bean)#156b88f5' defined in class path resource [activemq.xml]: Cannot
> > > > resolve reference to bean 'ms
> > > > sql-ds' while setting bean property 'dataSource'; nested exception is
> > > > org.springframework.beans.factory.CannotLoadBeanClassException:
> Cannot
> > > > find
> > > > class [org.apache.commo
> > > > ns.dbcp.BasicDataSource] for bean with name 'mssql-ds' defined in
> class
> > > > path resource [activemq.xml]; nested exception is
> > > > java.lang.ClassNotFoundException: org.apache.co
> > > > mmons.dbcp.BasicDataSource | org.apache.activemq.xbean.
> > > > XBeanBrokerFactory$1
> > > > | main
> > > > 2018-02-16 16:57:22,109 | ERROR | Failed to load: class path resource
> > > > [activemq.xml], reason: Error creating bean with name
> > > > 'org.apache.activemq.xbean.XBeanBrokerService
> > > > #0' defined in class path resource [activemq.xml]: Cannot create
> inner
> > > bean
> > > > '(inner bean)#156b88f5' of type
> > > > [org.apache.activemq.store.jdbc.JDBCPersistenceAdapter] while
> > > >  setting bean property 'persistenceAdapter'; nested exception is
> > > > org.springframework.beans.factory.BeanCreationException: Error
> > creating
> > > > bean with name '(inner bean)#156
> > > > b88f5' defined in class path resource [activemq.xml]: Cannot resolve
> > > > reference to bean 'mssql-ds' while setting bean property
> 'dataSource';
> > > > nested exception is org.sprin
> > > > gframework.beans.factory.CannotLoadBeanClassException: Cannot find
> > class
> > > > [org.apache.commons.dbcp.BasicDataSource] for bean with name
> > 'mssql-ds'
> > > > defined in class path re
> > > > source [activemq.xml]; nested exception is
> > > > java.lang.ClassNotFoundException: org.apache.commons.dbcp.
> > > BasicDataSource
> > > > |
> > > > org.apache.activemq.xbean.XBeanBrokerFactory | mai
> > > > n
> > > >
> > > >
> > > > 2018-02-16 18:53 GMT+05:00 Thiago Veronezi <thi...@veronezi.org>:
> > > >
> > > > > Oh, I meant for you to test the config above, but replacing
> > > "postgres-ds"
> > > > > with your "mssql-ds".
> > > > > We will just test the connection without the journaling thing.
> > > > >
> > > > > []s,
> > > > > Thiago.
> > > > >
> > > > >
> > > > > On Fri, Feb 16, 2018 at 11:45 AM, Илья Шипицин <
> chipits...@gmail.com
> > >
> > > > > wrote:
> > > > >
> > > > > > sorry, I do not have postgresql here.
> > > > > >
> > > > > > I can set up a vm for you with ms sql if you wish
> > > > > >
> > > > > > 2018-02-16 18:44 GMT+05:00 Thiago Veronezi <thi...@veronezi.org
> >:
> > > > > >
> > > > > > > Hi,
> > > > > > >
> > > > > > > I don't have a mssql server handy for testing it. Can you try
> > > > > something?
> > > > > > >
> > > > > > > I have postgres configured with this...
> > > > > > >
> > > > > > > <persistenceAdapter>
> > > > > > >     <jdbcPersistenceAdapter dataSource="#postgres-ds">
> > > > > > >     </jdbcPersistenceAdapter>
> > > > > > > </persistenceAdapter>
> > > > > > >
> > > > > > >
> > > > > > > Can you try the same?
> > > > > > >
> > > > > > > []s,
> > > > > > > Thiago.
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On Fri, Feb 16, 2018 at 11:28 AM, Илья Шипицин <
> > > chipits...@gmail.com
> > > > >
> > > > > > > wrote:
> > > > > > >
> > > > > > > > log:
> > > > > > > >
> > > > > > > > 2018-02-16 16:27:55,841 | INFO  | Refreshing
> > > > > > > > org.apache.activemq.xbean.XBeanBrokerFactory$1@6fd02e5:
> > startup
> > > > date
> > > > > > > [Fri
> > > > > > > > Feb 16 16:27:55 MSK 2018]; root of context hierarchy |
> > > > > > > > org.apache.activemq.xbean.XBeanBrokerFactory$1 | main
> > > > > > > > 2018-02-16 16:27:56,249 | ERROR | Failed to load: class path
> > > > resource
> > > > > > > > [activemq.xml], reason: Line 38 in XML document from class
> path
> > > > > > resource
> > > > > > > > [activemq.xml] is invalid; nested exception is
> > > > > > > > org.xml.sax.SAXParseException; lineNumber: 3
> > > > > > > > 8; columnNumber: 102; cvc-complex-type.2.4.a: Invalid content
> > was
> > > > > found
> > > > > > > > starting with element 'journaledJDBC'. One of '{"
> > > > > > > > http://activemq.apache.org/schema/core":
> > jdbcPersistenceAdapter,
> > > "
> > > > > > > > http://activemq.apache.org/schema/core":journalP
> > > > > > > > ersistenceAdapter, "http://activemq.apache.org/schema/core
> > > > ":kahaDB,
> > > > > "
> > > > > > > > http://activemq.apache.org/schema/core":levelDB, "
> > > > > > > > http://activemq.apache.org/schema/core":mKahaDB, "
> > > > > > > > http://activemq.apache.org/schema/core":
> > > memoryPersistenceAdapter,
> > > > > > > >  "http://activemq.apache.org/schema/core":replicatedLevelDB,
> > > > > > > WC[##other:"
> > > > > > > > http://activemq.apache.org/schema/core"]}' is expected. |
> > > > > > > > org.apache.activemq.xbean.XBeanBrokerFactory | main
> > > > > > > > org.springframework.beans.factory.xml.
> > > > XmlBeanDefinitionStoreExceptio
> > > > > n:
> > > > > > > > Line
> > > > > > > > 38 in XML document from class path resource [activemq.xml] is
> > > > > invalid;
> > > > > > > > nested exception is org.xml.sax.SAXParseException;
> lineNumber:
> > > 38;
> > > > > > > > columnNumber: 102; c
> > > > > > > > vc-complex-type.2.4.a: Invalid content was found starting
> with
> > > > > element
> > > > > > > > 'journaledJDBC'. One of
> > > > > > > > '{"http://activemq.apache.org/schema/core":
> > > jdbcPersistenceAdapter,
> > > > > > > > "http://activemq.apache.org/schema/core":
> > > > journalPersistenceAdapter,
> > > > > > "htt
> > > > > > > > p://activemq.apache.org/schema/core":kahaDB, "
> > > > > > > > http://activemq.apache.org/schema/core":levelDB, "
> > > > > > > > http://activemq.apache.org/schema/core":mKahaDB, "
> > > > > > > > http://activemq.apache.org/schema/core":
> > > memoryPersistenceAdapter,
> > > > "
> > > > > > > > http://activemq.apach
> > > > > > > > e.org/schema/core":replicatedLevelDB, WC[##other:"
> > > > > > > > http://activemq.apache.org/schema/core"]}' is expected.
> > > > > > > >     at
> > > > > > > > org.springframework.beans.factory.xml.
> XmlBeanDefinitionReader.
> > > > > > > > doLoadBeanDefinitions(XmlBeanDefinitionReader.java:
> > > > > > > > 399)[spring-beans-4.3.9.RELEASE.jar:4.3.9.RELEASE]
> > > > > > > >     at
> > > > > > > > org.springframework.beans.factory.xml.
> XmlBeanDefinitionReader.
> > > > > > > > loadBeanDefinitions(XmlBeanDefinitionReader.java:
> > > > > > > 336)[spring-beans-4.3.9.
> > > > > > > > RELEASE.jar:4.3.9.RELEASE]
> > > > > > > >     at
> > > > > > > > org.springframework.beans.factory.xml.
> XmlBeanDefinitionReader.
> > > > > > > > loadBeanDefinitions(XmlBeanDefinitionReader.java:
> > > > > > > 304)[spring-beans-4.3.9.
> > > > > > > > RELEASE.jar:4.3.9.RELEASE]
> > > > > > > >     at
> > > > > > > > org.apache.xbean.spring.context.
> ResourceXmlApplicationContext.
> > > > > > > > loadBeanDefinitions(ResourceXmlApplicationContext.
> > > > > > > > java:111)[xbean-spring-4.2.jar:4.2]
> > > > > > > >     at
> > > > > > > > org.apache.xbean.spring.context.
> ResourceXmlApplicationContext.
> > > > > > > > loadBeanDefinitions(ResourceXmlApplicationContext.
> > > > > > > > java:104)[xbean-spring-4.2.jar:4.2]
> > > > > > > >
> > > > > > > >
> > > > > > > > config:
> > > > > > > >
> > > > > > > > <beans
> > > > > > > >   xmlns="http://www.springframework.org/schema/beans";
> > > > > > > >   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
> > > > > > > >   xsi:schemaLocation="http://www.springframework.org/
> > > schema/beans
> > > > > > > > http://www.springframework.org/schema/beans/spring-beans.xsd
> > > > > > > >   http://activemq.apache.org/schema/core
> > > > > > > > http://activemq.apache.org/schema/core/activemq-core.xsd";>
> > > > > > > >
> > > > > > > >     <bean
> > > > > > > > class="org.springframework.beans.factory.config.
> > > > > > > > PropertyPlaceholderConfigurer">
> > > > > > > >         <property name="locations">
> > > > > > > >             <value>file:${activemq.conf}/
> > > > > > credentials.properties</value>
> > > > > > > >         </property>
> > > > > > > >     </bean>
> > > > > > > >
> > > > > > > >     <bean id="logQuery" class="io.fabric8.insight.log.
> > > > > > > log4j.Log4jLogQuery"
> > > > > > > >           lazy-init="false" scope="singleton"
> > > > > > > >           init-method="start" destroy-method="stop">
> > > > > > > >     </bean>
> > > > > > > >
> > > > > > > >     <broker xmlns="http://activemq.apache.org/schema/core";
> > > > > > > > brokerName="localhost" dataDirectory="${activemq.data}">
> > > > > > > >
> > > > > > > >         <destinationPolicy>
> > > > > > > >             <policyMap>
> > > > > > > >               <policyEntries>
> > > > > > > >                 <policyEntry topic=">" >
> > > > > > > >                   <pendingMessageLimitStrategy>
> > > > > > > >                     <constantPendingMessageLimitStrategy
> > > > > > limit="1000"/>
> > > > > > > >                   </pendingMessageLimitStrategy>
> > > > > > > >                 </policyEntry>
> > > > > > > >               </policyEntries>
> > > > > > > >             </policyMap>
> > > > > > > >         </destinationPolicy>
> > > > > > > >
> > > > > > > >
> > > > > > > >         <managementContext>
> > > > > > > >             <managementContext createConnector="false"/>
> > > > > > > >         </managementContext>
> > > > > > > >
> > > > > > > >         <persistenceAdapter>
> > > > > > > >           <journaledJDBC journalLogFiles="5"
> > > > > > > > dataDirectory="../activemq-data" dataSource="#mssql-ds">
> > > > > > > >               <adapter><imageBasedJDBCAdaptor/></adapter>
> > > > > > > >           </journaledJDBC>
> > > > > > > >         </persistenceAdapter>
> > > > > > > >
> > > > > > > >           <systemUsage>
> > > > > > > >             <systemUsage>
> > > > > > > >                 <memoryUsage>
> > > > > > > >                     <memoryUsage percentOfJvmHeap="70" />
> > > > > > > >                 </memoryUsage>
> > > > > > > >                 <storeUsage>
> > > > > > > >                     <storeUsage limit="100 gb"/>
> > > > > > > >                 </storeUsage>
> > > > > > > >                 <tempUsage>
> > > > > > > >                     <tempUsage limit="50 gb"/>
> > > > > > > >                 </tempUsage>
> > > > > > > >             </systemUsage>
> > > > > > > >         </systemUsage>
> > > > > > > >
> > > > > > > >         <transportConnectors>
> > > > > > > >             <!-- DOS protection, limit concurrent connections
> > to
> > > > 1000
> > > > > > and
> > > > > > > > frame size to 100MB -->
> > > > > > > >             <transportConnector name="openwire" uri="tcp://
> > > > > > > > 0.0.0.0:61616?maximumConnections=1000&amp;
> > > wireFormat.maxFrameSize=
> > > > > > > > 104857600
> > > > > > > > "/>
> > > > > > > >             <transportConnector name="amqp" uri="amqp://
> > > > > > > > 0.0.0.0:5672?maximumConnections=1000&amp;
> > > wireFormat.maxFrameSize=
> > > > > > > 104857600
> > > > > > > > "/>
> > > > > > > >             <transportConnector name="stomp" uri="stomp://
> > > > > > > > 0.0.0.0:61613?maximumConnections=1000&amp;
> > > wireFormat.maxFrameSize=
> > > > > > > > 104857600
> > > > > > > > "/>
> > > > > > > >             <transportConnector name="mqtt" uri="mqtt://
> > > > > > > > 0.0.0.0:1883?maximumConnections=1000&amp;
> > > wireFormat.maxFrameSize=
> > > > > > > 104857600
> > > > > > > > "/>
> > > > > > > >             <transportConnector name="ws" uri="ws://
> > > > > > > > 0.0.0.0:61614?maximumConnections=1000&amp;
> > > wireFormat.maxFrameSize=
> > > > > > > > 104857600
> > > > > > > > "/>
> > > > > > > >         </transportConnectors>
> > > > > > > >
> > > > > > > >         <shutdownHooks>
> > > > > > > >             <bean xmlns="http://www.
> > springframework.org/schema/
> > > > beans
> > > > > "
> > > > > > > > class="org.apache.activemq.hooks.SpringContextHook" />
> > > > > > > >         </shutdownHooks>
> > > > > > > >
> > > > > > > >     </broker>
> > > > > > > >
> > > > > > > >     <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://HOST:PORT;databaseName=DBNAME"/>
> > > > > > > >       <property name="username" value="USER"/>
> > > > > > > >       <property name="password" value="PASSWORD"/>
> > > > > > > >     </bean>
> > > > > > > >
> > > > > > > >     <import resource="jetty.xml"/>
> > > > > > > >
> > > > > > > > </beans>
> > > > > > > >
> > > > > > > >
> > > > > > > > 2018-02-16 17:53 GMT+05:00 Thiago Veronezi <
> > thi...@veronezi.org
> > > >:
> > > > > > > >
> > > > > > > > > Can you share your configuration file?
> > > > > > > > >
> > > > > > > > > []s,
> > > > > > > > > Thiago.
> > > > > > > > >
> > > > > > > > >
> > > > > > > > > On Fri, Feb 16, 2018 at 8:44 AM, Илья Шипицин <
> > > > > chipits...@gmail.com>
> > > > > > > > > wrote:
> > > > > > > > >
> > > > > > > > > > hello,
> > > > > > > > > >
> > > > > > > > > > I'm trying to set up apache-activemq-5.15.3 + ms sql
> using
> > > the
> > > > > > > > following
> > > > > > > > > > guide:
> > > > > > > > > >
> > > > > > > > > > http://activemq.apache.org/sqlserver.html (2005 part)
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > I downloaded jdbc driver + changed config as in example,
> > > > however,
> > > > > > I'm
> > > > > > > > > > getting the following error:
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > >
> > > > > > > > > > 2018-02-16 12:39:45,340 | INFO  | Refreshing
> > > > > > > > > > org.apache.activemq.xbean.XBeanBrokerFactory$1@6fd02e5:
> > > > startup
> > > > > > date
> > > > > > > > > [Fri
> > > > > > > > > > Feb 16 12:39:45 MSK 2018]; root of context hierarc
> > > > > > > > > > hy | org.apache.activemq.xbean.XBeanBrokerFactory$1 |
> main
> > > > > > > > > > 2018-02-16 12:39:46,335 | ERROR | Failed to load: class
> > path
> > > > > > resource
> > > > > > > > > > [activemq.xml], reason: Line 83 in XML document from
> class
> > > path
> > > > > > > > resource
> > > > > > > > > > [activemq.xml] is invalid;
> > > > > > > > > >  nested exception is org.xml.sax.SAXParseException;
> > > lineNumber:
> > > > > 83;
> > > > > > > > > > columnNumber: 94; cvc-complex-type.2.4.a: Invalid content
> > was
> > > > > found
> > > > > > > > > > starting with element 'journaledJ
> > > > > > > > > > DBC'. One of '{"http://activemq.apache.org/schema/core":
> > > > > > > > > > jdbcPersistenceAdapter,
> > > > > > > > > > "http://activemq.apache.org/schema/core":
> > > > > > journalPersistenceAdapter,
> > > > > > > "
> > > > > > > > > > http://activemq.apac
> > > > > > > > > > he.org/schema/core":kahaDB, "http://activemq.apache.org/
> > > > > > schema/core
> > > > > > > > > > ":levelDB,
> > > > > > > > > > "http://activemq.apache.org/schema/core":mKahaDB, "
> > > > > > > > > > http://activemq.apache.org/schema/core":
> > > > > > > > > > memoryPersistenceAdapter,
> > > > > > > > > > "http://activemq.apache.org/schema/core":
> > replicatedLevelDB,
> > > > > > > > > > WC[##other:"http://activemq.apache.org/schema/core"]}'
> is
> > > > > > expected.
> > > > > > > |
> > > > > > > > > > org.apache.ac
> > > > > > > > > > tivemq.xbean.XBeanBrokerFactory | main
> > > > > > > > > > org.springframework.beans.factory.xml.
> > > > > > XmlBeanDefinitionStoreExceptio
> > > > > > > n:
> > > > > > > > > > Line
> > > > > > > > > > 83 in XML document from class path resource
> [activemq.xml]
> > is
> > > > > > > invalid;
> > > > > > > > > > nested exception is or
> > > > > > > > > > g.xml.sax.SAXParseException; lineNumber: 83;
> columnNumber:
> > > 94;
> > > > > > > > > > cvc-complex-type.2.4.a: Invalid content was found
> starting
> > > with
> > > > > > > element
> > > > > > > > > > 'journaledJDBC'. One of '{"http://
> > > > > > > > > > activemq.apache.org/schema/core":jdbcPersistenceAdapter,
> "
> > > > > > > > > > http://activemq.apache.org/schema/core":
> > > > > journalPersistenceAdapter,
> > > > > > "
> > > > > > > > > > http://activemq.apache.org/schema/core":kah
> > > > > > > > > > aDB, "http://activemq.apache.org/schema/core":levelDB, "
> > > > > > > > > > http://activemq.apache.org/schema/core":mKahaDB, "
> > > > > > > > > > http://activemq.apache.org/schema/core":
> > > > memoryPersistenceAdapte
> > > > > > > > > > r, "http://activemq.apache.org/schema/core":
> > > replicatedLevelDB,
> > > > > > > > > > WC[##other:"
> > > > > > > > > > http://activemq.apache.org/schema/core"]}' is expected.
> > > > > > > > > >     at
> > > > > > > > > > org.springframework.beans.factory.xml.
> > > XmlBeanDefinitionReader.
> > > > > > > > > > doLoadBeanDefinitions(XmlBeanDefinitionReader.java:
> > > > > > > > > > 399)[spring-beans-4.3.9.RELEASE.jar:4.3.9.REL
> > > > > > > > > > EASE]
> > > > > > > > > >     at
> > > > > > > > > > org.springframework.beans.factory.xml.
> > > XmlBeanDefinitionReader.
> > > > > > > > > > loadBeanDefinitions(XmlBeanDefinitionReader.java:
> > > > > > > > > 336)[spring-beans-4.3.9.
> > > > > > > > > > RELEASE.jar:4.3.9.RELEA
> > > > > > > > > > SE]
> > > > > > > > > >     at
> > > > > > > > > > org.springframework.beans.factory.xml.
> > > XmlBeanDefinitionReader.
> > > > > > > > > > loadBeanDefinitions(XmlBeanDefinitionReader.java:
> > > > > > > > > 304)[spring-beans-4.3.9.
> > > > > > > > > > RELEASE.jar:4.3.9.RELEA
> > > > > > > > > > SE]
> > > > > > > > > >     at
> > > > > > > > > > org.apache.xbean.spring.context.
> > > ResourceXmlApplicationContext.
> > > > > > > > > > loadBeanDefinitions(ResourceXmlApplicationContext.
> > > > > > > > > > java:111)[xbean-spring-4.2.jar:4.2]
> > > > > > > > > >     at
> > > > > > > > > > org.apache.xbean.spring.context.
> > > ResourceXmlApplicationContext.
> > > > > > > > > > loadBeanDefinitions(ResourceXmlApplicationContext.
> > > > > > > > > > java:104)[xbean-spring-4.2.jar:4.2]
> > > > > > > > > >     at
> > > > > > > > > > org.springframework.context.support.
> > > > > AbstractRefreshableApplication
> > > > > > > > > > Context.refreshBeanFactory(
> AbstractRefreshableApplication
> > > > > > > > > > Context.java:129)[spring-context-4.
> > > > > > > > > > 3.9.RELEASE.jar:4.3.9.RELEASE]
> > > > > > > > > >
> > > > > > > > > > any working example how to setup ms sql jdbc ?
> > > > > > > > > >
> > > > > > > > > > Cheers,
> > > > > > > > > > Ilya Shipitsin
> > > > > > > > > >
> > > > > > > > >
> > > > > > > >
> > > > > > >
> > > > > >
> > > > >
> > > >
> > >
> >
>

Reply via email to