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

FileNotFoundException from Unmarshaller.unmarshal(File f), if f contains #

XMLWordPrintable

    • generic
    • generic

      FULL PRODUCT VERSION :
      java version "1.8.0_66"
      Java(TM) SE Runtime Environment (build 1.8.0_66-b17)
      Java HotSpot(TM) 64-Bit Server VM (build 25.66-b17, mixed mode)

      ADDITIONAL OS VERSION INFORMATION :
      Microsoft Windows [Version 6.1.7601]

      A DESCRIPTION OF THE PROBLEM :
      unmarshaller.unmarshal(new File("C:\SomeDir#\Foo.xml")) fails with FileNotFoundException even, if the file exists. Seems that javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal( File f ) does not properly url-escape the path, when converting the file object to the url.

      There was already an discussion about this issue in 2009, but it seems that no bug was filed.

      See: https://community.oracle.com/thread/1626574?start=0&tstart=0


      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      Construct a FileInpuStream from File and call unmarshal( java.io.InputStream is )

            rgrigoriadi Roman Grigoriadi (Inactive)
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: