[activemq-user] ActiveMQ-4.0 with MySQL Store

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[activemq-user] ActiveMQ-4.0 with MySQL Store

Yogesh Prajapati
I am trying to use MySQL JDBC persistence with ActiveMQ 4.0 SNAPSHOT
(11/20). Here is the conf:

<persistenceAdapter>
<!-- To use a different datasource, use the following syntax : -->
<!--
<journaledJBDC journalLogFiles="5" dataDirectory="../var"
dataSource="#postgres-ds"/>
-->
<journaledJBDC journalLogFiles="5" dataDirectory="../var"
dataSource="#mysql-ds"/>
</persistenceAdapter>
<transportConnectors>
<!-- prefixing a connector with discovery: causes the connector to be
advertiesed over rendezvous -->
<transportConnector uri="discovery:tcp://localhost:61616"/>
</transportConnectors>
........
<bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:
mysql://192.168.248.7:3306/activemqdb1?autoReconnect=true&amp;relaxAutocommit=true"/
>
<property name="username" value="activemq"/>
<property name="password" value=""/>
<property name="poolPreparedStatements" value="true"/>
<property name="initialSize" value="30"/>
<property name="maxActive" value="60"/>
<property name="maxIdle" value="30"/>
<property name="maxWait" value="-1"/>
<property name="removeAbandoned" value="true"/>
<property name="logAbandoned" value="false"/>
<property name="removeAbandonedTimeout" value="5"/>
</bean>


When I try to start ActiveMQ I get following error (please note that this
occurs even
after adding "relaxAutocommit=true" in the mysql JDBC URL):

Exception in thread "main"
org.springframework.beans.factory.BeanCreationExcepti
on: Error creating bean with name 'org.activemq.xbean.XBeanBrokerService'
define
d in class path resource [activemq.xml]: Error setting property values;
nested e
xception is org.springframework.beans.PropertyAccessExceptionsException:
Propert
yAccessExceptionsException (1 errors); nested propertyAccessExceptions are:
[org
.springframework.beans.MethodInvocationException: Property
'transportConnectors'
threw exception; nested exception is java.io.IOException: Can't call commit
whe
n autocommit=true]
PropertyAccessExceptionsException (1 errors)
org.springframework.beans.MethodInvocationException: Property
'transportConnecto
rs' threw exception; nested exception is java.io.IOException: Can't call
commit
when autocommit=true
java.io.IOException: Can't call commit when autocommit=true
at org.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:4
4)
at org.activemq.store.jdbc.TransactionContext.close(TransactionContext.j
ava:113)
at org.activemq.store.jdbc.JDBCPersistenceAdapter.getAdapter(JDBCPersist
enceAdapter.java:253)
at org.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersistenceA
dapter.java:140)
at org.activemq.store.journal.JournalPersistenceAdapter.start(JournalPer
sistenceAdapter.java:207)
at org.activemq.broker.BrokerService.createRegionBroker(BrokerService.ja
va:607)

Thanks
Yogesh
Reply | Threaded
Open this post in threaded view
|

[activemq-user] Re: ActiveMQ-4.0 with MySQL Store

Yogesh Prajapati
Figured the mistake I was making....

I was using "relaxAutocommit=true" instead of "relaxAutoCommit=true". Once I
put capital letter "C" for "commit" it worked.

Thanks
Yogesh

On 11/20/05, Yogesh Prajapati <[hidden email]> wrote:

>
> I am trying to use MySQL JDBC persistence with ActiveMQ 4.0 SNAPSHOT
> (11/20). Here is the conf:
>
> <persistenceAdapter>
> <!-- To use a different datasource, use the following syntax : -->
> <!--
> <journaledJBDC journalLogFiles="5" dataDirectory="../var"
> dataSource="#postgres-ds"/>
> -->
> <journaledJBDC journalLogFiles="5" dataDirectory="../var"
> dataSource="#mysql-ds"/>
> </persistenceAdapter>
> <transportConnectors>
> <!-- prefixing a connector with discovery: causes the connector to be
> advertiesed over rendezvous -->
> <transportConnector uri="discovery:tcp://localhost:61616"/>
> </transportConnectors>
> ........
> <bean id="mysql-ds" class="org.apache.commons.dbcp.BasicDataSource"
> destroy-method="close">
> <property name="driverClassName" value="com.mysql.jdbc.Driver"/>
> <property name="url" value="jdbc:
> mysql://192.168.248.7:3306/activemqdb1?autoReconnect=true&amp;relaxAutocommit=true"/>
>
> <property name="username" value="activemq"/>
> <property name="password" value=""/>
> <property name="poolPreparedStatements" value="true"/>
> <property name="initialSize" value="30"/>
> <property name="maxActive" value="60"/>
> <property name="maxIdle" value="30"/>
> <property name="maxWait" value="-1"/>
> <property name="removeAbandoned" value="true"/>
> <property name="logAbandoned" value="false"/>
> <property name="removeAbandonedTimeout" value="5"/>
> </bean>
>
>
> When I try to start ActiveMQ I get following error (please note that this
> occurs even
> after adding "relaxAutocommit=true" in the mysql JDBC URL):
>
> Exception in thread "main"
> org.springframework.beans.factory.BeanCreationExcepti
> on: Error creating bean with name 'org.activemq.xbean.XBeanBrokerService'
> define
> d in class path resource [activemq.xml]: Error setting property values;
> nested e
> xception is org.springframework.beans.PropertyAccessExceptionsException:
> Propert
> yAccessExceptionsException (1 errors); nested propertyAccessExceptions
> are: [org
> .springframework.beans.MethodInvocationException: Property
> 'transportConnectors'
> threw exception; nested exception is java.io.IOException: Can't call
> commit whe
> n autocommit=true]
> PropertyAccessExceptionsException (1 errors)
> org.springframework.beans.MethodInvocationException: Property
> 'transportConnecto
> rs' threw exception; nested exception is java.io.IOException: Can't call
> commit
> when autocommit=true
> java.io.IOException: Can't call commit when autocommit=true
> at org.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:4
> 4)
> at org.activemq.store.jdbc.TransactionContext.close(TransactionContext.j
> ava:113)
> at org.activemq.store.jdbc.JDBCPersistenceAdapter.getAdapter(JDBCPersist
> enceAdapter.java:253)
> at org.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersistenceA
> dapter.java:140)
> at org.activemq.store.journal.JournalPersistenceAdapter.start(JournalPer
> sistenceAdapter.java:207)
> at org.activemq.broker.BrokerService.createRegionBroker(BrokerService.ja
> va:607)
>
> Thanks
> Yogesh
>