activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dejan Bosanac" <de...@nighttale.net>
Subject Re: NPE for ${requestContext.brokerQuery.brokerAdmin.brokerName}
Date Tue, 06 Jan 2009 11:11:57 GMT
Hi,
you have to enable JMX for your broker in order to have properly working web
console.

Cheers
--
Dejan Bosanac

Open Source Integration - http://fusesource.com/
ActiveMQ in Action - http://www.manning.com/snyder/
Blog - http://www.nighttale.net


On Tue, Jan 6, 2009 at 1:12 AM, Shahzad Bhatti <bhatti@plexobject.com>wrote:

>
> I made some progress and I can see the first page index.jsp shows up
> properly, but when I try to add queue it fails, here is my
> webapps/admin/WEB-INF/webconsole-embedded.xml
>
>
>
>
> <beans>
>
>  <bean id="placeholderConfig"
>
> class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer">
>        <property name="locations">
>                <value>credentials.properties</value>
> <!--
>
> <value>file:///${activemq.base}/conf/credentials.properties</value>
> -->
>        </property>
>  </bean>
>
>  <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"/>
>    <property name="userName" value="${activemq.username}"/>
>    <property name="password" value="${activemq.password}"/>
>  </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>
>
>
>
>
> When I try to create queue or topic, I get
> HTTP Status 500 -
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that prevented it
> from fulfilling this request.
>
> exception
>
> org.springframework.web.util.NestedServletException: Request processing
> failed; nested exception is java.lang.IllegalArgumentException: No
> brokerAdmin on the injected brokerFacade:
> org.apache.activemq.web.SingletonBrokerFacade@8c858a
>
>
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:583)
>
>
> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
>
>
> org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
>
>
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>
>  org.apache.activemq.web.SessionFilter.doFilter(SessionFilter.java:43)
>
>
> org.apache.activemq.web.filter.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:81)
>
>
> com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
>
>
> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
>
> root cause
>
> java.lang.IllegalArgumentException: No brokerAdmin on the injected
> brokerFacade: org.apache.activemq.web.SingletonBrokerFacade@8c858a
>
>
> org.apache.activemq.web.DestinationFacade.getBrokerAdmin(DestinationFacade.java:70)
>
>
> org.apache.activemq.web.DestinationFacade.addDestination(DestinationFacade.java:56)
>
>
> org.apache.activemq.web.controller.CreateDestination.handleRequest(CreateDestination.java:38)
>
>
> org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
>
>
> org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
>
>
> org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
>
>
> org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
>
>
> org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:627)
>        javax.servlet.http.HttpServlet.service(HttpServlet.java:729)
>
>
> org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
>
>
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
>
>  org.apache.activemq.web.SessionFilter.doFilter(SessionFilter.java:43)
>
>
> org.apache.activemq.web.filter.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:81)
>
>
> com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
>
>
> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
>
> note The full stack trace of the root cause is available in the Apache
> Tomcat/5.5.27 logs.
> Apache Tomcat/5.5.27
>
>
>
>
> How do I specify brokerAdmin?
>
>
>
> Shahzad Bhatti wrote:
> >
> > Sorry, for the late reply but I have both of those files in WEB-INF and
> as
> > I mentioned I copied all files from admin's WEB-INF except activemq.xml,
> > which I simplified with minimum configuration. Any other ideas? Thanks.
> >
> >
> >
> >
> > Dejan Bosanac wrote:
> >>
> >> Hi,
> >>
> >> as far as I can see from your configuration, you're missing
> >> dispatcher-servlet.xml and webconsole-embedded.xml for starters. Take a
> >> look
> >> at webapps/admin/WEB-INF/ folder of the ActiveMQ distribution for
> >> examples.
> >>
> >> Cheers
> >> --
> >> Dejan Bosanac
> >>
> >> Open Source Integration - http://fusesource.com/
> >> ActiveMQ in Action - http://www.manning.com/snyder/
> >> Blog - http://www.nighttale.net
> >>
> >>
> >> On Wed, Dec 24, 2008 at 7:14 PM, Shahzad Bhatti
> >> <bhatti@plexobject.com>wrote:
> >>
> >>>
> >>> I am trying to setup embedded ActiveMQ inside Tomcat. It is largely
> >>> based
> >>> on
> >>> admin webapp included in the distribution. However, when the server
> >>> starts
> >>> up, I see
> >>>
> >>> type Exception report
> >>>
> >>> message
> >>>
> >>> description The server encountered an internal error () that prevented
> >>> it
> >>> from fulfilling this request.
> >>>
> >>> exception
> >>>
> >>> org.apache.jasper.JasperException: Exception in JSP: /index.jsp:39
> >>>
> >>> 36: <table>
> >>> 37:     <tr>
> >>> 38:         <td>Name</td>
> >>> 39:
> >>> <td>${requestContext.brokerQuery.brokerAdmin.brokerName}</td>
> >>> 40:     </tr>
> >>> 41:     <tr>
> >>> 42:         <td>ID</td>
> >>>
> >>>
> >>> Stacktrace:
> >>>
> >>>
> >>>
> org.apache.jasper.servlet.JspServletWrapper.handleJspException(JspServletWrapper.java:451)
> >>>
> >>>
> >>>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:373)
> >>>
> >>>
> >>>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
> >>>
>  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> >>>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>>
> >>>
> >>>
> org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
> >>>
> >>>
> >>>
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> >>>
> >>>  org.apache.activemq.web.SessionFilter.doFilter(SessionFilter.java:43)
> >>>
> >>>
> >>>
> org.apache.activemq.web.filter.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:81)
> >>>
> >>>
> >>>
> com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
> >>>
> >>>
> >>>
> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
> >>>
> >>> root cause
> >>>
> >>> java.lang.NullPointerException
> >>>
> >>>
> >>>
> org.apache.activemq.web.filter.ApplicationContextFilter$2.get(ApplicationContextFilter.java:157)
> >>>        org.apache.commons.el.ArraySuffix.evaluate(ArraySuffix.java:218)
> >>>
> >>> org.apache.commons.el.ComplexValue.evaluate(ComplexValue.java:145)
> >>>
> >>>
> >>>
> org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:263)
> >>>
> >>>
> >>>
> org.apache.commons.el.ExpressionEvaluatorImpl.evaluate(ExpressionEvaluatorImpl.java:190)
> >>>
> >>>
> >>>
> org.apache.jasper.runtime.PageContextImpl.proprietaryEvaluate(PageContextImpl.java:924)
> >>>        org.apache.jsp.index_jsp._jspService(index_jsp.java:77)
> >>>
> >>> org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:98)
> >>>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>>
> >>>
> >>>
> org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:331)
> >>>
> >>>
> >>>
> org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:329)
> >>>
>  org.apache.jasper.servlet.JspServlet.service(JspServlet.java:265)
> >>>        javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >>>
> >>>
> >>>
> org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:83)
> >>>
> >>>
> >>>
> org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
> >>>
> >>>  org.apache.activemq.web.SessionFilter.doFilter(SessionFilter.java:43)
> >>>
> >>>
> >>>
> org.apache.activemq.web.filter.ApplicationContextFilter.doFilter(ApplicationContextFilter.java:81)
> >>>
> >>>
> >>>
> com.opensymphony.module.sitemesh.filter.PageFilter.parsePage(PageFilter.java:118)
> >>>
> >>>
> >>>
> com.opensymphony.module.sitemesh.filter.PageFilter.doFilter(PageFilter.java:52)
> >>>
> >>>
> >>>
> >>>
> >>> My activemq.xml looks like
> >>> <beans
> >>>  xmlns="http://www.springframework.org/schema/beans"
> >>>  xmlns:amq="http://activemq.apache.org/schema/core"
> >>>  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>>  xsi:schemaLocation="http://www.springframework.org/schema/beans
> >>> http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
> >>>  http://activemq.apache.org/schema/core
> >>> http://activemq.apache.org/schema/core/activemq-core.xsd
> >>>  http://activemq.apache.org/camel/schema/spring
> >>> http://activemq.apache.org/camel/schema/spring/camel-spring.xsd">
> >>>
> >>>
> >>>  <broker xmlns="http://activemq.apache.org/schema/core"
> useJmx="false">
> >>>
> >>>    <persistenceAdapter>
> >>>      <journaledJDBC journalLogFiles="5" dataDirectory="../data"/>
> >>>    </persistenceAdapter>
> >>>
> >>>    <transportConnectors>
> >>>      <transportConnector uri="tcp://localhost:61616"/>
> >>>      <transportConnector uri="stomp://localhost:61613"/>
> >>>    </transportConnectors>
> >>>
> >>>  </broker>
> >>>
> >>> </beans>
> >>>
> >>>
> >>>
> >>> And web.xml looks like
> >>> <web-app xmlns="http://java.sun.com/xml/ns/j2ee"
> >>>         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> >>>         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee
> >>>         http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
> >>>         version="2.4">
> >>>
> >>>  <description> Apache ActiveMQ Web Console </description>
> >>>  <display-name>ActiveMQ Console</display-name>
> >>>
> >>>    <!-- context config -->
> >>>    <context-param>
> >>>        <param-name>org.apache.activemq.brokerURL</param-name>
> >>>    <param-value>/WEB-INF/activemq.xml</param-value>
> >>>        <description>The URL of the Message Broker to connect
> >>> to</description>
> >>>    </context-param>
> >>>
> >>>
> >>>
> >>>    <context-param>
> >>>        <param-name>org.apache.activemq.embeddedBroker</param-name>
> >>>        <param-value>true</param-value>
> >>>        <description>Whether we should include an embedded broker or
> >>> not</description>
> >>>    </context-param>
> >>>
> >>>
> >>>  <listener>
> >>>
> >>>
> >>>
> <listener-class>org.apache.activemq.web.SpringBrokerContextListener</listener-class>
> >>>  </listener>
> >>>
> >>>  <filter>
> >>>    <filter-name>sitemesh</filter-name>
> >>>
> >>>
> >>>
> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class>
> >>>  </filter>
> >>>
> >>>  <filter-mapping>
> >>>    <filter-name>sitemesh</filter-name>
> >>>    <url-pattern>/*</url-pattern>
> >>>  </filter-mapping>
> >>>
> >>>  <!--
> >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >>> -->
> >>>  <!--              Expose Spring POJOs to JSP
> >>> -->
> >>>  <!--
> >>> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> >>> -->
> >>>  <filter>
> >>>    <filter-name>spring</filter-name>
> >>>
> >>>
> >>>
> <filter-class>org.apache.activemq.web.filter.ApplicationContextFilter</filter-class>
> >>>  </filter>
> >>>
> >>>  <filter-mapping>
> >>>    <filter-name>spring</filter-name>
> >>>    <url-pattern>/*</url-pattern>
> >>>  </filter-mapping>
> >>>
> >>>
> >>>  <!-- the subscription REST servlet -->
> >>>  <servlet>
> >>>    <servlet-name>AjaxServlet</servlet-name>
> >>>    <servlet-class>org.apache.activemq.web.AjaxServlet</servlet-class>
> >>>    <load-on-startup>1</load-on-startup>
> >>>  </servlet>
> >>>  <servlet-mapping>
> >>>    <servlet-name>AjaxServlet</servlet-name>
> >>>    <url-pattern>/ajax/*</url-pattern>
> >>>  </servlet-mapping>
> >>>
> >>>  <servlet>
> >>>    <servlet-name>SendServlet</servlet-name>
> >>>
>  <servlet-class>org.apache.activemq.web.MessageServlet</servlet-class>
> >>>    <load-on-startup>1</load-on-startup>
> >>>  </servlet>
> >>>  <servlet-mapping>
> >>>    <servlet-name>SendServlet</servlet-name>
> >>>    <url-pattern>/send/*</url-pattern>
> >>>  </servlet-mapping>
> >>>
> >>>  <!-- the queue browse servlet -->
> >>>  <servlet>
> >>>    <servlet-name>QueueBrowseServlet</servlet-name>
> >>>
> >>>
> <servlet-class>org.apache.activemq.web.QueueBrowseServlet</servlet-class>
> >>>  </servlet>
> >>>  <servlet-mapping>
> >>>    <servlet-name>QueueBrowseServlet</servlet-name>
> >>>    <url-pattern>/queueBrowse/*</url-pattern>
> >>>  </servlet-mapping>
> >>>
> >>>  <!-- track the session usage for web JMS clients -->
> >>>  <filter>
> >>>    <filter-name>session</filter-name>
> >>>    <filter-class>org.apache.activemq.web.SessionFilter</filter-class>
> >>>  </filter>
> >>>
> >>>  <filter>
> >>>    <filter-name>spring-rq</filter-name>
> >>>
> >>>
> >>>
> <filter-class>org.springframework.web.filter.RequestContextFilter</filter-class>
> >>>  </filter>
> >>>
> >>>  <filter-mapping>
> >>>    <filter-name>session</filter-name>
> >>>    <url-pattern>/*</url-pattern>
> >>>  </filter-mapping>
> >>>  <filter-mapping>
> >>>    <filter-name>spring-rq</filter-name>
> >>>    <url-pattern>/*</url-pattern>
> >>>  </filter-mapping>
> >>>
> >>>  <servlet>
> >>>    <servlet-name>dispatcher</servlet-name>
> >>>
> >>>
> >>>
> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
> >>>    <load-on-startup>2</load-on-startup>
> >>>  </servlet>
> >>>
> >>>  <servlet-mapping>
> >>>    <servlet-name>dispatcher</servlet-name>
> >>>    <url-pattern>*.action</url-pattern>
> >>>  </servlet-mapping>
> >>>
> >>>  <welcome-file-list>
> >>>    <welcome-file>index.html</welcome-file>
> >>>    <welcome-file>index.jsp</welcome-file>
> >>>  </welcome-file-list>
> >>>
> >>>  <jsp-config>
> >>>    <jsp-property-group>
> >>>      <url-pattern>*.jsp</url-pattern>
> >>>      <include-prelude>/WEB-INF/jspf/headertags.jspf</include-prelude>
> >>>    </jsp-property-group>
> >>>  </jsp-config>
> >>> </web-app>
> >>>
> >>>
> >>>
> >>> How do I specify admin URL. Any idea how to fix this error? Thanks.
> >>>
> >>>
> >>> --
> >>> View this message in context:
> >>>
> http://www.nabble.com/NPE-for-%24%7BrequestContext.brokerQuery.brokerAdmin.brokerName%7D-tp21156924p21156924.html
> >>> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
> >>>
> >>>
> >>
> >>
> >> -----
> >> Dejan Bosanac
> >>
> >>
> >> http://www.ttmsolutions.com - get a free ActiveMQ user guide
> >>
> >> ActiveMQ in Action - http://www.manning.com/snyder/
> >> Scripting in Java - http://www.scriptinginjava.net
> >>
> >
> >
>
> --
> View this message in context:
> http://www.nabble.com/NPE-for-%24%7BrequestContext.brokerQuery.brokerAdmin.brokerName%7D-tp21156924p21301556.html
> Sent from the ActiveMQ - User mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message