Uploaded image for project: 'JBoss Enterprise Application Platform'
  1. JBoss Enterprise Application Platform
  2. JBEAP-14613

(7.1.z) MBean query in servlet init leads to messaging subsystem errors on server startup

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 7.1.4.CR1, 7.1.4.GA
    • 7.1.1.GA
    • None
    • None
    • Hide

      Force servlet lazy init by not using load-on-startup

      Show
      Force servlet lazy init by not using load-on-startup
    • Hide

      1. Ensure EAP 7.1 server is stopped
      2. Build and deploy the following application https://github.com/jamesnetherton/examples/tree/master/eap/servlet-init-test
      3. Start EAP 7.1 with the 'full' profile: standalone.sh -c standalone-full.xml
      4. Observe errors output from the messaging subsystem

      Show
      1. Ensure EAP 7.1 server is stopped 2. Build and deploy the following application https://github.com/jamesnetherton/examples/tree/master/eap/servlet-init-test 3. Start EAP 7.1 with the 'full' profile: standalone.sh -c standalone-full.xml 4. Observe errors output from the messaging subsystem

      There are some Servlets which perform MBean queries during Servlet init where loadOnStartup is set.

      For example:

      @WebServlet(name = "HttpServiceServlet", urlPatterns = { "/*" }, loadOnStartup = 1)
      public class MyServlet extends HttpServlet {
      
          @Override
          public void init() throws ServletException {
              super.init();
              MBeanServer mBeanServer = ManagementFactory.getPlatformMBeanServer();
              try {
                  mBeanServer.queryNames(new ObjectName("*:type=security,area=jmx,*"), null);
              } catch (MalformedObjectNameException e) {
                  e.printStackTrace();
              }
          }
      }
      

      Full example here:

      https://github.com/jamesnetherton/examples/tree/master/eap/servlet-init-test

      When EAP is started with the 'full' profile, this leads to some errors being output from the messaging subsystem:

      09:07:36,518 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 69) WFLYCTL0013: Operation ("read-resource-description") failed - address: ([
          ("subsystem" => "messaging-activemq"),
          ("server" => "default"),
          ("pooled-connection-factory" => "activemq-ra"),
          ("statistics" => "pool")
      ]) - failure description: "WFLYCTL0030: No resource definition is registered for address [
          (\"subsystem\" => \"messaging-activemq\"),
          (\"server\" => \"default\"),
          (\"pooled-connection-factory\" => \"activemq-ra\"),
          (\"statistics\" => \"pool\")
      ]"
      09:07:36,682 ERROR [org.jboss.as.controller.management-operation] (ServerService Thread Pool -- 69) WFLYCTL0013: Operation ("read-resource-description") failed - address: ([
          ("subsystem" => "messaging-activemq"),
          ("server" => "default"),
          ("pooled-connection-factory" => "activemq-ra"),
          ("statistics" => "pool")
      ]) - failure description: "WFLYCTL0030: No resource definition is registered for address [
          (\"subsystem\" => \"messaging-activemq\"),
          (\"server\" => \"default\"),
          (\"pooled-connection-factory\" => \"activemq-ra\"),
          (\"statistics\" => \"pool\")
      ]"
      

      I tested on WildFly 12 and this issue does not occur.

              jondruse@redhat.com Jiri Ondrusek
              jnethert@redhat.com James Netherton
              Peter Mackay Peter Mackay
              Peter Mackay Peter Mackay
              Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated:
                Resolved: