Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-11190

SAR jboss-service MBean start with @Postconstruct annotation called twice.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Won't Do
    • Minor
    • None
    • 10.1.0.Final
    • Server
    • None
    • Hide

      A simple service

      <?xml version="1.0" encoding="UTF-8"?>
      <server xmlns="urn:jboss:service:7.0"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd">
      <mbean code="my.MyManagement"
      name="my:service=MyService">
      </mbean>
      </server>

      Show
      A simple service <?xml version="1.0" encoding="UTF-8"?> <server xmlns="urn:jboss:service:7.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:jboss:service:7.0 jboss-service_7_0.xsd"> <mbean code="my.MyManagement" name="my:service=MyService"> </mbean> </server>
    • Hide

      Just remove the annotation or rename the method

      Show
      Just remove the annotation or rename the method
    • High

    Description

      Start and stop are "magic" method names for jboss services.
      As a result the method is invoked twice.

      I would expect the object has already started, so why call it again.
      This is the same for Predestroy and stop() method.

      In WFLYSRV0049: WildFly Full 10.1.0.Final (WildFly Core 2.2.0.Final) starting

      @PostConstruct
      public void start() {
      logger.info(this.hashCode() + "configuration for " + this.getBaseDir() + " " + System.getProperties().getProperty("jboss.server.config.dir"));
      }

      Output is

      (ServerService Thread Pool – 69) 2034435521 configuration for /opt/wildfly/standalone/configuration /opt/wildfly/standalone/configuration
      (ServerService Thread Pool – 69) 2034435521 configuration for /opt/wildfly/standalone/configuration /opt/wildfly/standalone/configuration

      Attachments

        Activity

          People

            jgreene@redhat.com Jason Greene
            wozza.xing Wozza Xing (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: