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

StyleManager tries to load file from the network when using the "file://" protocol

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P2 P2
    • None
    • fx2.1
    • javafx
    • Win XP
      JavaFX 2.1 b.14

      I'm specifying a main CSS file for my JavaFX application. In order to use a local file I'm using the "file://" prefix
      However the StyleManager is unable to load the file trying to load it from the network hanging the application for 10 seconds(I guess it's a connection timeout)

      For ex. if the following file is specified:
      file://D:/Office/Project/Workflow/fx_workflow_editor/javafx2.0-editor/nbproject/dist/resources/skins/standard/main.css

      I get an exception
      java.net.UnknownHostException: D
      java.net.UnknownHostException: D
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:195)
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:366)
      at java.net.Socket.connect(Socket.java:529)
      at java.net.Socket.connect(Socket.java:478)
      at sun.net.NetworkClient.doConnect(NetworkClient.java:163)
      at sun.net.NetworkClient.openServer(NetworkClient.java:118)
      at sun.net.ftp.FtpClient.openServer(FtpClient.java:488)
      at sun.net.ftp.FtpClient.openServer(FtpClient.java:475)
      at sun.net.www.protocol.ftp.FtpURLConnection.connect(FtpURLConnection.java:270)
      at sun.net.www.protocol.ftp.FtpURLConnection.getInputStream(FtpURLConnection.java:352)
      at java.net.URL.openStream(URL.java:1010)
      at com.sun.javafx.css.Stylesheet.loadBinary(Unknown Source)
      at com.sun.javafx.css.StyleManager$2.run(Unknown Source)
      at com.sun.javafx.css.StyleManager$2.run(Unknown Source)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.javafx.css.StyleManager.loadStylesheet(Unknown Source)
      at com.sun.javafx.css.StyleManager.updateStylesheets(Unknown Source)
      at javafx.stage.Window.impl_visibleChanging(Unknown Source)
      at javafx.stage.Stage.impl_visibleChanging(Unknown Source)
      at javafx.stage.Window$13.invalidated(Unknown Source)
      at javafx.beans.property.BooleanPropertyBase.markInvalid(Unknown Source)
      at javafx.beans.property.BooleanPropertyBase.set(Unknown Source)
      at javafx.stage.Window.setShowing(Unknown Source)
      at javafx.stage.Window.show(Unknown Source)
      at javafx.stage.Stage.show(Unknown Source)
      at workflow.gui.javafx2.WorkflowEditorApplication.start(WorkflowEditorApplication.java:90)
      at com.sun.javafx.application.LauncherImpl$5.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl$4.run(Unknown Source)
      at com.sun.javafx.application.PlatformImpl$3.run(Unknown Source)
      at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
      at com.sun.glass.ui.win.WinApplication.access$100(Unknown Source)
      at com.sun.glass.ui.win.WinApplication$2$1.run(Unknown Source)
      at java.lang.Thread.run(Thread.java:662)
      INFO: com.sun.javafx.css.StyleManager loadStylesheet Could not load stylesheet: file://D:/Office/Project/Workflow/fx_workflow_editor/javafx2.0-editor/nbproject/dist/resources/skins/standard//main.css

      If I use only one slash("file:/") it is working..however this is incorrect.

      Note that I can reproduce this problem only on Windows: on Mac the right prefix "file://" is working... ("file:/" is not working)

            dgrieve David Grieve
            kiriljfx Kiril (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: