2 Replies Latest reply on Jan 22, 2009 7:48 PM by broadband

    JMS Local queue viewing exception

      I am currently trying to establish a prototype for JMS messaging via EJB 3.0 using JBoss 5.0 as the application server and when establishing a new JMS Local queue via xml config an exception is encountered when attempting to view the queue.

      When going to the application server and going to:

      J2EE Domains -> JBoss.management.local -> JBoss -> J2EE Resources -> LocalJMS -> Queues

      and select my queue I encounter a servlet exception which presents the following details in the Eclipse console view of the server:

      10:55:54,277 ERROR [[jsp]] Servlet.service() for servlet jsp threw exception
      org.apache.jasper.JasperException: Unable to compile class for JSP:

      An error occurred at line: 10 in the jsp file: /Queue.jsp
      MessageCounter cannot be resolved to a type
      7: <%
      8: String resetUrl = response.encodeURL(request.getRequestURI()) + "?doReset=true&ObjectName=" + java.net.URLEncoder.encode(request.getParameter("ObjectName"));
      9: String myUrl = response.encodeURL(request.getRequestURI()) + "?" + "&ObjectName=" + java.net.URLEncoder.encode(request.getParameter("ObjectName"));
      10: MessageCounter counter = queue.getMessageCounter()[0];
      11:
      12: //check reset first
      13: String doReset = request.getParameter("doReset");


      An error occurred at line: 10 in the jsp file: /Queue.jsp
      The method getMessageCounter() is undefined for the type QueueMBean
      7: <%
      8: String resetUrl = response.encodeURL(request.getRequestURI()) + "?doReset=true&ObjectName=" + java.net.URLEncoder.encode(request.getParameter("ObjectName"));
      9: String myUrl = response.encodeURL(request.getRequestURI()) + "?" + "&ObjectName=" + java.net.URLEncoder.encode(request.getParameter("ObjectName"));
      10: MessageCounter counter = queue.getMessageCounter()[0];
      11:
      12: //check reset first
      13: String doReset = request.getParameter("doReset");

      ....
      ....
      ....

      Stacktrace:
      at org.apache.jasper.compiler.DefaultErrorHandler.javacError(DefaultErrorHandler.java:92)
      at org.apache.jasper.compiler.ErrorDispatcher.javacError(ErrorDispatcher.java:330)
      at org.apache.jasper.compiler.JDTCompiler.generateClass(JDTCompiler.java:423)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:335)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:313)
      at org.apache.jasper.compiler.Compiler.compile(Compiler.java:300)
      at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:585)
      at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:312)
      at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:322)
      at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:249)
      at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)
      at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
      at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:235)
      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:828)
      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:601)
      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
      at java.lang.Thread.run(Unknown Source)

      I suspect there are some config's missing, however uncertain as I've been currently searching and following what guides I can on how to create queues. The queue is created by the following in a ***-service.xml file:


      <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager


      There are serveral questions associated with these:

      Has anyone encountered this problem before if so how was it resolved since I'm unable to find any past entries on this error?

      How to stop this exception from occuring on the JBoss application server?

      Are there are any better guides to establishing queues both locally accessible and remotely accessible?

        • 1. Re: JMS Local queue viewing exception
          peterj

          Looks like you are using the web console (http://localhost:8080/web-console). It is not surprising that it is not working. I am not even sure if it was updated to work with JBoss Messaging, it might still assume JBossMQ.

          Most people define message destinations using a *-service.xml file. You can find an example file at docs/examples/jms/example-destinations-service.xml. Once you have your *-service.xml file with your destinations, copy it to the deploy directory.

          If you really want to do it online, then install Embedded Jopr - it is the new admin console and should work better. http://www.jboss.org/embjopr/

          • 2. Re: JMS Local queue viewing exception

            Thanks for the assistence and confirmation of the config being incorrect with the alternative destination configuration used it now works.