Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-3398

JMX Naming issue - cannot register the mutil endpoints with same service bean

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 2.3.4
    • Core, Management
    • None

    Description

      It looks like there is bug in CXF that it cannot register two different Endpoint to JMX if both has a same service bean (although we deploy both endpoint on different url.). Please see my example below, it will throw the exception javax.management.InstanceAlreadyExistsException. I think the issue is that cxf is using

      I have two suggestions:

      • Can we short the JMX namespace and its name for cxf endpoint? It likes okay in visualvm, however, it will become a really long name when we use command-line interface of jmx, e.g. jmxsh.
      • Can CXF allow the user to customize the JMX name space and JMX endpoint name?
       
          public static void main(String[] args) throws Throwable {
      
              InstrumentationManagerImpl im = new InstrumentationManagerImpl();
              im.setBus(BusFactory.getDefaultBus());
              im.setEnabled(true);
              im.setServer(ManagementFactory.getPlatformMBeanServer());
              im.init();
              im.register();
      
              HelloWorldImpl helloworldImpl1 = new HelloWorldImpl();
              ServerFactoryBean svrFactory = new ServerFactoryBean();
              svrFactory.setAddress("http://localhost:9000/Hello");
              svrFactory.setServiceBean(helloworldImpl1);
              svrFactory.create();
      
              HelloWorldImpl helloworldImpl2 = new HelloWorldImpl();
              ServerFactoryBean svrFactory2 = new ServerFactoryBean();
              svrFactory2.setAddress("http://localhost:9000/Hello2");
              svrFactory2.setServiceBean(helloworldImpl2);
              svrFactory2.create();
      
              System.out.println("Server ready...");
      
              Thread.sleep(5 * 60 * 1000);
              System.out.println("Server exiting");
              System.exit(0);
          }
      

      Attachments

        Activity

          People

            dkulp Daniel Kulp
            veaven David Liu
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: