Uploaded image for project: 'QuickFIX/J'
  1. QuickFIX/J
  2. QFJ-393

When using JmxExporter, restarting QFJ Initiator throws Exception re-registering mbean

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Default
    • Resolution: Fixed
    • Affects Version/s: 1.3.1, 1.3.3
    • Fix Version/s: 1.4.0
    • Component/s: Engine
    • Labels:
      None

      Description

      See http://sourceforge.net/mailarchive/forum.php?thread_name=ce06b7320901101754l6050baf0j888ae610bdd7bf04%40mail.gmail.com&forum_name=quickfixj-users

      I am using the JmxExporter class to expose QFJ to JMX. If I attempt to
      shutdown and restart my QFJ instance (my stopping then restarting my
      Initiator within the same process) then I get the following exception
      because QFJ tries to export to JMX again.

      ... ... ERROR org.quickfixj.jmx.mbean.connector.ConnectorJmxExporter -
      Failed to export connector MBean
      javax.management.InstanceAlreadyExistsException:
      org.quickfixj:type=Session,beginString=FIX.4.2,xxxxxxxx
      at com.sun.jmx.mbeanserver.Repository.addMBean(Repository.java:453)
      at
      com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.internal_addObject(DefaultMBeanServerInterceptor.java:1484)
      at
      com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerDynamicMBean(DefaultMBeanServerInterceptor.java:963)
      at
      com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerObject(DefaultMBeanServerInterceptor.java:917)
      at
      com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.registerMBean(DefaultMBeanServerInterceptor.java:312)
      at
      com.sun.jmx.mbeanserver.JmxMBeanServer.registerMBean(JmxMBeanServer.java:482)
      at
      org.quickfixj.jmx.mbean.session.SessionJmxExporter.export(SessionJmxExporter.java:28)
      at
      org.quickfixj.jmx.mbean.connector.ConnectorJmxExporter.export(ConnectorJmxExporter.java:66)
      at
      org.quickfixj.jmx.mbean.connector.ConnectorJmxExporter.export(ConnectorJmxExporter.java:46)
      at org.quickfixj.jmx.JmxExporter.export(JmxExporter.java:60)

      Spring has a solution to this kind of thing with
      MBeanRegistrationSupport.setRegistrationBehaviorName<http://static.springframework.org/spring/docs/2.0.x/api/org/springframework/jmx/support/MBeanRegistrationSupport.html#setRegistrationBehaviorName%28java.lang.String%29>.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              jerryshea Jerry Shea
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: