activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tony Bonghi <tonybon...@yahoo.com>
Subject Embedded Broker problem with ActiveMQ 4.0.1
Date Mon, 26 Jun 2006 06:41:30 GMT

I am having issues upgrading from ActiveMQ 3.2 to 4.0.1. In 3.2, I had a
clustered embedded broker setup working. I have been unable to do this with
4.0.1. I read a lot of info on this and seen a bunch of posts, so I'm
assuming this does work. I am attempting to use a static list of
networkConnectors, although I've tried various protocols with no luck. I am
using Jencks as the consumer. 

I would apprieciate any help with this.

-----------------------------------------------------------------------------------------------
Here's a log snippet from the machine that first machine to come up:
-----------------------------------------------------------------------------------------------
DEBUG 23:28:21.743 (reCapableBeanFactory) Invoking BeanPostProcessors after
initialization of bean 'messageHandler' [main]
org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyBeanPostProcessorsAfterInitialization(AbstractAutowireCapableBeanFactory.java:262)
DEBUG 23:28:21.743 (ctApplicationContext) Publishing event in context
[org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=4313181]:
org.springframework.context.event.ContextRefreshedEvent[source=org.springframework.context.support.FileSystemXmlApplicationContext:
display name
[org.springframework.context.support.FileSystemXmlApplicationContext;hashCode=4313181];
startup date [Sun Jun 25 23:28:18 PDT 2006]; root of context hierarchy]
[main]
org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:223)
DEBUG 23:28:21.743 ( AbstractBeanFactory) Returning cached instance of
singleton bean 'broker' [main]
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
DEBUG 23:28:21.743 ( AbstractBeanFactory) Bean with name 'broker' is a
factory bean [main]
org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForSharedInstance(AbstractBeanFactory.java:810)
DEBUG 23:28:21.759 (wardingBridgeSupport)  stopping localhost bridge to null
is disposed already ? false [main]
org.apache.activemq.network.DemandForwardingBridgeSupport.doStop(DemandForwardingBridgeSupport.java:274)
DEBUG 23:28:21.946 ( FailoverTransport$2) Connect fail to:
tcp://WARREN:61616, reason: java.net.ConnectException: Connection refused:
connect [ActiveMQ Task]
org.apache.activemq.transport.failover.FailoverTransport$2.iterate(FailoverTransport.java:182)
DEBUG 23:28:21.946 ( FailoverTransport$2) Waiting 20 ms before attempting
connection.  [ActiveMQ Task]
org.apache.activemq.transport.failover.FailoverTransport$2.iterate(FailoverTransport.java:198)
Waiting for keyboard input... Press enter to send message.
DEBUG 23:28:21.946 (   FailoverTransport) Stopped. [main]
org.apache.activemq.transport.failover.FailoverTransport.stop(FailoverTransport.java:251)
DEBUG 23:28:21.962 (wardingBridgeSupport) localhost bridge to null stopped
[main]
org.apache.activemq.network.DemandForwardingBridgeSupport.doStop(DemandForwardingBridgeSupport.java:299)
INFO  23:28:21.962 (    NetworkConnector) Network Connector bridge Stopped
[main]
org.apache.activemq.network.NetworkConnector.doStop(NetworkConnector.java:278)
DEBUG 23:28:38.306 (WireFormatNegotiator) Sending: WireFormatInfo {
version=1, properties={TightEncodingEnabled=true, TcpNoDelayEnabled=true,
SizePrefixDisabled=false, StackTraceEnabled=true,
MaxInactivityDuration=30000, CacheEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
[ActiveMQ Transport Server: tcp://TONYB64:61616]
org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:62)
DEBUG 23:28:38.306 (        TcpTransport) TCP consumer thread starting
[ActiveMQ Transport: tcp:///10.1.6.183:1871]
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:139)
DEBUG 23:28:38.322 (WireFormatNegotiator) Received WireFormat:
WireFormatInfo { version=1, properties={StackTraceEnabled=true,
TightEncodingEnabled=true, TcpNoDelayEnabled=true, SizePrefixDisabled=false,
MaxInactivityDuration=30000, CacheEnabled=true}, magic=[A,c,t,i,v,e,M,Q]}
[ActiveMQ Transport: tcp:///10.1.6.183:1871]
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:85)
DEBUG 23:28:38.322 (WireFormatNegotiator) tcp:///10.1.6.183:1871 before
negotiation: OpenWireFormat{version=1, cacheEnabled=false,
stackTraceEnabled=false, tightEncodingEnabled=false,
sizePrefixDisabled=false} [ActiveMQ Transport: tcp:///10.1.6.183:1871]
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:92)
DEBUG 23:28:38.322 (WireFormatNegotiator) tcp:///10.1.6.183:1871 after
negotiation: OpenWireFormat{version=1, cacheEnabled=true,
stackTraceEnabled=true, tightEncodingEnabled=true, sizePrefixDisabled=false}
[ActiveMQ Transport: tcp:///10.1.6.183:1871]
org.apache.activemq.transport.WireFormatNegotiator.onCommand(WireFormatNegotiator.java:103)
DEBUG 23:28:39.634 (  AbstractConnection) Transport failed:
java.io.EOFException [ActiveMQ Transport: tcp:///10.1.6.183:1871]
org.apache.activemq.broker.AbstractConnection.serviceTransportException(AbstractConnection.java:171)
java.io.EOFException
	at java.io.DataInputStream.readInt(DataInputStream.java:448)
	at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:274)
	at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:142)
	at java.lang.Thread.run(Thread.java:534)

-----------------------------------------------------------------------------------------------
Here's a log snippet from the machine that 2nd machine to come up:
The SocketException occurs when they attempt to start the bridge.
-----------------------------------------------------------------------------------------------
DEBUG 23:28:39.762 ( AbstractBeanFactory) Returning cached instance of
singleton bean 'broker' [main]
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:189)
DEBUG 23:28:39.762 ( AbstractBeanFactory) Bean with name 'broker' is a
factory bean [main]
org.springframework.beans.factory.support.AbstractBeanFactory.getObjectForSharedInstance(AbstractBeanFactory.java:810)
DEBUG 23:28:39.762 (wardingBridgeSupport)  stopping localhost bridge to
localhost is disposed already ? false [main]
org.apache.activemq.network.DemandForwardingBridgeSupport.doStop(DemandForwardingBridgeSupport.java:274)
DEBUG 23:28:39.762 (   FailoverTransport) Stopped. [main]
org.apache.activemq.transport.failover.FailoverTransport.stop(FailoverTransport.java:251)
DEBUG 23:28:39.793 (wardingBridgeSupport) localhost bridge to localhost
stopped [main]
org.apache.activemq.network.DemandForwardingBridgeSupport.doStop(DemandForwardingBridgeSupport.java:299)
INFO  23:28:39.793 (    NetworkConnector) Network Connector bridge Stopped
[main]
org.apache.activemq.network.NetworkConnector.doStop(NetworkConnector.java:278)
Waiting for keyboard input... Press enter to send message.
DEBUG 23:28:39.809 (   FailoverTransport) Transport failed, starting up
reconnect task [ActiveMQ Transport: tcp://TONYB64/10.1.6.139:61616]
org.apache.activemq.transport.failover.FailoverTransport.handleTransportFailure(FailoverTransport.java:226)
java.net.SocketException: socket closed
	at java.net.SocketInputStream.socketRead0(Native Method)
	at java.net.SocketInputStream.read(SocketInputStream.java:129)
	at
org.apache.activemq.transport.tcp.TcpBufferedInputStream.fill(TcpBufferedInputStream.java:48)
	at
org.apache.activemq.transport.tcp.TcpBufferedInputStream.read(TcpBufferedInputStream.java:55)
	at java.io.DataInputStream.readInt(DataInputStream.java:443)
	at
org.apache.activemq.openwire.OpenWireFormat.unmarshal(OpenWireFormat.java:274)
	at
org.apache.activemq.transport.tcp.TcpTransport.run(TcpTransport.java:142)
	at java.lang.Thread.run(Thread.java:534)


Here are my config files:

-----------------------------------------------------------------------------------------------
activemq-jms-broker.xml -- For Server B
-----------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC  "-//ACTIVEMQ//DTD//EN" "org.activemq/activemq.dtd">
<beans>
	<broker persistent="false" useJmx="false"
xmlns="http://activemq.org/config/1.0">
		<!-- Local server -->
		<transportConnectors>
			<transportConnector uri="tcp://localhost:61616" />
		</transportConnectors>
		<!-- Remote servers -->
		<networkConnectors>
			<networkConnector uri="static:(tcp://A:61616)" failover="true" />
		</networkConnectors>
		<persistenceAdapter>
			<memoryPersistenceAdapter />
		</persistenceAdapter>
	</broker>
</beans>
-----------------------------------------------------------------------------------------------
activemq-jms-broker.xml -- For Server A
-----------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC  "-//ACTIVEMQ//DTD//EN" "org.activemq/activemq.dtd">
<beans>
	<broker persistent="false" useJmx="false"
xmlns="http://activemq.org/config/1.0">
		<!-- Local server -->
		<transportConnectors>
			<transportConnector uri="tcp://localhost:61616" />
		</transportConnectors>
		<!-- Remote servers -->
		<networkConnectors>
			<networkConnector uri="static:(tcp://B:61616)" failover="true" />
		</networkConnectors>
		<persistenceAdapter>
			<memoryPersistenceAdapter />
		</persistenceAdapter>
	</broker>
</beans>

-----------------------------------------------------------------------------------------------
activemq.xml
-----------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
"http://www.springframework.org/dtd/spring-beans.dtd">

<beans default-lazy-init="false">
	<bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
		<property name="config"	value="file:./activemq-jms-broker.xml" />
		<property name="start"	value="true" />
	</bean>
	<bean id="jmsFactory" class="org.apache.activemq.ActiveMQConnectionFactory"
depends-on="broker">
		<property name="brokerURL" value="vm://localhost" />
	</bean>
	<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
        <property name="connectionFactory">
            <bean
class="org.springframework.jms.connection.SingleConnectionFactory">
                <property name="targetConnectionFactory">
                    <ref local="jmsFactory"/>
                </property>
            </bean>
        </property>
		<property name="pubSubDomain"			value="true" />
		<property name="pubSubNoLocal"			value="false" />
		<property name="defaultDestinationName" value="Message.Topic" />
		<property name="explicitQosEnabled"		value="true" />
		<property name="deliveryMode"			value="1" />
		<property name="timeToLive"				value="15000" />
	</bean>
	<bean id="centralUpdateListenerTask"
class="com.et.db.CentralUpdateListenerAsyncEventQueueTask"
singleton="false">
		<constructor-arg>
			<ref bean="jmsTemplate" />
		</constructor-arg>
	</bean>

	<!-- JMS consumer beans -->
	<bean id="msgDrivenObject" class="org.jencks.JCAConnector">
		<property name="jcaContainer" ref="jcaContainerBean" />
    	<property name="activationSpec">
			<bean id="activeMQActivationSpec"
class="org.apache.activemq.ra.ActiveMQActivationSpec">
				<property name="destination" 			value="Message.Topic" />
		        <property name="destinationType" 		value="javax.jms.Topic" />
				<property name="maxSessions" 			value="100" />
				<property name="maxMessagesPerSessions" value="100" />
			</bean>
		</property>
		<property name="ref" value="messageHandler" />
	</bean>
	<bean id="jcaContainerBean" class="org.jencks.JCAContainer">
		<property name="bootstrapContext">
			<bean class="org.jencks.factory.BootstrapContextFactoryBean">
				<property name="threadPoolSize" value="25" />
			</bean>
		</property>
		<property name="resourceAdapter">
			<bean id="activeMQResourceAdapter" 
class="org.apache.activemq.ra.ActiveMQResourceAdapter">
				<property name="serverUrl" 		value="vm://localhost" />
			</bean>
		</property>
		<property name="lazyLoad"				value="false" />
	</bean>
	<bean id="messageHandler" class="com.et.activemq.MessageHandler"
singleton="true" />
</beans>

Thanks,
Tony
--
View this message in context: http://www.nabble.com/Embedded-Broker-problem-with-ActiveMQ-4.0.1-t1847300.html#a5042233
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message