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

"Access is denied" when launching in "!" folder

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Cannot Reproduce
    • Icon: P4 P4
    • None
    • 6
    • core-svc

      FULL PRODUCT VERSION :
      1.5.0_16
      1.6.0_07

      ADDITIONAL OS VERSION INFORMATION :
      Windows XP service pack 3

      A DESCRIPTION OF THE PROBLEM :
      Last line of the following code:
      String host;
      int port;
      JMXServiceURL url = new JMXServiceURL("jmxmp", host, port);
      JMXConnector connector = JMXConnectorFactory.connect(url);
      MBeanServerConnection beanServerConnection = connector.getMBeanServerConnection();
      throws java.lang.IllegalArgumentException: javax.management. remote.JMXConnectorProvider: : java.io.FileNotFoundException: C:\Documents and Settings\Serge (Access is denied)
      when launched in any folder, containing "!" in its name.
      In my case it was C:\Documents and Settings\Serge\!knowledgeBase.
      At the same time, it works fine in any folder without "!" in its name.

      I assume, java treats "!" in URL as beginning of jar entry and tries to open jar, which is in fact folder.

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      Compile and run (requires jmxremote_optional.jar) 'Bug.java' provided below

      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      Expected connection top be established
      ACTUAL -
      Exception in console, with the root cause
      java.io.FileNotFoundException: C:\Documents and Settings\Serge (Access is denied)

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      Exception in thread "main" java.lang.IllegalArgumentException: javax.management.
      remote.JMXConnectorProvider: : java.io.FileNotFoundException: C:\Documents and Settings\Serge (Access is denied)
              at com.sun.jmx.remote.util.Service.fail(Service.java:129)
              at com.sun.jmx.remote.util.Service.parse(Service.java:208)
              at com.sun.jmx.remote.util.Service.access$100(Service.java:111)
              at com.sun.jmx.remote.util.Service$LazyIterator.hasNext(Service.java:257)
              at javax.management.remote.JMXConnectorFactory.getConnectorAsService(JMXConnectorFactory.java:424)
              at javax.management.remote.JMXConnectorFactory.newJMXConnector(JMXConnectorFactory.java:310)
              at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:247)
              at javax.management.remote.JMXConnectorFactory.connect(JMXConnectorFactory.java:207)
              at Bug.main(Bug.java:11)

      REPRODUCIBILITY :
      This bug can be reproduced always.

      ---------- BEGIN SOURCE ----------
      //Bug.java
      //requires jmxremote.jar @ compile time
      //requires jmxremote_optional.jar @ runtime

      import javax.management.*;
      import javax.management.remote.*;

      public class Bug {

        public static void main(String args[])
          throws Exception {

          MBeanServerConnection beanServerConnection = null;
          JMXServiceURL url = new JMXServiceURL("jmxmp", "localhost", 55000);
          JMXConnector connector = JMXConnectorFactory.connect(url);
          beanServerConnection = connector.getMBeanServerConnection();
        }
      }
      ---------- END SOURCE ----------

      CUSTOMER SUBMITTED WORKAROUND :
      Remove "!" from folder name

            jbachorik Jaroslav BachorĂ­k
            emcmanus Eamonn McManus
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: