Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8213735

Invalid ObjectName can be created and fails at deserialization time

    XMLWordPrintable

    Details

      Description

      A DESCRIPTION OF THE PROBLEM :
      One uses the ObjectName constructor with domain/map. One value needs quoting but is not.
      The ObjectName instantiation succeed then an MBean is registered with this name.
      Connect JConsole to the server, the connection will fail, the MBean name desisrialization fails on the client side.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
              ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("objname2.ser"));
              Hashtable keys = new Hashtable<>();
              keys.put("worker", "Remoting \"cli_client\"");
              ObjectName obj = new ObjectName("org.xnio", keys);
              oos.writeObject(obj);
              // Uncomment this line and the construction will fail.
             //ObjectName obj2 = new ObjectName("org.xnio:worker=Remoting \"cli_client\"");
              ObjectInputStream iis = new ObjectInputStream(new FileInputStream("objname2.ser"));
             // Will fail at deserialization time.
              ObjectName objname = (ObjectName) iis.readObject();
              System.out.println(objname);


      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              asapre Amit Sapre
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated: