You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Yuen-Chi Lian <yu...@gmail.com> on 2007/10/05 11:20:12 UTC

Couldn't get jdbcPersistenceAdapter working

Hi all,

This is strange. I have poked around Google and the mailing list, but
couldn't really find the exact solution to my problem. 

I am trying to enable jdbc persistence and I am getting the error below:

================================================================================
= Testing:  something (xatest.TestRunner)                                     
=
================================================================================
17:05:14.671 INFO  [org.mule.MuleManager:getInstance] Creating new
MuleManager instance
17:05:14.953 INFO 
[org.springframework.context.support.AbstractApplicationContext:prepareRefresh]
Refreshing org.mule.extras.spring.config.MuleApplicationContext@ce2187:
display name [org.mule.extras.spring.config.MuleApplicationContext@ce2187];
startup date [Fri Oct 05 17:05:14 SGT 2007]; root of context hierarchy
17:05:15.046 INFO 
[org.springframework.beans.factory.xml.XmlBeanDefinitionReader:loadBeanDefinitions]
Loading XML bean definitions from class path resource
[applicationContext.xml]
17:05:15.265 INFO 
[org.springframework.context.support.AbstractApplicationContext:obtainFreshBeanFactory]
Bean factory for application context
[org.mule.extras.spring.config.MuleApplicationContext@ce2187]:
org.springframework.beans.factory.support.DefaultListableBeanFactory@18235ed
17:05:16.312 WARN 
[org.apache.activemq.store.jdbc.JDBCPersistenceAdapter:cleanup] Old message
cleanup failed due to: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException:
Table 'activemq.activemq_acks' doesn't exist
17:05:16.359 ERROR [org.apache.activemq.broker.BrokerService:start] Failed
to start ActiveMQ JMS Message Broker. Reason: java.io.IOException: Failed to
get last broker message id:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
'activemq.activemq_acks' doesn't exist
java.io.IOException: Failed to get last broker message id:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
'activemq.activemq_acks' doesn't exist
	at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:31)
	at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:145)
	at
org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:148)
	at
org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:104)
	at
org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1270)
	at
org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1209)
	at
org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:508)
	at org.apache.activemq.broker.BrokerService.start(BrokerService.java:394)
	at
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:47)
	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:88)
	at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:76)
	at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:72)
	at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:68)
	at
org.apache.activemq.xbean.BrokerFactoryBean.afterPropertiesSet(BrokerFactoryBean.java:84)
	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:284)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
	at
org.mule.extras.spring.config.MuleApplicationContext.<init>(MuleApplicationContext.java:59)
	at
org.mule.extras.spring.config.MuleApplicationContext.<init>(MuleApplicationContext.java:50)
	at
org.mule.extras.spring.SpringContainerContext.initialise(SpringContainerContext.java:140)
	at org.mule.MuleManager.setContainerContext(MuleManager.java:1416)
	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.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
	at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:216)
	at org.apache.commons.digester.Rule.end(Rule.java:230)
	at org.apache.commons.digester.Digester.endElement(Digester.java:1130)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown
Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.apache.commons.digester.Digester.parse(Digester.java:1685)
	at
org.mule.config.builders.AbstractDigesterConfiguration.process(AbstractDigesterConfiguration.java:101)
	at
org.mule.config.builders.MuleXmlConfigurationBuilder.configure(MuleXmlConfigurationBuilder.java:264)
	at
org.mule.config.builders.MuleXmlConfigurationBuilder.configure(MuleXmlConfigurationBuilder.java:218)
	at org.mule.tck.FunctionalTestCase.setupManager(FunctionalTestCase.java:55)
	at org.mule.tck.FunctionalTestCase.doSetUp(FunctionalTestCase.java:38)
	at org.mule.tck.AbstractMuleTestCase.setUp(AbstractMuleTestCase.java:231)
	at junit.framework.TestCase.runBare(TestCase.java:128)
	at org.mule.tck.AbstractMuleTestCase.runBare(AbstractMuleTestCase.java:179)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at org.mule.tck.AbstractMuleTestCase.run(AbstractMuleTestCase.java:149)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
	at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
'activemq.activemq_acks' doesn't exist
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
	at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
	at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
	at
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1448)
	at
org.enhydra.jdbc.core.CorePreparedStatement.executeQuery(CorePreparedStatement.java:92)
	at
org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.doGetLastMessageBrokerSequenceId(DefaultJDBCAdapter.java:148)
	at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:142)
	... 76 more
17:05:16.375 ERROR [org.apache.commons.digester.Digester:endElement] End
event threw exception
java.lang.reflect.InvocationTargetException
	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.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216)
	at org.apache.commons.digester.SetNextRule.end(SetNextRule.java:216)
	at org.apache.commons.digester.Rule.end(Rule.java:230)
	at org.apache.commons.digester.Digester.endElement(Digester.java:1130)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.endNamespaceScope(Unknown
Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(Unknown
Source)
	at org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(Unknown Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown
Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
Source)
	at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.apache.commons.digester.Digester.parse(Digester.java:1685)
	at
org.mule.config.builders.AbstractDigesterConfiguration.process(AbstractDigesterConfiguration.java:101)
	at
org.mule.config.builders.MuleXmlConfigurationBuilder.configure(MuleXmlConfigurationBuilder.java:264)
	at
org.mule.config.builders.MuleXmlConfigurationBuilder.configure(MuleXmlConfigurationBuilder.java:218)
	at org.mule.tck.FunctionalTestCase.setupManager(FunctionalTestCase.java:55)
	at org.mule.tck.FunctionalTestCase.doSetUp(FunctionalTestCase.java:38)
	at org.mule.tck.AbstractMuleTestCase.setUp(AbstractMuleTestCase.java:231)
	at junit.framework.TestCase.runBare(TestCase.java:128)
	at org.mule.tck.AbstractMuleTestCase.runBare(AbstractMuleTestCase.java:179)
	at junit.framework.TestResult$1.protect(TestResult.java:106)
	at junit.framework.TestResult.runProtected(TestResult.java:124)
	at junit.framework.TestResult.run(TestResult.java:109)
	at junit.framework.TestCase.run(TestCase.java:120)
	at org.mule.tck.AbstractMuleTestCase.run(AbstractMuleTestCase.java:149)
	at junit.framework.TestSuite.runTest(TestSuite.java:230)
	at junit.framework.TestSuite.run(TestSuite.java:225)
	at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestReference.run(JUnit3TestReference.java:128)
	at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:460)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:673)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:386)
	at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:196)
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'jmsBroker' defined in class path resource
[applicationContext.xml]: Invocation of init method failed; nested exception
is org.springframework.beans.factory.BeanCreationException: Error creating
bean with name 'org.apache.activemq.xbean.XBeanBrokerService' defined in
class path resource [activemq.xml]: Invocation of init method failed; nested
exception is java.io.IOException: Failed to get last broker message id:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
'activemq.activemq_acks' doesn't exist
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1174)
	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:284)
	at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
	at
org.mule.extras.spring.config.MuleApplicationContext.<init>(MuleApplicationContext.java:59)
	at
org.mule.extras.spring.config.MuleApplicationContext.<init>(MuleApplicationContext.java:50)
	at
org.mule.extras.spring.SpringContainerContext.initialise(SpringContainerContext.java:140)
	at org.mule.MuleManager.setContainerContext(MuleManager.java:1416)
	... 42 more
Caused by: org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'org.apache.activemq.xbean.XBeanBrokerService'
defined in class path resource [activemq.xml]: Invocation of init method
failed; nested exception is java.io.IOException: Failed to get last broker
message id: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
'activemq.activemq_acks' doesn't exist
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1174)
	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:88)
	at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:76)
	at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:72)
	at
org.apache.xbean.spring.context.ResourceXmlApplicationContext.<init>(ResourceXmlApplicationContext.java:68)
	at
org.apache.activemq.xbean.BrokerFactoryBean.afterPropertiesSet(BrokerFactoryBean.java:84)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
	... 53 more
Caused by: java.io.IOException: Failed to get last broker message id:
com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
'activemq.activemq_acks' doesn't exist
	at
org.apache.activemq.util.IOExceptionSupport.create(IOExceptionSupport.java:31)
	at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:145)
	at
org.apache.activemq.broker.region.DestinationFactoryImpl.getLastMessageBrokerSequenceId(DestinationFactoryImpl.java:148)
	at
org.apache.activemq.broker.region.RegionBroker.<init>(RegionBroker.java:104)
	at
org.apache.activemq.broker.BrokerService.createRegionBroker(BrokerService.java:1270)
	at
org.apache.activemq.broker.BrokerService.createBroker(BrokerService.java:1209)
	at
org.apache.activemq.broker.BrokerService.getBroker(BrokerService.java:508)
	at org.apache.activemq.broker.BrokerService.start(BrokerService.java:394)
	at
org.apache.activemq.xbean.XBeanBrokerService.afterPropertiesSet(XBeanBrokerService.java:47)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1201)
	at
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1171)
	... 67 more
Caused by: com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
'activemq.activemq_acks' doesn't exist
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:936)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2985)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1631)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1723)
	at com.mysql.jdbc.Connection.execSQL(Connection.java:3256)
	at
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1313)
	at
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1448)
	at
org.enhydra.jdbc.core.CorePreparedStatement.executeQuery(CorePreparedStatement.java:92)
	at
org.apache.activemq.store.jdbc.adapter.DefaultJDBCAdapter.doGetLastMessageBrokerSequenceId(DefaultJDBCAdapter.java:148)
	at
org.apache.activemq.store.jdbc.JDBCPersistenceAdapter.getLastMessageBrokerSequenceId(JDBCPersistenceAdapter.java:142)
	... 76 more
17:05:16.437 INFO  [org.mule.MuleManager:disposeAgents] disposing agents...
17:05:16.437 INFO  [org.mule.MuleManager:disposeAgents] Agents Successfully
Disposed

1. I have MySQL JDBC driver in my classpath,
mysql-connector-java-5.0.7-bin.jar
2. I have tried making things "clean" by removing my
${activemq.home}/activemq-data
3. I have tried uncommenting the mysql-ds in the default config as well as
using my own simple one:

<beans>
	<broker brokerName="BROKER1" useJmx="false" persistent="true"
		xmlns="http://activemq.org/config/1.0">
		<persistenceAdapter>
			<jdbcPersistenceAdapter useDatabaseLock="false"
				dataSource="#jdbc4jms1" dataDirectory="target/activemq-data" />
			<adapter>
				<imageBasedJDBCAdaptor />
			</adapter>
		</persistenceAdapter>
		<transportConnectors>
			<transportConnector name="openwire"
				uri="tcp://localhost:61616" />
		</transportConnectors>
	</broker>
	
	<bean id="jdbc4jms1"
		class="org.enhydra.jdbc.pool.StandardXAPoolDataSource"
		destroy-method="shutdown">
		<property name="dataSource">
			<bean
				class="org.enhydra.jdbc.standard.StandardXADataSource">
				<property name="driverName"
					value="com.mysql.jdbc.Driver" />
				<property name="transactionManager">
					<ref local="jotm" />
				</property>
				<property name="url"
					value="jdbc:mysql://localhost:3306/activemq" />
			</bean>
		</property>
		<property name="user" value="root" />
		<property name="password" value="" />
	</bean>	
	
	<bean id="jdbc4jms2" class="org.apache.commons.dbcp.BasicDataSource"
		destroy-method="shutdown">
		<property name="driverClassName" value="com.mysql.jdbc.Driver" />
		<property name="url"
			value="jdbc:mysql://localhost/activemq?relaxAutoCommit=true" />
		<property name="username" value="root" />
		<property name="password" value="" />
		<property name="poolPreparedStatements" value="true" />
	</bean>
</beans>

Any ideas? 

Cheers,
Yuen-Chi Lian
-- 
View this message in context: http://www.nabble.com/Couldn%27t-get-jdbcPersistenceAdapter-working-tf4574013s2354.html#a13056039
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Couldn't get jdbcPersistenceAdapter working

Posted by Alex_ynr <su...@gmail.com>.
Eh...

The "Specified key was too long; max key length is 1000 bytes" error came up
in my logs on creating the tables and I've seen it many times because I work
with utf-8 databases a lot so it jumped at me :P

I'm using Fuse 3.3 btw ...

Alex


Yuen-Chi Lian wrote:
> 
> Hi Alex,
> 
> Fantastic! I managed to get it working now. Do you mind to share how did
> you
> manage to find that out?
> 
> Anyway:
> 
> mysql> status
> --------------
> ...
> Server characterset:    utf8
> Db     characterset:    utf8
> ...
> 
> mysql> drop database activemq;
> Query OK, 2 rows affected (0.06 sec)
> 
> mysql> create database activemq char set latin1;
> Query OK, 1 row affected (0.00 sec)
> 
> mysql> use activemq;
> Database changed
> mysql> status
> ...
> Server characterset:    utf8
> Db     characterset:    latin1
> ...
> 
> mysql> show tables;
> +--------------------+
> | Tables_in_activemq |
> +--------------------+
> | activemq_acks      |
> | activemq_lock      |
> | activemq_msgs      |
> +--------------------+
> 3 rows in set (0.00 sec)
> 
> On 10/10/07, Alex_ynr <su...@gmail.com> wrote:
>>
>>
>> I just hit the same thing as well
>>
>> Specified key was too long; max key length is 1000 bytes is the error not
>> allowing the creation of ACTIVEMQ_ACKS
>>
>> You are probably using utf8/some other multibyte encoding as the
>> collation
>> in your database....
>>
>> Switch it to latin1 or ASCII... The varchar fields that the key is
>> composed
>> of add up to less than 1000 characters but with a multibyte encoding the
>> key
>> length is over 1000 bytes.
>>
>> That's the case in my mysql setup here anyway.
>>
>>
>>
>> Yuen-Chi Lian wrote:
>> >
>> > Hi Glen,
>> >
>> > I still haven't got this working. I noticed that ActiveMQ was able to
>> > create
>> > the activemq_locks and activemq_msgs tables but activemq_acks is
>> missing
>> > in
>> > my `show tables;` list. The same behaviour is reproducible by dropping
>> the
>> > database and start ActiveMQ on a clean one.
>> >
>> > Any idea?
>> >
>> >
>> > On 10/7/07, Yuen-Chi Lian <yu...@gmail.com> wrote:
>> >>
>> >>
>> >> Hi Glen,
>> >>
>> >> I have only one MySQL server instance running at that time (on port
>> >> 3306).
>> >> And the username/password used in the configuration is "root":"".
>> >>
>> >> I have tried, by specifying an invalid (non-existing) database name, a
>> >> different error will be thrown instead.
>> >>
>> >> My Windows machine is not around and I'm with my Ubuntu right now. I
>> will
>> >> see if I can reproduce the problem, otherwise, I will have to come
>> back
>> >> here
>> >> on Monday or Tuesday.
>> >>
>> >> Thanks for your reply.
>> >>
>> >> Cheers,
>> >> Yuen-Chi Lian
>> >>
>> >>
>> >> Glen Mazza-2 wrote:
>> >> >
>> >> > Am Freitag, den 05.10.2007, 02:20 -0700 schrieb Yuen-Chi Lian:
>> >> >
>> >> >> Hi all,
>> >> >>
>> >> >> This is strange. I have poked around Google and the mailing list,
>> but
>> >> >> couldn't really find the exact solution to my problem.
>> >> >>
>> >> >> I am trying to enable jdbc persistence and I am getting the error
>> >> below:
>> >> >>
>> >> >> to start ActiveMQ JMS Message Broker. Reason: java.io.IOException:
>> >> Failed
>> >> >> to
>> >> >> get last broker message id:
>> >> >> com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
>> >> >> 'activemq.activemq_acks' doesn't exist
>> >> >
>> >> > Normally the reason for an exception like this is rather
>> >> > unambiguous--the database driver cannot find the database table
>> >> > "activemq_acks" within the activemq schema, either (a) because it
>> does
>> >> > not exist or (b) the username/password you are supplying for that
>> >> > database does not have access rights to that table.  Can you use an
>> >> > external query tool to make sure the table exists (pay attention to
>> >> case
>> >> > sensitivity), and that the username you have accessing it can select
>> >> > from that table?  Also, how many mysql installations do you have on
>> >> your
>> >> > machine?  That could be another problem.
>> >> >
>> >> > HTH,
>> >> > Glen
>> >> >
>> >> >
>> >> >> 1. I have MySQL JDBC driver in my classpath,
>> >> >> mysql-connector-java-5.0.7-bin.jar
>> >> >> 2. I have tried making things "clean" by removing my
>> >> >> ${activemq.home}/activemq-data
>> >> >> 3. I have tried uncommenting the mysql-ds in the default config as
>> >> well
>> >> >> as
>> >> >> using my own simple one:
>> >> >>
>> >> >
>> >> >
>> >> >
>> >> >
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://www.nabble.com/Couldn%27t-get-jdbcPersistenceAdapter-working-tf4574013s2354.html#a13079934
>> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>> >>
>> >>
>> >
>> >
>> > --
>> > Cheers,
>> > Yuen-Chi Lian
>> >
>> > "I do not seek; I find." - Pablo Picasso
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Couldn%27t-get-jdbcPersistenceAdapter-working-tf4574013s2354.html#a13134400
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Yuen-Chi Lian
> 
> "I do not seek; I find." - Pablo Picasso
> 
> 

-- 
View this message in context: http://www.nabble.com/Couldn%27t-get-jdbcPersistenceAdapter-working-tf4574013s2354.html#a13135021
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Couldn't get jdbcPersistenceAdapter working

Posted by Yuen Chi Lian <yu...@gmail.com>.
Hi Alex,

Fantastic! I managed to get it working now. Do you mind to share how did you
manage to find that out?

Anyway:

mysql> status
--------------
...
Server characterset:    utf8
Db     characterset:    utf8
...

mysql> drop database activemq;
Query OK, 2 rows affected (0.06 sec)

mysql> create database activemq char set latin1;
Query OK, 1 row affected (0.00 sec)

mysql> use activemq;
Database changed
mysql> status
...
Server characterset:    utf8
Db     characterset:    latin1
...

mysql> show tables;
+--------------------+
| Tables_in_activemq |
+--------------------+
| activemq_acks      |
| activemq_lock      |
| activemq_msgs      |
+--------------------+
3 rows in set (0.00 sec)

On 10/10/07, Alex_ynr <su...@gmail.com> wrote:
>
>
> I just hit the same thing as well
>
> Specified key was too long; max key length is 1000 bytes is the error not
> allowing the creation of ACTIVEMQ_ACKS
>
> You are probably using utf8/some other multibyte encoding as the collation
> in your database....
>
> Switch it to latin1 or ASCII... The varchar fields that the key is
> composed
> of add up to less than 1000 characters but with a multibyte encoding the
> key
> length is over 1000 bytes.
>
> That's the case in my mysql setup here anyway.
>
>
>
> Yuen-Chi Lian wrote:
> >
> > Hi Glen,
> >
> > I still haven't got this working. I noticed that ActiveMQ was able to
> > create
> > the activemq_locks and activemq_msgs tables but activemq_acks is missing
> > in
> > my `show tables;` list. The same behaviour is reproducible by dropping
> the
> > database and start ActiveMQ on a clean one.
> >
> > Any idea?
> >
> >
> > On 10/7/07, Yuen-Chi Lian <yu...@gmail.com> wrote:
> >>
> >>
> >> Hi Glen,
> >>
> >> I have only one MySQL server instance running at that time (on port
> >> 3306).
> >> And the username/password used in the configuration is "root":"".
> >>
> >> I have tried, by specifying an invalid (non-existing) database name, a
> >> different error will be thrown instead.
> >>
> >> My Windows machine is not around and I'm with my Ubuntu right now. I
> will
> >> see if I can reproduce the problem, otherwise, I will have to come back
> >> here
> >> on Monday or Tuesday.
> >>
> >> Thanks for your reply.
> >>
> >> Cheers,
> >> Yuen-Chi Lian
> >>
> >>
> >> Glen Mazza-2 wrote:
> >> >
> >> > Am Freitag, den 05.10.2007, 02:20 -0700 schrieb Yuen-Chi Lian:
> >> >
> >> >> Hi all,
> >> >>
> >> >> This is strange. I have poked around Google and the mailing list,
> but
> >> >> couldn't really find the exact solution to my problem.
> >> >>
> >> >> I am trying to enable jdbc persistence and I am getting the error
> >> below:
> >> >>
> >> >> to start ActiveMQ JMS Message Broker. Reason: java.io.IOException:
> >> Failed
> >> >> to
> >> >> get last broker message id:
> >> >> com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
> >> >> 'activemq.activemq_acks' doesn't exist
> >> >
> >> > Normally the reason for an exception like this is rather
> >> > unambiguous--the database driver cannot find the database table
> >> > "activemq_acks" within the activemq schema, either (a) because it
> does
> >> > not exist or (b) the username/password you are supplying for that
> >> > database does not have access rights to that table.  Can you use an
> >> > external query tool to make sure the table exists (pay attention to
> >> case
> >> > sensitivity), and that the username you have accessing it can select
> >> > from that table?  Also, how many mysql installations do you have on
> >> your
> >> > machine?  That could be another problem.
> >> >
> >> > HTH,
> >> > Glen
> >> >
> >> >
> >> >> 1. I have MySQL JDBC driver in my classpath,
> >> >> mysql-connector-java-5.0.7-bin.jar
> >> >> 2. I have tried making things "clean" by removing my
> >> >> ${activemq.home}/activemq-data
> >> >> 3. I have tried uncommenting the mysql-ds in the default config as
> >> well
> >> >> as
> >> >> using my own simple one:
> >> >>
> >> >
> >> >
> >> >
> >> >
> >>
> >> --
> >> View this message in context:
> >>
> http://www.nabble.com/Couldn%27t-get-jdbcPersistenceAdapter-working-tf4574013s2354.html#a13079934
> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>
> >>
> >
> >
> > --
> > Cheers,
> > Yuen-Chi Lian
> >
> > "I do not seek; I find." - Pablo Picasso
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Couldn%27t-get-jdbcPersistenceAdapter-working-tf4574013s2354.html#a13134400
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Yuen-Chi Lian

"I do not seek; I find." - Pablo Picasso

Re: Couldn't get jdbcPersistenceAdapter working

Posted by Alex_ynr <su...@gmail.com>.
I just hit the same thing as well

Specified key was too long; max key length is 1000 bytes is the error not
allowing the creation of ACTIVEMQ_ACKS

You are probably using utf8/some other multibyte encoding as the collation
in your database....

Switch it to latin1 or ASCII... The varchar fields that the key is composed
of add up to less than 1000 characters but with a multibyte encoding the key
length is over 1000 bytes.

That's the case in my mysql setup here anyway.



Yuen-Chi Lian wrote:
> 
> Hi Glen,
> 
> I still haven't got this working. I noticed that ActiveMQ was able to
> create
> the activemq_locks and activemq_msgs tables but activemq_acks is missing
> in
> my `show tables;` list. The same behaviour is reproducible by dropping the
> database and start ActiveMQ on a clean one.
> 
> Any idea?
> 
> 
> On 10/7/07, Yuen-Chi Lian <yu...@gmail.com> wrote:
>>
>>
>> Hi Glen,
>>
>> I have only one MySQL server instance running at that time (on port
>> 3306).
>> And the username/password used in the configuration is "root":"".
>>
>> I have tried, by specifying an invalid (non-existing) database name, a
>> different error will be thrown instead.
>>
>> My Windows machine is not around and I'm with my Ubuntu right now. I will
>> see if I can reproduce the problem, otherwise, I will have to come back
>> here
>> on Monday or Tuesday.
>>
>> Thanks for your reply.
>>
>> Cheers,
>> Yuen-Chi Lian
>>
>>
>> Glen Mazza-2 wrote:
>> >
>> > Am Freitag, den 05.10.2007, 02:20 -0700 schrieb Yuen-Chi Lian:
>> >
>> >> Hi all,
>> >>
>> >> This is strange. I have poked around Google and the mailing list, but
>> >> couldn't really find the exact solution to my problem.
>> >>
>> >> I am trying to enable jdbc persistence and I am getting the error
>> below:
>> >>
>> >> to start ActiveMQ JMS Message Broker. Reason: java.io.IOException:
>> Failed
>> >> to
>> >> get last broker message id:
>> >> com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
>> >> 'activemq.activemq_acks' doesn't exist
>> >
>> > Normally the reason for an exception like this is rather
>> > unambiguous--the database driver cannot find the database table
>> > "activemq_acks" within the activemq schema, either (a) because it does
>> > not exist or (b) the username/password you are supplying for that
>> > database does not have access rights to that table.  Can you use an
>> > external query tool to make sure the table exists (pay attention to
>> case
>> > sensitivity), and that the username you have accessing it can select
>> > from that table?  Also, how many mysql installations do you have on
>> your
>> > machine?  That could be another problem.
>> >
>> > HTH,
>> > Glen
>> >
>> >
>> >> 1. I have MySQL JDBC driver in my classpath,
>> >> mysql-connector-java-5.0.7-bin.jar
>> >> 2. I have tried making things "clean" by removing my
>> >> ${activemq.home}/activemq-data
>> >> 3. I have tried uncommenting the mysql-ds in the default config as
>> well
>> >> as
>> >> using my own simple one:
>> >>
>> >
>> >
>> >
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/Couldn%27t-get-jdbcPersistenceAdapter-working-tf4574013s2354.html#a13079934
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -- 
> Cheers,
> Yuen-Chi Lian
> 
> "I do not seek; I find." - Pablo Picasso
> 
> 

-- 
View this message in context: http://www.nabble.com/Couldn%27t-get-jdbcPersistenceAdapter-working-tf4574013s2354.html#a13134400
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Couldn't get jdbcPersistenceAdapter working

Posted by Yuen Chi Lian <yu...@gmail.com>.
Hi Glen,

I still haven't got this working. I noticed that ActiveMQ was able to create
the activemq_locks and activemq_msgs tables but activemq_acks is missing in
my `show tables;` list. The same behaviour is reproducible by dropping the
database and start ActiveMQ on a clean one.

Any idea?


On 10/7/07, Yuen-Chi Lian <yu...@gmail.com> wrote:
>
>
> Hi Glen,
>
> I have only one MySQL server instance running at that time (on port 3306).
> And the username/password used in the configuration is "root":"".
>
> I have tried, by specifying an invalid (non-existing) database name, a
> different error will be thrown instead.
>
> My Windows machine is not around and I'm with my Ubuntu right now. I will
> see if I can reproduce the problem, otherwise, I will have to come back
> here
> on Monday or Tuesday.
>
> Thanks for your reply.
>
> Cheers,
> Yuen-Chi Lian
>
>
> Glen Mazza-2 wrote:
> >
> > Am Freitag, den 05.10.2007, 02:20 -0700 schrieb Yuen-Chi Lian:
> >
> >> Hi all,
> >>
> >> This is strange. I have poked around Google and the mailing list, but
> >> couldn't really find the exact solution to my problem.
> >>
> >> I am trying to enable jdbc persistence and I am getting the error
> below:
> >>
> >> to start ActiveMQ JMS Message Broker. Reason: java.io.IOException:
> Failed
> >> to
> >> get last broker message id:
> >> com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
> >> 'activemq.activemq_acks' doesn't exist
> >
> > Normally the reason for an exception like this is rather
> > unambiguous--the database driver cannot find the database table
> > "activemq_acks" within the activemq schema, either (a) because it does
> > not exist or (b) the username/password you are supplying for that
> > database does not have access rights to that table.  Can you use an
> > external query tool to make sure the table exists (pay attention to case
> > sensitivity), and that the username you have accessing it can select
> > from that table?  Also, how many mysql installations do you have on your
> > machine?  That could be another problem.
> >
> > HTH,
> > Glen
> >
> >
> >> 1. I have MySQL JDBC driver in my classpath,
> >> mysql-connector-java-5.0.7-bin.jar
> >> 2. I have tried making things "clean" by removing my
> >> ${activemq.home}/activemq-data
> >> 3. I have tried uncommenting the mysql-ds in the default config as well
> >> as
> >> using my own simple one:
> >>
> >
> >
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/Couldn%27t-get-jdbcPersistenceAdapter-working-tf4574013s2354.html#a13079934
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>


-- 
Cheers,
Yuen-Chi Lian

"I do not seek; I find." - Pablo Picasso

Re: Couldn't get jdbcPersistenceAdapter working

Posted by Yuen-Chi Lian <yu...@gmail.com>.
Hi Glen,

I have only one MySQL server instance running at that time (on port 3306).
And the username/password used in the configuration is "root":"".

I have tried, by specifying an invalid (non-existing) database name, a
different error will be thrown instead. 

My Windows machine is not around and I'm with my Ubuntu right now. I will
see if I can reproduce the problem, otherwise, I will have to come back here
on Monday or Tuesday.

Thanks for your reply.

Cheers,
Yuen-Chi Lian


Glen Mazza-2 wrote:
> 
> Am Freitag, den 05.10.2007, 02:20 -0700 schrieb Yuen-Chi Lian:
> 
>> Hi all,
>> 
>> This is strange. I have poked around Google and the mailing list, but
>> couldn't really find the exact solution to my problem. 
>> 
>> I am trying to enable jdbc persistence and I am getting the error below:
>> 
>> to start ActiveMQ JMS Message Broker. Reason: java.io.IOException: Failed
>> to
>> get last broker message id:
>> com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
>> 'activemq.activemq_acks' doesn't exist
> 
> Normally the reason for an exception like this is rather
> unambiguous--the database driver cannot find the database table
> "activemq_acks" within the activemq schema, either (a) because it does
> not exist or (b) the username/password you are supplying for that
> database does not have access rights to that table.  Can you use an
> external query tool to make sure the table exists (pay attention to case
> sensitivity), and that the username you have accessing it can select
> from that table?  Also, how many mysql installations do you have on your
> machine?  That could be another problem.
> 
> HTH,
> Glen
> 
> 
>> 1. I have MySQL JDBC driver in my classpath,
>> mysql-connector-java-5.0.7-bin.jar
>> 2. I have tried making things "clean" by removing my
>> ${activemq.home}/activemq-data
>> 3. I have tried uncommenting the mysql-ds in the default config as well
>> as
>> using my own simple one:
>> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Couldn%27t-get-jdbcPersistenceAdapter-working-tf4574013s2354.html#a13079934
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Couldn't get jdbcPersistenceAdapter working

Posted by Glen Mazza <gl...@verizon.net>.
Am Freitag, den 05.10.2007, 02:20 -0700 schrieb Yuen-Chi Lian:

> Hi all,
> 
> This is strange. I have poked around Google and the mailing list, but
> couldn't really find the exact solution to my problem. 
> 
> I am trying to enable jdbc persistence and I am getting the error below:
> 
> to start ActiveMQ JMS Message Broker. Reason: java.io.IOException: Failed to
> get last broker message id:
> com.mysql.jdbc.exceptions.MySQLSyntaxErrorException: Table
> 'activemq.activemq_acks' doesn't exist

Normally the reason for an exception like this is rather
unambiguous--the database driver cannot find the database table
"activemq_acks" within the activemq schema, either (a) because it does
not exist or (b) the username/password you are supplying for that
database does not have access rights to that table.  Can you use an
external query tool to make sure the table exists (pay attention to case
sensitivity), and that the username you have accessing it can select
from that table?  Also, how many mysql installations do you have on your
machine?  That could be another problem.

HTH,
Glen


> 1. I have MySQL JDBC driver in my classpath,
> mysql-connector-java-5.0.7-bin.jar
> 2. I have tried making things "clean" by removing my
> ${activemq.home}/activemq-data
> 3. I have tried uncommenting the mysql-ds in the default config as well as
> using my own simple one:
>