I encountered an error like below: ERROR: java.lang.RuntimeException: Failed to execute start task. Reason: org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name '' defined in class path resource [activemq.xml]: Bean class [jdbcPersistence] not found; nested exception is java.lang.ClassNotFoundException: jdbcPersistence
after i start activemq by changing the config file:activemq.xml: <!-- START SNIPPET: example --> <beans xmlns="http://activemq.org/config/1.0"> <!-- Allows us to use system properties as variables in this configuration file --> <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/> <broker useJmx="true"> <!-- In ActiveMQ 4, you can setup destination policies --> <destinationPolicy> <policyMap><policyEntries> <policyEntry topic="FOO.>"> <dispatchPolicy> <strictOrderDispatchPolicy /> </dispatchPolicy> <subscriptionRecoveryPolicy> <lastImageSubscriptionRecoveryPolicy /> </subscriptionRecoveryPolicy> </policyEntry> </policyEntries></policyMap> </destinationPolicy> <persistenceAdapter> <jdbcPersistence dataSourceRef="mssql-ds"/> <!--<journaledJDBC journalLogFiles="5" dataDirectory="${activemq.home}/activemq-data"/>--> <!-- To use a different datasource, use th following syntax : --> <!-- <journaledJDBC journalLogFiles="5" dataDirectory="../activemq-data" dataSource="#postgres-ds"/> --> </persistenceAdapter> <transportConnectors> <transportConnector name="default" uri="tcp://localhost:61616" discoveryUri="multicast://default"/> <transportConnector name="stomp" uri="stomp://localhost:61613"/> </transportConnectors> <networkConnectors> <!-- by default just auto discover the other brokers --> <networkConnector name="default" uri="multicast://default"/> <!-- <networkConnector name="host1 and host2" uri="static://(tcp://host1:61616,tcp://host2:61616)" failover="true"/> --> </networkConnectors> </broker> <!-- This xbean configuration file supports all the standard spring xml configuration options --> <!-- MySql DataSource Sample Setup --> <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://localhost/activemq?relaxAutoCommit=true"/> <property name="username" value="activemq"/> <property name="password" value="activemq"/> <property name="poolPreparedStatements" value="true"/> </bean> </beans> <!-- END SNIPPET: example --> I have placed the MySql jdbc driver in the directory "activemq_home/lib/optional". James.Strachan wrote: > > If you look in activemq.xml you should see an uncommented chunk of XML > for configuring the MySQL JDBC details > > On 9/25/06, HU <[EMAIL PROTECTED]> wrote: >> >> I am a beginner in ActiveMQ. Could you please tell me how to use ActiveMQ >> with MySQL DB. >> >> HU >> >> James.Strachan wrote: >> > >> > Try increasing your heap size via java -Xmx=512m or something. If you >> > want to reduce your RAM footprint use the <usageManager> element and >> > try using a database in another process (MySQL/Postgresql) rather than >> > the embedded Derby. >> > >> > >> > On 9/22/06, HU <[EMAIL PROTECTED]> wrote: >> >> >> >> I did a test as below: >> >> 1, use below codes to start a broker thread that only create 2 queues: >> >> >> >> BrokerService broker = new BrokerService(); >> >> broker.addConnector("tcp://localhost:61616"); >> >> broker.start(); >> >> ActiveMQConnectionFactory connectionFactory; >> >> connectionFactory = new ActiveMQConnectionFactory( >> >> "failover:tcp://localhost:61616"); >> >> >> >> 2, create a sender thread and a consumer thread which use the 2 >> queues. >> >> 3, Send a mesesage from sender thread through a queue then receive the >> >> message on the consumer thread. >> >> 4, Send a message from consumer thread through another queue and >> recieve >> >> the >> >> message on the sender thread. >> >> 5, repeat 3 and 4. >> >> >> >> After send about 380 messages from sendder thread, an error occurred >> on >> >> the >> >> broker thread which is: >> >> Thread[ActiveMQ Transport server: tcp//XXX:61616]( Interrupting... >> >> (Exception OutOfMemoryError) >> >> OpenWireFormat.<int>(int) Line:62 >> >> .... >> >> >> >> Could someone tell me please how to resolve the problem. >> >> -- >> >> View this message in context: >> >> >> http://www.nabble.com/Broker-used-up-the-memory-tf2316972.html#a6444443 >> >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> >> >> >> > >> > >> > -- >> > >> > James >> > ------- >> > http://radio.weblogs.com/0112098/ >> > >> > >> >> -- >> View this message in context: >> http://www.nabble.com/Broker-used-up-the-memory-tf2316972.html#a6482630 >> Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> >> > > > -- > > James > ------- > http://radio.weblogs.com/0112098/ > > -- View this message in context: http://www.nabble.com/Broker-used-up-the-memory-tf2316972.html#a6484245 Sent from the ActiveMQ - User mailing list archive at Nabble.com.
