activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dongerw <j...@roundboxmedia.com>
Subject Broker URL connection refused.
Date Fri, 07 Jul 2006 20:01:08 GMT

Hello All,

I have having trouble getting the broker URL to connect using tcp.   I have
tried on both a windows box and a linux box.  On the linux machine, I ran
the service iptables stop command and that did not help.  I went edited the
tomcat/conf/catalina.policy file to have just  the following:

grant {
   permission java.security.AllPermission
}

That did not help either.  I am using Spring 2.0 RC2 from 6/30/2006,
Jencks-All 1.1.2, and ActiveMQ 4.0.1.  Here is my Spring config:

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

<beans>

    <!--

          ###### Transaction manager ######

    -->

    <bean id="transactionContextManager"
class="org.jencks.factory.TransactionContextManagerFactoryBean"/>
    <bean id="userTransaction"
class="org.jencks.factory.GeronimoTransactionManagerFactoryBean"/>
    <bean id="transactionManager"
class="org.springframework.transaction.jta.JtaTransactionManager">
        <property name="userTransaction" ref="userTransaction"/>
    </bean>

    <!--

          ###### JCA ######

    -->

    <bean id="transactionSupport"
          class="org.jencks.factory.XATransactionFactoryBean">
        <property name="useTransactionCaching">
            <value>true</value>
        </property>
        <property name="useThreadCaching">
            <value>false</value>
        </property>
    </bean>

    <bean id="poolingSupport"
class="org.jencks.factory.SinglePoolFactoryBean">
        <property name="maxSize">
            <value>2</value>
        </property>
        <property name="minSize">
            <value>1</value>
        </property>
        <property name="blockingTimeoutMilliseconds">
            <value>60</value>
        </property>
        <property name="idleTimeoutMinutes">
            <value>60</value>
        </property>
        <property name="matchOne">
            <value>true</value>
        </property>
        <property name="matchAll">
            <value>true</value>
        </property>
        <property name="selectOneAssumeMatch">
            <value>true</value>
        </property>
    </bean>

    <bean id="connectionManager"
class="org.jencks.factory.ConnectionManagerFactoryBean">
        <property name="transactionSupport">
            <ref local="transactionSupport"/>
        </property>
        <property name="poolingSupport">
            <ref local="poolingSupport"/>
        </property>
    </bean>

    <!--

          ###### JMS ######

    -->

    <bean id="broker" class="org.apache.activemq.xbean.BrokerFactoryBean">
        <property name="config"
value="classpath:broker-jencks-example.xml"/>
    </bean>

    <bean id="jmsResourceAdapter"
class="org.apache.activemq.ra.ActiveMQResourceAdapter">
        <property name="serverUrl" value="tcp://localhost:51616"/>
    </bean>


    <bean id="jmsManagedConnectionFactory"
class="org.apache.activemq.ra.ActiveMQManagedConnectionFactory">
        <property name="resourceAdapter">
            <ref local="jmsResourceAdapter"/>
        </property>
    </bean>

    <bean id="jmsConnectionFactory"
class="org.springframework.jca.support.LocalConnectionFactoryBean">
        <property name="managedConnectionFactory">
            <ref local="jmsManagedConnectionFactory"/>
        </property>
        <property name="connectionManager">
            <ref local="connectionManager"/>
        </property>
    </bean>

    <bean id="jmsQueue"
class="org.springframework.jndi.JndiObjectFactoryBean">
        <property name="jndiName">
            <value>queue</value>
        </property>
        <property name="jndiEnvironment">
            <props>
                <prop
key="java.naming.factory.initial">org.apache.activemq.jndi.ActiveMQInitialContextFactory</prop>
                <prop
key="java.naming.provider.url">tcp://localhost:51616</prop>
                <prop key="queue.queue">example.MyQueue</prop>
            </props>
        </property>
    </bean>

    <bean id="jencks" class="org.jencks.JCAContainer">

        <!-- lets use the default configuration of work manager and
transaction manager-->
        <property name="bootstrapContext">
            <bean class="org.jencks.factory.BootstrapContextFactoryBean">
                <property name="threadPoolSize" value="25"/>
            </bean>
        </property>


        <!-- the JCA Resource Adapter -->
        <property name="resourceAdapter">
            <bean id="activeMQResourceAdapter"
class="org.apache.activemq.ra.ActiveMQResourceAdapter">
                <property name="serverUrl" value="tcp://localhost:51616"/>
            </bean>
        </property>
    </bean>

    <bean id="inboundConnectorA" class="org.jencks.JCAConnector">

        <property name="jcaContainer" ref="jencks"/>

        <!-- subscription details -->
        <property name="activationSpec">
            <bean class="org.apache.activemq.ra.ActiveMQActivationSpec">
                <property name="destination"
value="test.spring.inboundConnectorA"/>
                <property name="destinationType" value="javax.jms.Topic"/>
            </bean>
        </property>

        <!-- use XA transactions -->
        <property name="transactionManager" ref="userTransaction"/>

        <property name="ref" value="echoBean"/>
    </bean>
</beans>

<!--   END OF SPRING CONFIG -->

<!-- BEGIN OF BROKER-JENCKS-EXAMPLE.XML -->

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

    <!--
==================================================================== -->
    <!-- ActiveMQ Broker Configuration -->
    <!--
==================================================================== -->
    <broker>
        <connector>
            <tcpServerTransport uri="tcp://localhost:51616" backlog="1000"
useAsyncSend="true"
                                maxOutstandingMessages="50"/>
        </connector>
    </broker>
    <bean class="org.apache.activemq.xbean.XBeanBrokerService"
destroy-method="destroy"/>
   
</beans>

<-- END OF BROKER-JENCKS-EXAMPLE.XML -->


Here is what tomcat is a snipit of tomcat's output:
Jul 7, 2006 3:11:08 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 979 ms
Jul 7, 2006 3:11:08 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Jul 7, 2006 3:11:08 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/5.5.17
Jul 7, 2006 3:11:08 PM org.apache.catalina.core.StandardHost start
INFO: XML validation disabled
Jul 7, 2006 3:11:10 PM org.apache.coyote.http11.Http11BaseProtocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Jul 7, 2006 3:11:10 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Jul 7, 2006 3:11:10 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/184  config=null
Jul 7, 2006 3:11:10 PM org.apache.catalina.storeconfig.StoreLoader load
INFO: Find registry server-registry.xml at classpath resource
Jul 7, 2006 3:11:10 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2196 ms
Jul 7, 2006 3:12:10 PM org.springframework.web.context.ContextLoader
initWebApplicationContext
INFO: Root WebApplicationContext: initialization started
Jul 7, 2006 3:12:10 PM org.springframework.core.CollectionFactory <clinit>
INFO: JDK 1.4+ collections available
Jul 7, 2006 3:12:10 PM org.springframework.core.CollectionFactory <clinit>
INFO: Commons Collections 3.x available
Jul 7, 2006 3:12:10 PM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[jencks-website-example-spring.xml]
Jul 7, 2006 3:12:10 PM
org.springframework.context.support.AbstractRefreshableApplicationContext
refreshBeanFactory
INFO: Bean factory for application context [Root WebApplicationContext]:
org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans
[transactionContextManager,userTransaction,transactionManager,transactionSupport,poolingSupport,connectionManager,broker,jmsResourceAdapter,jmsManagedConnectionFactory,jmsConnectionFactory,jmsQueue,jencks,inboundConnectorA];
root of BeanFactory hierarchy
Jul 7, 2006 3:12:11 PM
org.springframework.context.support.AbstractApplicationContext refresh
INFO: 13 beans defined in application context [Root WebApplicationContext]
Jul 7, 2006 3:12:11 PM
org.springframework.context.support.AbstractApplicationContext
initMessageSource
INFO: Unable to locate MessageSource with name 'messageSource': using
default
[org.springframework.context.support.DelegatingMessageSource@1060478]
Jul 7, 2006 3:12:11 PM
org.springframework.context.support.AbstractApplicationContext
initApplicationEventMulticaster
INFO: Unable to locate ApplicationEventMulticaster with name
'applicationEventMulticaster': using default
[org.springframework.context.event.SimpleApplicationEventMulticaster@16f25a7]
Jul 7, 2006 3:12:11 PM
org.springframework.ui.context.support.UiApplicationContextUtils
initThemeSource
INFO: Unable to locate ThemeSource with name 'themeSource': using default
[org.springframework.ui.context.support.ResourceBundleThemeSource@1e228bc]
Jul 7, 2006 3:12:11 PM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in factory
[org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans
[transactionContextManager,userTransaction,transactionManager,transactionSupport,poolingSupport,connectionManager,broker,jmsResourceAdapter,jmsManagedConnectionFactory,jmsConnectionFactory,jmsQueue,jencks,inboundConnectorA];
root of BeanFactory hierarchy]
Jul 7, 2006 3:12:11 PM
org.springframework.beans.factory.xml.XmlBeanDefinitionReader
loadBeanDefinitions
INFO: Loading XML bean definitions from class path resource
[broker-jencks-example.xml]
Jul 7, 2006 3:12:12 PM
org.springframework.context.support.AbstractRefreshableApplicationContext
refreshBeanFactory
INFO: Bean factory for application context
[org.apache.xbean.spring.context.ResourceXmlApplicationContext;hashCode=28036099]:
org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans [org.apache.activemq.xbean.XBeanBrokerService]; root of
BeanFactory hierarchy
Jul 7, 2006 3:12:12 PM
org.springframework.context.support.AbstractApplicationContext refresh
INFO: 1 beans defined in application context
[org.apache.xbean.spring.context.ResourceXmlApplicationContext;hashCode=28036099]
Jul 7, 2006 3:12:12 PM
org.springframework.context.support.AbstractApplicationContext
initMessageSource
INFO: Unable to locate MessageSource with name 'messageSource': using
default [org.springframework.context.support.DelegatingMessageSource@5b0668]
Jul 7, 2006 3:12:12 PM
org.springframework.context.support.AbstractApplicationContext
initApplicationEventMulticaster
INFO: Unable to locate ApplicationEventMulticaster with name
'applicationEventMulticaster': using default
[org.springframework.context.event.SimpleApplicationEventMulticaster@1d5a0]
Jul 7, 2006 3:12:12 PM
org.springframework.beans.factory.support.DefaultListableBeanFactory
preInstantiateSingletons
INFO: Pre-instantiating singletons in factory
[org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans [org.apache.activemq.xbean.XBeanBrokerService]; root of
BeanFactory hierarchy]
Jul 7, 2006 3:12:12 PM org.apache.activemq.broker.BrokerService getBroker
INFO: ActiveMQ 4.0.1 JMS Message Broker (localhost) is starting
Jul 7, 2006 3:12:12 PM org.apache.activemq.broker.BrokerService getBroker
INFO: For help or more information please see:
http://incubator.apache.org/activemq/
Jul 7, 2006 3:12:14 PM org.apache.activemq.store.jdbc.JDBCPersistenceAdapter
createAdapter
INFO: Database driver recognized: [apache_derby_embedded_jdbc_driver]
Jul 7, 2006 3:12:15 PM
org.apache.activemq.store.journal.JournalPersistenceAdapter recover
INFO: Journal Recovery Started from: Active Journal: using 2 x 20.0 Megs at:
/usr/local/java/tools/tomcat/apache-tomcat-5.5.17/bin/activemq-data/localhost/journal
Jul 7, 2006 3:12:15 PM
org.apache.activemq.store.journal.JournalPersistenceAdapter recover
INFO: Journal Recovered: 0 message(s) in transactions recovered.
Jul 7, 2006 3:12:16 PM org.apache.activemq.broker.BrokerService start
INFO: ActiveMQ JMS Message Broker (localhost,
ID:localhost.localdomain-44465-1152299532378-1:0) started
Jul 7, 2006 3:12:16 PM
org.springframework.transaction.jta.JtaTransactionManager afterPropertiesSet
INFO: Using JTA UserTransaction:
org.apache.geronimo.transaction.context.GeronimoTransactionManager@15dc37d
Jul 7, 2006 3:12:16 PM
org.springframework.transaction.jta.JtaTransactionManager afterPropertiesSet
INFO: Using JTA TransactionManager:
org.apache.geronimo.transaction.context.GeronimoTransactionManager@15dc37d
Jul 7, 2006 3:12:16 PM org.jencks.JCAConnector afterPropertiesSet
INFO: Activating endpoint for activationSpec:
ActiveMQActivationSpec{acknowledgeMode='Auto-acknowledge',
destinationType='javax.jms.Topic', messageSelector='null',
destination='test.spring.inboundConnectorA', clientId='null',
subscriptionName='null', subscriptionDurability='NonDurable'} using
endpointFactory:
org.jencks.DefaultEndpointFactory@1c5ddd3[transactionManager=org.apache.geronimo.transaction.context.GeronimoTransactionManager@15dc37d]
Jul 7, 2006 3:12:16 PM org.jencks.JCAContainer afterPropertiesSet
INFO: Jencks JCA Container (http://jencks.org/) has started running version:
1.1.2
Jul 7, 2006 3:12:16 PM org.springframework.web.context.ContextLoader
initWebApplicationContext
INFO: Using context class
[org.springframework.web.context.support.XmlWebApplicationContext] for root
WebApplicationContext
Jul 7, 2006 3:12:16 PM org.springframework.web.context.ContextLoader
initWebApplicationContext
INFO: Root WebApplicationContext: initialization completed in 5983 ms
Jul 7, 2006 3:12:47 PM org.apache.activemq.ra.ActiveMQEndpointWorker
reconnect
INFO: Endpoint connection to JMS broker failed: Could not connect to broker
URL: tcp://localhost:51616. Reason: java.net.ConnectException: Connection
refusedJul 7, 2006 3:12:47 PM org.apache.activemq.ra.ActiveMQEndpointWorker
reconnect
INFO: Endpoint will try to reconnect to the JMS broker in 30 seconds
Jul 7, 2006 3:13:17 PM org.apache.activemq.ra.ActiveMQEndpointWorker
reconnect
INFO: Endpoint connection to JMS broker failed: Could not connect to broker
URL: tcp://localhost:51616. Reason: java.net.ConnectException: Connection
refusedJul 7, 2006 3:13:17 PM org.apache.activemq.ra.ActiveMQEndpointWorker
reconnect
INFO: Endpoint will try to reconnect to the JMS broker in 30 seconds
Jul 7, 2006 3:13:47 PM org.apache.activemq.ra.ActiveMQEndpointWorker
reconnect
INFO: Endpoint connection to JMS broker failed: Could not connect to broker
URL: tcp://localhost:51616. Reason: java.net.ConnectException: Connection
refusedJul 7, 2006 3:13:47 PM org.apache.activemq.ra.ActiveMQEndpointWorker
reconnect
INFO: Endpoint will try to reconnect to the JMS broker in 30 seconds
Jul 7, 2006 3:14:17 PM org.apache.activemq.ra.ActiveMQEndpointWorker
reconnect
INFO: Endpoint connection to JMS broker failed: Could not connect to broker
URL: tcp://localhost:51616. Reason: java.net.ConnectException: Connection
refused

<-- END OF TOMCAT SNIPPIT -->

in case it matters, I am using tomcat 5.5.17.   Any help would be greatly
appreciated!!!

Thank you for your time,

-Jeff
-- 
View this message in context: http://www.nabble.com/Broker-URL-connection-refused.-tf1908389.html#a5223790
Sent from the ActiveMQ - User forum at Nabble.com.


Mime
View raw message