ObservableValue Stacktrace

John Hendrikx hjohn at xs4all.nl
Wed Jun 5 12:38:54 PDT 2013


Hi List,

I'm getting some log messages sometimes (see at the end) about 
properties being null (whereas I didn't get them before in JavaFX 2.2).

Is this intended as an informative message to the developer, something I 
should report, or just debug code for the JavaFX team?

In this case, the binding is null, and that's fine -- it will be 
populated later, but the binding is already in place -- I thought JavaFX 
was designed to allow nulls in a chain of bindings and
fall back to reasonable defaults for things like Strings, numbers etc?  
Am I doing something wrong?

Code:
{
   private final ObjectProperty<Media> data = new SimpleObjectProperty<>();
   public ObjectProperty<Media> dataProperty() { return data; }

   protected final ObjectBinding<ObservableList<Casting>> castings = 
Bindings.select(dataProperty(), "castings");
}

Log:

Jun 05, 2013 9:15:55 PM 
com.sun.javafx.binding.SelectBinding$SelectBindingHelper getObservableValue
WARNING: Exception while evaluating select-binding [castings]
Jun 05, 2013 9:15:55 PM 
com.sun.javafx.binding.SelectBinding$SelectBindingHelper getObservableValue
WARNING: Property 'castings' in ObjectProperty [bound, value: null] is null
java.lang.NullPointerException
     at 
com.sun.javafx.binding.SelectBinding$SelectBindingHelper.getObservableValue(SelectBinding.java:481)
     at 
com.sun.javafx.binding.SelectBinding$AsObject.computeValue(SelectBinding.java:92)
     at javafx.beans.binding.ObjectBinding.get(ObjectBinding.java:152)
     at 
javafx.beans.binding.ObjectExpression.getValue(ObjectExpression.java:49)
     at 
com.sun.javafx.binding.ExpressionHelper.addListener(ExpressionHelper.java:53)
     at 
javafx.beans.binding.ObjectBinding.addListener(ObjectBinding.java:71)
     at 
javafx.beans.property.ObjectPropertyBase.bind(ObjectPropertyBase.java:170)
     at 
hs.mediasystem.TitledBlockSample.createCastingsRow(TitledBlockSample.java:114)
     at hs.mediasystem.TitledBlockSample.start(TitledBlockSample.java:78)
     at com.sun.javafx.application.LauncherImpl$5.run(LauncherImpl.java:810)
     at com.sun.javafx.application.PlatformImpl$6.run(PlatformImpl.java:260)
     at 
com.sun.javafx.application.PlatformImpl$5$1.run(PlatformImpl.java:226)
     at 
com.sun.javafx.application.PlatformImpl$5$1.run(PlatformImpl.java:223)
     at java.security.AccessController.doPrivileged(Native Method)
     at com.sun.javafx.application.PlatformImpl$5.run(PlatformImpl.java:223)
     at 
com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
     at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
     at 
com.sun.glass.ui.win.WinApplication.access$300(WinApplication.java:39)
     at com.sun.glass.ui.win.WinApplication$3$1.run(WinApplication.java:101)
     at java.lang.Thread.run(Thread.java:724)

Regards,
--John



More information about the openjfx-dev mailing list