You should really have a look at the configuration i pointed you to. It creates an embedded broker and several connection factories that communicate with it : the only difference is that the broker is not created by the connection factory, but started on its own.
I'll try to take a look at the problem and see what happens. Cheers, Guillaume ---------- Initial Header ----------- From : Daniel Wiell <[EMAIL PROTECTED]> To : [email protected] Cc : Date : Tue, 27 Sep 2005 22:26:27 +0200 Subject : Re: [jencks-user] Re:[jencks-user] Outbound JMS and a MessageDriven POJO (Try 2) Thanks for looking in to it! Everything works perfect when the "useEmbeddedBroker" and "brokerXmlConfig" properties of the resource adapter are not set - both sending and receiving messages works just fine. If I use an embedded broker and just uncomment the "testConnector" it works - only one instance of ActiveMQ is started. If I leave the "testConnector", and start removing components on the "outbound" side: "jmsTemplate", "jmsConnectionFactory", "connectionManager", "transactionManager" - not until the "userTransaction" is removed, it starts working. The plan was to keep the broker embedded, having two ActiveMQ connectors configured - one over the vm and one over tcp (see the config below), so I'm quite eager to get it working. I don't know, but I get the feeling there are some problems on the Jencks side of things - but I'm really lost on how to fix it or even where to start digging.... /Daniel <beans> <broker> <connector> <serverTransport uri="vm://localhost"/> </connector> <connector> <tcpServerTransport uri="tcp://localhost:61616" backlog="1000" useAsyncSend="true" maxOutstandingMessages="50"/> </connector> <persistence> <vmPersistence/> </persistence> </broker> </beans> On 27 sep 2005, at 21.36, [EMAIL PROTECTED] wrote: > Hi Daniel ! > > I think the problem is due to the way you try to configure > the activemq broker. > I'm not an activemq expert, but i do know that the > useEmbeddedBroker flag tells activemq > to start a broker in the jvm (see > http://activemq.org/How+do+I+embed+a+Broker+inside+a+Connection). > But I do not know why in your config, two brokers try to > start. > > There are working config like yours in jencks cvs (take a > look at > http://cvs.jencks.codehaus.org/jencks/src/test/resources/org/jencks/ > spring-request-reply-jta.xml?rev=1.2&view=auto). > > Btw, are you experiencing any problems when the two lines > are commented ? Maybe no broker is started ? > > Cheers, > Guillaume Nodet > > ---------- Initial Header ----------- > > From : Daniel Wiell <[EMAIL PROTECTED]> > To : [email protected] > Cc : > Date : Tue, 27 Sep 2005 18:42:32 +0200 > Subject : [jencks-user] Outbound JMS and a MessageDriven > POJO (Try 2) > > It seems like I messed up my last message pretty serious, so > I'll > giving it another shot - sorry! > > 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 > > > ------------ ALICE HAUT DEBIT A 29,95 EUR/MOIS ------------ > ALICEBOX, l'offre Internet tout en 1 : ADSL, téléphonie, modem Wi- > Fi et en exclusivité > la hotline gratuite 24h/24 ! Soumis à conditions. Pour en profiter > cliquez ici http://abonnement.aliceadsl.fr > > > ------------ ALICE HAUT DEBIT A 29,95 EUR/MOIS ------------ ALICEBOX, l'offre Internet tout en 1 : ADSL, téléphonie, modem Wi-Fi et en exclusivité la hotline gratuite 24h/24 ! Soumis à conditions. Pour en profiter cliquez ici http://abonnement.aliceadsl.fr
