groovyfx-project / groovyfx

A library for writing JavaFX 8 applications in the Groovy language.
http://groovyfx.org
Apache License 2.0
199 stars 50 forks source link

ClassCastException running some demos - ArrayList to ObservableList #49

Open markjfisher opened 8 years ago

markjfisher commented 8 years ago

JDK: 1.8.0_92 Gradle: 2.14 OS: Linux groovyfx/groovy version:

compile 'org.codehaus.groovy:groovy-all:2.4.6'
compile 'org.groovyfx:groovyfx:8.0.0'

When i try to run the CanvasDemo, I get the following:

Exception in thread "main" java.lang.RuntimeException: Exception in Application start method
        at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
        at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$155(LauncherImpl.java:182)
        at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.ClassCastException: java.util.ArrayList cannot be cast to javafx.collections.ObservableList
        at javafx.beans.property.ListProperty.setValue(ListProperty.java:56)
        at javafx.beans.value.WritableValue$setValue.call(Unknown Source)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:48)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:113)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
        at groovyx.javafx.canvas.DrawOperations.setOperations(DrawOperations.groovy)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:498)
        at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:93)
        at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
        at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:2702)
        at groovy.lang.ExpandoMetaClass.setProperty(ExpandoMetaClass.java:1185)
        at groovy.lang.MetaClassImpl.setProperty(MetaClassImpl.java:3746)
        at groovy.lang.MetaClassImpl.setProperties(MetaClassImpl.java:1746)
        at org.codehaus.groovy.runtime.callsite.ConstructorSite$NoParamSite.callConstructor(ConstructorSite.java:125)
        at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(CallSiteArray.java:60)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:235)
        at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:247)
        at groovyx.javafx.factory.CanvasFactory.onNodeCompleted(CanvasFactory.groovy:56)

3 Other demos I've tried so far (only just started on groovyfx) are working, i.e. Accordian, Animation and HelloWorld.

markjfisher commented 8 years ago

Same problem with SpirographDemo. 10/12 demos working so far.

rich-coe commented 6 years ago

pull request #56 added missing import