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

Failure to create an element using Builders is not propagated

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Fixed
    • Affects Version/s: 7u6
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:
    • Subcomponent:

      Description

      The following piece of FXML does not load properly, because the file name contains spaces.
      However, instead of failing to load, the FXMLLoader logs a message (see stack trace logged below),
      and then calls LoadListener.endElement(null);

      I think a better behaviour would be to propagate the exception - which would allow for a better reporting of what is going wrong.

          <MediaView id="01 Rolling In The Deep.m4a♫" layoutX="300.0" layoutY="200.0">
            <!-- SceneBuilder: Selection.locked="true" -->
            <mediaPlayer>
              <MediaPlayer cycleCount="-1">
                <media>
                  <Media source="@../Music/iTunes/iTunes%20Music/Adele/21/01 Rolling In The Deep.m4a" />
                </media>
              </MediaPlayer>
            </mediaPlayer>
          </MediaView>


      Jun 22, 2012 10:15:17 AM javafx.fxml.JavaFXBuilder$ObjectBuilder build
      WARNING: Failed to build instance of class javafx.scene.media.Media using class javafx.scene.media.MediaBuilder
      java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at javafx.fxml.JavaFXBuilder$ObjectBuilder.build(JavaFXBuilderFactory.java:212)
      at javafx.fxml.FXMLLoader$ValueElement.processEndElement(FXMLLoader.java:584)
      at javafx.fxml.FXMLLoader.processEndElement(FXMLLoader.java:2421)
      at javafx.fxml.FXMLLoader.load(FXMLLoader.java:2129)
      at com.oracle.javafx.authoring.persist.FXMLDocument.load(FXMLDocument.java:151)
      at com.oracle.javafx.authoring.persist.LoadFxml$2.call(LoadFxml.java:66)
      at com.oracle.javafx.authoring.persist.LoadFxml.loadElement(LoadFxml.java:140)
      at com.oracle.javafx.authoring.persist.LoadFxml.loadScreenData(LoadFxml.java:182)
      at com.oracle.javafx.authoring.Project.forFxml(Project.java:802)
      at com.oracle.javafx.authoring.Project.forFxml(Project.java:778)
      at com.oracle.javafx.authoring.DesignerTool.loadFXMLLayout(DesignerTool.java:142)
      at com.oracle.javafx.authoring.DesignerTool.loadFXMLLayout(DesignerTool.java:131)
      at com.oracle.javafx.authoring.ApplicationMenu$84.handle(ApplicationMenu.java:2617)
      at com.oracle.javafx.authoring.ApplicationMenu$84.handle(ApplicationMenu.java:2614)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
      at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:28)
      at javafx.event.Event.fireEvent(Event.java:171)
      at javafx.scene.control.MenuItem.fire(MenuItem.java:455)
      at com.sun.javafx.scene.control.GlobalMenuAdapter$6.handle(GlobalMenuAdapter.java:159)
      at com.sun.javafx.scene.control.GlobalMenuAdapter$6.handle(GlobalMenuAdapter.java:157)
      at com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:69)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:217)
      at com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:170)
      at com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:37)
      at com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:92)
      at com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:53)
      at com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:33)
      at javafx.event.Event.fireEvent(Event.java:171)
      at javafx.scene.control.MenuItem.fire(MenuItem.java:455)
      at com.sun.javafx.tk.quantum.GlassSystemMenu$6.action(GlassSystemMenu.java:219)
      Caused by: java.lang.IllegalArgumentException: java.net.URISyntaxException: Illegal character in path at index 63: file:/Users/danielfuchs/Music/iTunes/iTunes%20Music/Adele/21/01 Rolling In The Deep.m4a
      at javafx.scene.media.Media.<init>(Media.java:359)
      at javafx.scene.media.MediaBuilder.build(MediaBuilder.java:65)
      ... 39 more
      Caused by: java.net.URISyntaxException: Illegal character in path at index 63: file:/Users/danielfuchs/Music/iTunes/iTunes%20Music/Adele/21/01 Rolling In The Deep.m4a
      at java.net.URI$Parser.fail(URI.java:2810)
      at java.net.URI$Parser.checkChars(URI.java:2983)
      at java.net.URI$Parser.parseHierarchical(URI.java:3067)
      at java.net.URI$Parser.parse(URI.java:3015)
      at java.net.URI.<init>(URI.java:577)
      at javafx.scene.media.Media.<init>(Media.java:357)
      ... 40 more

        Attachments

          Activity

            People

            • Assignee:
              gkbrown Greg Brown (Inactive)
              Reporter:
              dfuchs Daniel Fuchs
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Imported: