activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jamo <jaymo...@gmail.com>
Subject Spring Embedded broker Journal already opened error
Date Mon, 07 Aug 2006 23:01:49 GMT

I'm getting the following error when trying to start an embedded broker in my
Spring web app (spring 2.0rc2 & activemq 4.0.1):
BrokerService] Failed to start ActiveMQ JMS Message Broker. Reason:
java.io.IOException: Journal is already opened by this application.

According to a couple of posts that I've found ( 
http://goopen.org/confluence/display/ACTIVEMQ/Journal+is+already+opened+by+this+application
&
http://www.activemq.org/site/vm-transport-reference.html ),
with an embedded broker, the connection factory can start before the broker
creating 2 instances of activemq (and the error).  But, as I understand it,
I'm creating the broker and connection factory in the same bean, so I don't
see how to seperate the two and add the suggested "depends-on"???

Can you explain how to work around the problem given the following config:

	<!-- JMS ConnectionFactory to use - ActiveMQ -->
	<bean id="jmsFactory"
		class="org.apache.activemq.ActiveMQConnectionFactory">
		<property name="brokerURL" value="vm://localhost" />
	</bean>

	<!-- Spring JMS Template (used by queueEmailService)-->
	<bean id="bizLinxJmsTemplate" 		
		class="org.springframework.jms.core.JmsTemplate">
		<property name="connectionFactory" ref="jmsFactory" />
		<property name="defaultDestination" ref="destination" />
	</bean>

	<!-- Queue to use-->
	<bean id="destination"
		class="org.apache.activemq.command.ActiveMQQueue">
       		<constructor-arg value="bizLinxEmail" />
	</bean>
		
	<!-- QueueEmailService: the email queuer service - queues email to jms -->
	<bean id="queueEmailService"
		class="com.xxxx.dist.bizlinx.server.service.impl.QueueEmailService">
		<property name="jmsTemplate" ref="bizLinxJmsTemplate" />
	</bean>
	
	<!-- SendEmailService: the email sender service - receives jms messages and
sends to SMTP -->
	<bean id="sendEmailService"
		class="com.xxxx.dist.bizlinx.server.service.impl.SendEmailService">
	</bean>
	
	<!-- JMS Listener Container - routes JMS Messages to SendEmailService -->
	<bean id="listenerContainer"
		class="org.springframework.jms.listener.DefaultMessageListenerContainer">
		<property name="connectionFactory" ref="jmsFactory" />
		<property name="destination" ref="destination" />
		<property name="messageListener" ref="sendEmailService" />
	</bean>

Thanks
 
-- 
View this message in context: http://www.nabble.com/Spring-Embedded-broker-Journal-already-opened-error-tf2069517.html#a5697521
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message