1 Reply Latest reply on May 18, 2011 4:37 AM by jaikiran

    Error while opening an URLConnection

    prasad.deshpande

      Hi, I'm trying to open a file using URLConnection inside a servlet & it throws me following exception. I'm using jboss-6.1.0-SNAPSHOT on windows platform.

       

      java.net.URISyntaxException: Illegal character in opaque part at index 7: file:D:\jboss-5.1.0-SVN\eFp\eFp-Current\server.properties

       

      Not sure if anyone has tried it before. File URL seems to be correct but still I get above exception. Could anyone please highlight? Please ignore the path of the file even if it says jboss-5.1.0 I just have a directory with that name, it has nothing to do with actual 5.1.0 version.

       

      I'm also attaching my servlet code.

        • 1. Error while opening an URLConnection
          jaikiran

          Prasad Deshpande wrote:

           

           

           

          java.net.URISyntaxException: Illegal character in opaque part at index 7: file:D:\jboss-5.1.0-SVN\eFp\eFp-Current\server.properties

           

          ... File URL seems to be correct but still I get above exception.

          I don't think so. Try:

           

          file://D:\jboss-5.1.0-SVN\eFp\eFp-Current\server.properties

           

          (notice the // after the file: )