On 5/11/06, SP Liu <[EMAIL PROTECTED]> wrote:

Hi Guillaume!
It can be incompatble between Geronimo's ActiveMQ and ServiceMix's.so I
followed your instruction that embedding a broker and creating an ActiveMQ
connection factory in servicemix.xml file using spring.It seemed to work
fine.
Unfortunately,if i deployed two different jms's SA by this method,some
errors occur in Geronimo as below:

...
21:09:22,984 INFO  [DefaultListableBeanFactory] Pre-instantiating singletons
in factory
[org.springframework.beans.factory.support.DefaultListableBeanFactory
defining beans [org.apache.activemq.xbean.XBeanBrokerService]; root of
BeanFactory hierarchy]
21:09:22,984 INFO  [BrokerService] ActiveMQ 4.0-RC2 JMS Message Broker
(localhost) is starting
21:09:22,984 INFO  [BrokerService] For help or more information please see:
http://incubator.apache.org/activemq/
21:09:23,000 ERROR [BrokerService] Failed to start ActiveMQ JMS Message
Broker. Reason: javax.management.InstanceAlreadyExistsException:
org.apache.activemq:BrokerName=localhost,Type=Broker
javax.management.InstanceAlreadyExistsException:
org.apache.activemq:BrokerName=localhost,Type=Broker
...

You'll need to disable one of the ActiveMQ instances. It looks like
the one started by Geronimo (ActiveMQ 3.x) is conflicting with the one
started by ServiceMix (ActiveMQ 4.x). Is there a particular reason
that you're trying to run ServiceMix on Geronimo? The reason I ask is
because running ServiceMix standalone may be suitable.

The similar problem occur when running two different jms's example in SM's
standalone mode as below:

...
 Loading Apache ServiceMix from file: servicemix.xml
WARN - ManagementContext$1.run(86) | Failed to start jmx connector: Cannot
bind
to URL [rmi://localhost:1099/jmxrmi]:
javax.naming.NameAlreadyBoundException: jm
xrmi [Root exception is java.rmi.AlreadyBoundException: jmxrmi]
ERROR - BrokerService.start(370) | Failed to start ActiveMQ JMS Message
Broker.
Reason: java.net.BindException: Address already in use: JVM_Bind
java.net.BindException: Address already in use: JVM_Bind
...


You'll need to tell the each RMI registry instance to run on it's own
port. Below is a portion of the ws-notification configuration from the
examples included with ServiceMix (I am unable to offer the URL as the
Subversion repo is still down):

<sm:container id="jbi"
               name="wsn1"
               embedded="true"
               MBeanServer="#mbeanServer">
 <sm:flow>
   <bean class="org.apache.servicemix.jbi.nmr.flow.jms.JMSFlow">
     <property name="connectionFactory" ref="connectionFactory" />
   </bean>
 </sm:flow>
...
 </sm:container>

 <!-- JMX server and connector -->
 <bean id="mbeanServer"
class="org.springframework.jmx.support.MBeanServerFactoryBean"/>

 <bean id="registry" class="mx4j.tools.naming.NamingService"
init-method="start">
   <!-- tell each RMI registry to run on it's own port! -->
   <property name="port" value="1092"/>
 </bean>

 <bean id="serverConnector"
class="org.springframework.jmx.support.ConnectorServerFactoryBean"
depends-on="registry">
   <property name="objectName" value="connector:name=rmi"/>
   <property name="serviceUrl"
value="service:jmx:rmi:///jndi/rmi://localhost:1092/jmxrmi"/>
   <property name="threaded" value="true"/>
   <property name="daemon" value="true"/>
 </bean>

 <bean id="connectionFactory"
       class="org.apache.activemq.ActiveMQConnectionFactory">
   <property name="brokerURL"
value="peer://localhost/wsnbroker2?broker.persistent=false" />
 </bean>

The configuration above tells the RMI registry to run on it's own port
and since the JMS flow is specificed it starts a broker instance and
sets up a ActiveMQConnectionFactory using the peer protocol to point
to this broker instance. Other ServiceMix instances use this same
broker URL and protocol.

I know that both of above are caused because we start a broker for each by
embedding activemq.xml.
then I try to add a shared broker to solve these by ServiceMixGBean's
doStart() Method,but failed to start broker by gbean.

What's error/stack trace was thrown when this happened?

Bruce
--
perl -e 'print unpack("u30","D0G)[EMAIL 
PROTECTED]&5R\"F)R=6-E+G-N>61E<D\!G;6%I;\"YC;VT*"
);'

Apache Geronimo - http://geronimo.apache.org/
Apache ActiveMQ - http://incubator.apache.org/activemq/
Apache ServiceMix - http://incubator.apache.org/servicemix/
Castor - http://castor.org/

Reply via email to