[jencks-user] Outbound JMS and a MessageDriven POJO in the same context I'm having some trouble setting up an outbound JMS and a MessageDriven POJO in the same context. Everything works like a charm until uncommenting the two lines in the resource adapter - all the sudden two instances of the broker is started. I'm running Java 1.5.0_02, spring-framework-1.2.5, activemq-3.1 and jencks-1.0. Could anyone give an pointers on what's happening? I'm quite new to the whole JCA thing, so maybe I'm misunderstanding something... Thanks! Daniel 2005-09-25 18:29:10,507 [main ] INFO SpringBrokerContainerFactory - Loading ActiveMQ broker from configuration: class path resource [test/activemq.xml] 2005-09-25 18:29:10,529 [main ] INFO ActiveMQBeanDefinitionReader - Loading XML bean definitions from class path resource [test/activemq.xml] 2005-09-25 18:29:17,303 [main ] INFO BrokerContainerImpl - ActiveMQ 3.1 JMS Message Broker (ID:Mini.local-57361-1127665750379-0:0) is starting 2005-09-25 18:29:17,304 [main ] INFO BrokerContainerImpl - For help or more information please see: http://www.logicblaze.com 2005-09-25 18:29:17,599 [main ] INFO VmTransportServerChannel - Listening for connections at: vm://localhost 2005-09-25 18:29:17,600 [main ] INFO BrokerConnectorImpl - ActiveMQ connector started: VmTransportServerChannel@vm://localhost 2005-09-25 18:29:17,600 [main ] INFO TcpTransportServerChannel - Listening for connections at: tcp://Mini.local:61616 2005-09-25 18:29:17,602 [main ] INFO BrokerConnectorImpl - ActiveMQ connector started: TcpTransportServerChannel@tcp://Mini.local:61616 2005-09-25 18:29:17,602 [main ] INFO BrokerContainerImpl - ActiveMQ JMS Message Broker (ID:Mini.local-57361-1127665750379-0:0) has started 2005-09-25 18:29:17,679 [main ] INFO SpringBrokerContainerFactory - Loading ActiveMQ broker from configuration: class path resource [test/activemq.xml] 2005-09-25 18:29:17,687 [main ] INFO ActiveMQBeanDefinitionReader - Loading XML bean definitions from class path resource [test/activemq.xml] java.net.BindException: Address already in use

Sun, 25 Sep 2005 09:49:07 -0700

I'm having some trouble setting up an outbound JMS and a MessageDriven POJO in the same context. Everything works like a charm until uncommenting the two lines in the resource adapter - all the sudden two instances of the broker is started.

I'm running Java 1.5.0_02, spring-framework-1.2.5, activemq-3.1 and jencks-1.0.

Could anyone give an pointers on what's happening? I'm quite new to the whole JCA thing, so maybe I'm misunderstanding something...

Thanks!
Daniel


<!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="connectionManager" class="org.jencks.factory.ConnectionManagerFactoryBean">
        <property name="transactionSupport">
            <bean class="org.jencks.factory.XATransactionFactoryBean">
                <property name="useTransactionCaching" value="true"/>
                <property name="useThreadCaching" value="false"/>
            </bean>
        </property>
        <property name="poolingSupport">
            <bean class="org.jencks.factory.SinglePoolFactoryBean">
                <property name="maxSize" value="2"/>
                <property name="minSize" value="1"/>
<property name="blockingTimeoutMilliseconds" value="60"/>
                <property name="idleTimeoutMinutes" value="60"/>
                <property name="matchOne" value="true"/>
                <property name="matchAll" value="true"/>
                <property name="selectOneAssumeMatch" value="true"/>
            </bean>
        </property>
    </bean>

<bean id="bootstrapContext" class="org.jencks.factory.BootstrapContextFactoryBean">
        <property name="threadPoolSize" value="25"/>
    </bean>

    <bean id="jcaContainer" class="org.jencks.JCAContainer">
        <property name="bootstrapContext" ref="bootstrapContext"/>
        <property name="resourceAdapter" ref="resourceAdapter"/>
    </bean>

<bean id="resourceAdapter" class="org.activemq.ra.ActiveMQResourceAdapter">
        <property name="serverUrl" value="vm://localhost"/>
        <!--<property name="useEmbeddedBroker" value="true"/>-->
<!--<property name="brokerXmlConfig" value="classpath:test/ activemq.xml"/>-->
    </bean>

    <!--
          ###### JMS ######
    -->

<bean id="jmsConnectionFactory" class="org.springframework.jca.support.LocalConnectionFactoryBean">
        <property name="managedConnectionFactory">
<bean class="org.activemq.ra.ActiveMQManagedConnectionFactory"> <property name="resourceAdapter" ref="resourceAdapter"/>
            </bean>
        </property>
        <property name="connectionManager" ref="connectionManager"/>
    </bean>

<bean id="jmsTemplate" class="org.springframework.jms.core.JmsTemplate">
        <property name="connectionFactory" ref="jmsConnectionFactory"/>
        <property name="pubSubDomain" value="false"/>
    </bean>

<bean id="testConnector" factory-method="addConnector" factory- bean="jcaContainer">
        <property name="activationSpec">
            <bean class="org.activemq.ra.ActiveMQActivationSpec">
<property name="destination" value="broker.jencks- test"/> <property name="destinationType" value="javax.jms.Queue"/> <property name="resourceAdapter" ref="resourceAdapter"/>
            </bean>
        </property>
        <property name="ref" value="testReceiver"/>
    </bean>

<bean id="testReceiver" class="test.TestJmsMessageListener" singleton="true"/>

</beans>


2005-09-25 18:29:10,507 [main ] INFO SpringBrokerContainerFactory - Loading ActiveMQ broker from configuration: class path resource [test/activemq.xml] 2005-09-25 18:29:10,529 [main ] INFO ActiveMQBeanDefinitionReader - Loading XML bean definitions from class path resource [test/activemq.xml] 2005-09-25 18:29:17,303 [main ] INFO BrokerContainerImpl - ActiveMQ 3.1 JMS Message Broker (ID:Mini.local-57361-1127665750379-0:0) is starting 2005-09-25 18:29:17,304 [main ] INFO BrokerContainerImpl - For help or more information please see: http://www.logicblaze.com 2005-09-25 18:29:17,599 [main ] INFO VmTransportServerChannel - Listening for connections at: vm://localhost 2005-09-25 18:29:17,600 [main ] INFO BrokerConnectorImpl - ActiveMQ connector started: [EMAIL PROTECTED]://localhost 2005-09-25 18:29:17,600 [main ] INFO TcpTransportServerChannel - Listening for connections at: tcp://Mini.local:61616 2005-09-25 18:29:17,602 [main ] INFO BrokerConnectorImpl - ActiveMQ connector started: [EMAIL PROTECTED]://Mini.local:61616 2005-09-25 18:29:17,602 [main ] INFO BrokerContainerImpl - ActiveMQ JMS Message Broker (ID:Mini.local-57361-1127665750379-0:0) has started 2005-09-25 18:29:17,679 [main ] INFO SpringBrokerContainerFactory - Loading ActiveMQ broker from configuration: class path resource [test/activemq.xml] 2005-09-25 18:29:17,687 [main ] INFO ActiveMQBeanDefinitionReader - Loading XML bean definitions from class path resource [test/activemq.xml]
java.net.BindException: Address already in use

Reply via email to