History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: AMQ-711
Type: Bug Bug
Status: Reopened Reopened
Priority: Major Major
Assignee: Unassigned
Reporter: Niklas Käck
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
ActiveMQ

commit() should not be called while in auto-commit mode

Created: 17/May/06 02:34 PM   Updated: 07/May/08 01:57 AM
Component/s: Broker
Affects Version/s: 4.0 RC2, 4.0 RC3
Fix Version/s: 4.1.0, 4.0.1

Time Tracking:
Original Estimate: 1 day
Original Estimate - 1 day
Remaining Estimate: 1 day
Remaining Estimate - 1 day
Time Spent: Not Specified
Remaining Estimate - 1 day

File Attachments: 1. XML File activemq.xml (2 kb)

Environment:
Windows NT
SQLServer with jtds driver.

Regression: Regression


 Description  « Hide
Unable to startup Broker Service.

ERROR BrokerService - Failed to start ActiveMQ JMS Message Broker. Reason: java.io.IOException: commit() should not be called while in auto-commit mode.

Stacktrace:

java.io.IOException: commit() should not be called while in auto-commit mode.
at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:42)
at org.apache.activemq.store.jdbc.TransactionContext.close(TransactionContext.java:125)
at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.createAdapter(JDBCPersistenceAdapter.java:253)
at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getAdapter(JDBCPersistenceAdapter.java:213)
at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.start(JDBCPersistenceAdapter.java:139)
at org.apache.activemq.store.journal.JournalPersistenceAdapter.start(JournalPersistenceAdapter.java:215)
at org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:907)
at org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:867)
at org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:453)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:362)
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:43)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1058
)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:363)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:226)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:147)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:275)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:318)
at org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:158)
at org.apache.xbean.spring.context.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:48)
at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:40)
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:56)
at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:81)
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:46)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:49)
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:64)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:49)
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:45)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.apache.activemq.console.Main.runTaskClass(Main.java:135)
at org.apache.activemq.console.Main.main(Main.java:67)
Caused by: java.sql.SQLException: commit() should not be called while in auto-commit mode.
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.commit(ConnectionJDBC2.java:1878)
at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:203)
at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:203)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:199)
at org.apache.activemq.store.jdbc.TransactionContext.close(TransactionContext.java:119)

Error message:

ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'org.apache.activemq.xbean.XBeanBrokerService' defined in class path resource [activemq.xml]: Initialization of bean failed; nested exceptio
n is java.io.IOException: commit() should not be called while in auto-commit mode.
ERROR: java.lang.Exception: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.apache.activemq.xbean.XBeanBro
kerService' defined in class path resource [activemq.xml]: Initialization of bean failed; nested exception is java.io.IOException: commit() should not
be called while in auto-commit mode.

Configuration:

<bean id="sqlserver-ds" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="net.sourceforge.jtds.jdbc.Driver"/>
<property name="url" value="jdbc:jtds:sqlserver://host/ActiveMQ;instance=D1;tds=8.0;lastupdatecount=true"/>
<property name="username" value="ActiveMQ"/>
<property name="password" value="ActiveMQPwd"/>
<property name="poolPreparedStatements" value="true"/>
</bean>



 All   Comments   Work Log   Change History   Subversion Commits   FishEye   Crucible      Sort Order: Ascending order - Click to sort in descending order
Hiram Chirino - 05/Jun/06 04:17 PM
Applied patch.. Thanks Niklas!

Stephan Brunner - 07/May/08 01:57 AM
Hi folks!

I'm getting the same or similar exception with activemq 5.0.0 distribution. I'm using mssqlserver 2000 with jtds 1.2 lib. Btw I've tried same application context with activemq 4.1.1 distribution and it works perfectly

I'm getting the following exception:

2008-05-05 16:03:38,812 [main ] ERROR BrokerService - Failed to start ActiveMQ JMS Message Broker. Reason: java.io.IOException: commit() should not be called while in auto-commit mode.
java.io.IOException: commit() should not be called while in auto-commit mode.
at org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:45)
at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.deleteAllMessages(JDBCPersistenceAdapter.java:389)
at org.apache.activemq.broker.BrokerService.deleteAllMessages(BrokerService.java:1004)
at org.apache.activemq.broker.BrokerService.start(BrokerService.java:415)
at org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:46)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:425)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:251)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:156)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:248)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:287)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:64)
at org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:52)
at org.apache.activemq.xbean.XBeanBrokerFactory.createApplicationContext(XBeanBrokerFactory.java:91)
at org.apache.activemq.xbean.XBeanBrokerFactory.createBroker(XBeanBrokerFactory.java:51)
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:71)
at org.apache.activemq.broker.BrokerFactory.createBroker(BrokerFactory.java:54)
at org.apache.activemq.console.command.StartCommand.startBroker(StartCommand.java:112)
at org.apache.activemq.console.command.StartCommand.runTask(StartCommand.java:74)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:51)
at org.apache.activemq.console.command.ShellCommand.runTask(ShellCommand.java:104)
at org.apache.activemq.console.command.AbstractCommand.execute(AbstractCommand.java:51)
at org.apache.activemq.console.command.ShellCommand.main(ShellCommand.java:76)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.apache.activemq.console.Main.runTaskClass(Main.java:222)
at org.apache.activemq.console.Main.main(Main.java:106)
Caused by: java.sql.SQLException: commit() should not be called while in auto-commit mode.
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.commit(ConnectionJDBC2.java:1878)
at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:203)
at org.apache.commons.dbcp.DelegatingConnection.commit(DelegatingConnection.java:203)
at org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper.commit(PoolingDataSource.java:199)
at org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.doDropTables(DefaultJDBCAdapter.java:133)
at org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.deleteAllMessages(JDBCPersistenceAdapter.java:384)

My Application Context for the persistency adapter is:

<persistenceAdapter adapterClass="org.apache.activemq.store.jdbc.adapter.ImageBasedJDBCAdaptor">
<journaledJDBC journalLogFiles="5" dataDirectory="../activemq-data" dataSource="#jtds-ds" useDatabaseLock="false"/>
</persistenceAdapter>

and my datasource is:

<bean id="jtds-ds" class="net.sourceforge.jtds.jdbcx.JtdsDataSource">
<property name="serverName" value="****"/>
<property name="portNumber" value="****"/>
<property name="databaseName" value="*****"/>
<property name="user" value="****"/>
<property name="password" value="***"/>
</bean>

thanks,

stephan