-
Bug
-
Resolution: Unresolved
-
P4
-
7u25
-
I'm using Ubuntu 12.04
javafx.version: 2.2.25
java.vm.version: 23.25-b01
java.vm.vendor: Oracle Corporation
java.vm.name: Java HotSpot(TM) 64-Bit Server VM
java.runtime.version: 1.7.0_25-b15
java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment
javafx.runtime.version: 2.2.25-b15
os.arch: amd64
os.name: Linux
sun.jnu.encoding: UTF-8
os.version: 3.2.0-49-generic
java.specification.version: 1.7
java.version: 1.7.0_25I'm using Ubuntu 12.04 javafx.version: 2.2.25 java.vm.version: 23.25-b01 java.vm.vendor: Oracle Corporation java.vm.name: Java HotSpot(TM) 64-Bit Server VM java.runtime.version: 1.7.0_25-b15 java.awt.graphicsenv: sun.awt.X11GraphicsEnvironment javafx.runtime.version: 2.2.25-b15 os.arch: amd64 os.name: Linux sun.jnu.encoding: UTF-8 os.version: 3.2.0-49-generic java.specification.version: 1.7 java.version: 1.7.0_25
Having this code:
final MediaPlayer result = new MediaPlayer(media);
result.startTimeProperty();
throws an NPE at my system:
Exception in runnable
java.lang.NullPointerException
at javafx.scene.media.MediaPlayer.calculateCycleDuration(MediaPlayer.java:1122)
at javafx.scene.media.MediaPlayer.preReady(MediaPlayer.java:1727)
at javafx.scene.media.MediaPlayer$_PlayerStateListener$1.run(MediaPlayer.java:2251)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:82)
at java.lang.Thread.run(Thread.java:724)
The given media for the player is valid.
On searching the bug, I added a change listener on the status property:
result.statusProperty().addListener(new ChangeListener<Status>() {
@Override
public void changed(ObservableValue<? extends Status> observable, Status oldValue, Status newValue) {
System.out.println("status changed: " + oldValue + " -> " + newValue);
}
});
Output:
status changed: null -> READY
I assume this could be the reason for the NPE. I would not expect getting an NPE but the player dealing internally with the status UNKNOWN instead of null (if this is the reason).
final MediaPlayer result = new MediaPlayer(media);
result.startTimeProperty();
throws an NPE at my system:
Exception in runnable
java.lang.NullPointerException
at javafx.scene.media.MediaPlayer.calculateCycleDuration(MediaPlayer.java:1122)
at javafx.scene.media.MediaPlayer.preReady(MediaPlayer.java:1727)
at javafx.scene.media.MediaPlayer$_PlayerStateListener$1.run(MediaPlayer.java:2251)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:179)
at com.sun.javafx.application.PlatformImpl$4$1.run(PlatformImpl.java:176)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl$4.run(PlatformImpl.java:176)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:76)
at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
at com.sun.glass.ui.gtk.GtkApplication$3$1.run(GtkApplication.java:82)
at java.lang.Thread.run(Thread.java:724)
The given media for the player is valid.
On searching the bug, I added a change listener on the status property:
result.statusProperty().addListener(new ChangeListener<Status>() {
@Override
public void changed(ObservableValue<? extends Status> observable, Status oldValue, Status newValue) {
System.out.println("status changed: " + oldValue + " -> " + newValue);
}
});
Output:
status changed: null -> READY
I assume this could be the reason for the NPE. I would not expect getting an NPE but the player dealing internally with the status UNKNOWN instead of null (if this is the reason).