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

Cannot read proxy information from Firefox profile with absolute path

XMLWordPrintable

    • x86
    • linux_ubuntu

      FULL PRODUCT VERSION :
      java version "1.8.0_73"
      Java(TM) SE Runtime Environment (build 1.8.0_73-b02)
      Java HotSpot(TM) Server VM (build 25.73-b02, mixed mode)


      ADDITIONAL OS VERSION INFORMATION :
      (slightly modified) Ubuntu 12.04

      output of "uname -a":

      Linux tester45 3.13.0-34-generic #60~precise1-Ubuntu SMP Wed Aug 13 15:57:32 UTC 2014 i686 i686 i386 GNU/Linux

      EXTRA RELEVANT SYSTEM CONFIGURATION :
      The client running Java (Web Start) is running inside a network where a proxy is needed in order to connect to the internet. The proxy configuration is made using an automatic proxy configuration URL (Proxy-autoconfig file, "PAC file").
      Firefox is installed and an automatic proxy configuration URL is configured in Firefox.
      Java is configured to use the proxy settings from the browser.


      A DESCRIPTION OF THE PROBLEM :
      As described under [1], Java Web Start obtains the proxy information through reading and parsing the preference file of Firefox.

      The preferences file "prefs.js" is located in the folder containing the Firefox profile.
      The location of each Firefox profile can be configured, e.g. using Firefox's profile manager.

      If a profile location outside the "$HOME/.mozilla" directory is configured, Java Web Start does not correctly retrieve the proxy configuration and therefore running Java Web Start applications fails if the proxy is needed.

      Note: The proxy information is corectly retrieved if the profile is located inside the directory "$HOME/.mozilla/firefox" (where it is created by default if not specified otherwise).

      [1] http://docs.oracle.com/javase/8/docs/technotes/guides/deploy/deployment_networking.html#JSDPG953

      STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
      * Delete any existing Mozilla profiles/configuration (if present): "rm -rf ~/.mozilla"
      * start Firefox Profile Manager: "firefox -ProfileManager"
      * create a new profile NOT inside "$HOME/.mozilla", e.g.:
        * click "Create Profile"
        * Click "Next"
        * Click "Choose Folder"
        * create and select a folder "$HOME/firefoxprofile" (in reality, this can e.g. be on a netshare,...)
        * click "Finish"
      * start Firefox and configure an automatic proxy configuration URL ("Edit" -> "Preferences" -> "Advanced" -> button "Settings" next to "Configure how Firefox connects to the Internet") - set the URL for the PAC file that describes the proxy configuration
      * configure Java to use the proxy configuration from the browser
        * run "jcontrol"
        * "Network Settings" -> "Use browser settings"
      * try to run a Java Web Start application, e.g. by running the following command: "javaws http://www.safe-registrierung.de/regclient/SAFEUserManager.jnlp"

      Note: The current Firefox version 44 from Mozilla was used to reproduce this. Names/descriptions might slightly differ in other Firefox versions.


      EXPECTED VERSUS ACTUAL BEHAVIOR :
      EXPECTED -
      The Java Web Start application launches.

      ACTUAL -
      A error window appears that has the title "Application Error" and the message "Unable to launch the application."
      When clicking on the "Details" button, the following Exception information given in the next field is displayed.

      The file "$HOME/.mozilla/firefox/profiles.ini" has the following content (everything in between "---START OF FILE---" and "---END OF FILE---"):

      --START OF FILE--
      [General]
      StartWithLastProfile=1

      [Profile0]
      Name=Default User
      IsRelative=0
      Path=/home/tester45.qmux/firefoxprofile
      Default=1
      ---END OF FILE---

      The output of "strace" shows (among others) the following line:

      5107 stat64("/home/tester45.qmux/.mozilla/firefox/home/tester45.qmux/firefoxprofile/prefs.js", 0x64dadbcc) = -1 ENOENT (No such file or directory)

      This seems to show that Java Web Start tries to interpret the file given under "Path" as relative to "$HOME/.mozilla/firefox".
      However, this should be taken as an absolute path, as the line "IsRelative=0" in the file "profiles.ini" indicates.

      It seems like Java does currently not take that into account.

      ERROR MESSAGES/STACK TRACES THAT OCCUR :
      CouldNotLoadArgumentException[ Could not load file/URL specified: http://www.safe-registrierung.de/regclient/SAFEUserManager.jnlp]
      at com.sun.javaws.Main.launchApp(Unknown Source)
      at com.sun.javaws.Main.continueInSecureThread(Unknown Source)
      at com.sun.javaws.Main.access$000(Unknown Source)
      at com.sun.javaws.Main$1.run(Unknown Source)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.net.UnknownHostException: www.safe-registrierung.de
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:184)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
      at java.net.Socket.connect(Socket.java:589)
      at java.net.Socket.connect(Socket.java:538)
      at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
      at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
      at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
      at sun.net.www.http.HttpClient.New(HttpClient.java:308)
      at sun.net.www.http.HttpClient.New(HttpClient.java:326)
      at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:1169)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect0(HttpURLConnection.java:1105)
      at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:989)
      at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:987)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:782)
      at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:986)
      at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:933)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(HttpURLConnection.java:1513)
      at sun.net.www.protocol.http.HttpURLConnection.access$200(HttpURLConnection.java:90)
      at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1433)
      at sun.net.www.protocol.http.HttpURLConnection$9.run(HttpURLConnection.java:1431)
      at java.security.AccessController.doPrivileged(Native Method)
      at java.security.AccessController.doPrivilegedWithCombiner(AccessController.java:782)
      at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1430)
      at com.sun.deploy.net.HttpUtils.followRedirects(Unknown Source)
      at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
      at com.sun.deploy.net.BasicHttpRequest.doRequest(Unknown Source)
      at com.sun.deploy.net.BasicHttpRequest.doGetRequest(Unknown Source)
      at com.sun.javaws.jnl.LaunchDescFactory._buildDescriptor(Unknown Source)
      at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
      at com.sun.javaws.jnl.LaunchDescFactory.buildDescriptor(Unknown Source)
      ... 5 more

      REPRODUCIBILITY :
      This bug can be reproduced always.

      CUSTOMER SUBMITTED WORKAROUND :
      possibility 1:
      create profile in "default location", i.e. underneath $HOME/.mozilla/firefox (However, that makes it impossible e.g. to put them on a netshare)

      possibility 2:
      manually create a symlink $HOME/.mozilla/firefox/home that points to /home


            dmarkov Dmitry Markov
            webbuggrp Webbug Group
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: