activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Eric Ma <eric...@db.com>
Subject Re: JBoss 4.2.3.GA Embedded AMQ 5.2.0 broker and web console help
Date Fri, 09 Jan 2009 13:53:51 GMT


Dejan Bosanac wrote:
> 
> Hi Eric,
> 
> I didn't try embedding web console into JBoss, but from what you said it
> seems to me that the problem with your configuration is the default
> WEB-INF/webconsole-embedded.xml configuration file that tries to start new
> broker instance.
> 
> Can you try replacing it with webconsole-invm.xml or the one I provided
> with
> the article and see if it helps?
> 
> Cheers
> --
> Dejan Bosanac
> 
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
> 
> 
> On Thu, Jan 8, 2009 at 9:48 PM, Eric Ma <eric.ma@db.com> wrote:
> 
>>
>> I embedded AMQ 5.2.0 inside JBoss 4.2.3.GA by following Bruce Snyder's
>> article at
>> http://activemq.apache.org/integrating-apache-activemq-with-jboss.html.
>> That's all working, and I can see the queues I set up from the JBoss
>> jmx-console.  Now I am struggling to make the AMQ web console to work in
>> the
>> same JBoss instance.  I can deploy activemq-web-console-5.2.0.war to
>> JBoss,
>> and I see 4 Topics, but I cannot see the queues I set up.  The log file
>> shows the following exception when the war is deployed:
>>
>> 15:04:50,200 INFO  [STDOUT] 2009-01-08 15:04:50,197 [ScannerThread  ]
>> DEBUG
>> ManagementContext              - Failed to create local registry
>> java.rmi.server.ExportException: Port already in use: 1099;
>>
>> There have been several threads on this topic:
>>
>>
>> http://www.oreillynet.com/onjava/blog/2007/06/integrating_activemq_web_conso.html
>>
>> http://www.nabble.com/Web-console-not-working-with-embedded-broker-setup-via-java-with-no-xml-configuration.-td20686813.html
>>
>> http://www.nabble.com/Embedded-Brokers-%2B-Web-Console-td17467975s2354.html#a17467975
>>
>> http://www.nabble.com/How-to-monitor-ActiveMQ-that-run-in-JBOSS-td12291171.html#a12291171
>>
>> http://markmail.org/message/7uwuzidqm4dmhaq7?q=activemq+WebConsole+in+embedded+mode
>>
>> but there is no single definitive set of steps to follow nor config file
>> samples.  Dejan Bosanac's article comes close, but not clear enough (all
>> the
>> maven stuff made it more confusing :-( )
>>
>> Can someone post their working config here?  Thanks,
>> --
>> View this message in context:
>> http://www.nabble.com/JBoss-4.2.3.GA-Embedded-AMQ-5.2.0-broker-and-web-console-help-tp21360682p21360682.html
>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>>
>>
> 
> 
> -----
> Dejan Bosanac
> 
> Open Source Integration - http://fusesource.com/
> ActiveMQ in Action - http://www.manning.com/snyder/
> Blog - http://www.nighttale.net
> 

Thanks for your reply Dejan.  I tried both of your suggestions, but neither
worked.  Here is what I did:

1. Changed the content of webconsole-default to

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                           http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">


  <import resource="webconsole-embedded.xml"/>
  
</beans>

2a. Changed the content of wenconsole-embedded.xml to that of
webconsole-invm.xml:

<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xmlns:aop="http://www.springframework.org/schema/aop"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
                           http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-2.0.xsd">

  <bean id="placeholderConfig"
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
/>
  
  
  <bean id="sessionPool" class="org.apache.activemq.web.SessionPool">
  	<property name="connectionFactory" ref="connectionFactory"/>
  </bean>

  <bean id="brokerRegistry"
class="org.apache.activemq.broker.BrokerRegistry"
factory-method="getInstance"/>
  <bean id="brokerService" factory-bean="brokerRegistry"
factory-method="findFirst"/>
  <bean id="brokerURL" factory-bean="brokerService"
factory-method="getVmConnectorURI"/>

  <bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
    <constructor-arg ref="brokerURL"/>
  </bean>

  <bean id="brokerQuery" class="org.apache.activemq.web.LocalBrokerFacade"
autowire="constructor" scope="prototype"/>

  <bean id="queueBrowser" class="org.apache.activemq.web.QueueBrowseQuery"
autowire="constructor" destroy-method="destroy" scope="request"/>
  <bean id="messageQuery" class="org.apache.activemq.web.MessageQuery"
autowire="constructor" destroy-method="destroy" scope="request"/>

</beans>

I got the following exception in my JBoss log:

08:42:50,530 ERROR [[/amq-web-console]] Exception sending context
initialized event to listener instance of class
org.apache.activemq.web.WebConsoleStarter
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'sessionPool' defined in ServletContext resource
[/WEB-INF/webconsole-embedded.xml]: Cannot resolve reference to bean
'connectionFactory' while setting bean property 'connectionFactory'; nested
exception is org.springframework.beans.factory.BeanCreationException: Error
creating bean with name 'connectionFactory' defined in ServletContext
resource [/WEB-INF/webconsole-embedded.xml]: Cannot resolve reference to
bean 'brokerURL' while setting constructor argument; nested exception is
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'brokerURL' defined in ServletContext resource
[/WEB-INF/webconsole-embedded.xml]: factory-bean 'brokerService' returned
null
        at
org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:275)
...

2b.  Changed the content of wenconsole-embedded.xml to that in your article
at
http://www.oreillynet.com/onjava/blog/2007/06/integrating_activemq_web_conso.html

<beans>

  <bean id="placeholderConfig"
     
class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"
/>

  <!-- use the following bean for a local in-JVM broker -->
  <bean id="brokerQuery"
      class="org.apache.activemq.web.SingletonBrokerFacade"
      autowire='constructor' singleton="false"/>

  <bean id="sessionPool"
      class="org.apache.activemq.web.SessionPool">
  	<property name="connectionFactory" ref="connectionFactory"/>
  </bean>

  <bean id="connectionFactory"
class="org.apache.activemq.ActiveMQConnectionFactory">
    <property name="brokerURL" value="vm://localhost"/>
  </bean>

  <bean id="queueBrowser"
      class="org.apache.activemq.web.QueueBrowseQuery"
      autowire='constructor' singleton="false"/>
  <bean id="messageQuery"
      class="org.apache.activemq.web.MessageQuery"
      autowire='constructor' singleton="false"/>

</beans>

I got the following exception in my JBoss log:

08:32:32,837 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
java.lang.IllegalArgumentException: No BrokerService is registered with the
BrokerRegistry. Are you sure there is a configured broker in the same
ClassLoader?
        at
org.apache.activemq.web.SingletonBrokerFacade.findSingletonBroker(SingletonBrokerFacade.java:35)
        at
org.apache.activemq.web.SingletonBrokerFacade.<init>(SingletonBrokerFacade.java:29)
...

So, more work to do for the ActiveMQ team :-)

Eric




-- 
View this message in context: http://www.nabble.com/JBoss-4.2.3.GA-Embedded-AMQ-5.2.0-broker-and-web-console-help-tp21360682p21372726.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Mime
View raw message