0 Replies Latest reply on Mar 11, 2017 11:55 PM by Dave Whitla

    Read server JMX attributes in @Singleton @Startup @PostConstruct

    Dave Whitla Newbie

      It seems that on Wildfly 10.1.0 server JMX attributes can not be reliably read from @PostConstruct methods of @Singleton @Startup annotated beans.

       

      For example I often (but not always) get exceptions stating that the resource does not exist when attempting to read jboss.as:socket-binding-group=standard-sockets.

      I would expect that the server's base configuration has been established *before* execution of bean @PostConstruct methods.

      I require this functionality to determine the port and interface on which the running application is listening.

       

      A further complication occurs when trying to reliably determine exactly which socket is bound to a given WAR's listener in cases where the container has been configured with many listeners.

      To do that you must read attributes of the subdeployment which is currently in progress.

      I am trying to discover this information in the @PostConstruct method of the first-loaded singleton bean (ensured via @DependOn) because *every* invocation of other services requires the information to have already been retrieved.

       

      Is this a bug/design flaw in Wildfly?