fn-fx / fn-fx

A Functional API around JavaFX / OpenJFX.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Got Exception when run (-main) of other-example.todo in repl

gzll opened this issue · comments

commented
Exception in thread "JavaFX Application Thread" 
java.lang.ClassCastException: javafx.stage.Stage cannot be cast to javafx.scene.Node
	at fn_fx.fx_tree_search$find_child_by_id.invokeStatic(fx_tree_search.clj:23)
	at fn_fx.fx_tree_search$find_child_by_id.invoke(fx_tree_search.clj:22)
	at fn_fx.fx_tree_search$find_nearest_by_id.invokeStatic(fx_tree_search.clj:37)
	at fn_fx.fx_tree_search$find_nearest_by_id.invoke(fx_tree_search.clj:34)
	at fn_fx.render_core$gather_event_data$fn__18684.invoke(render_core.clj:279)
	at clojure.lang.PersistentArrayMap.kvreduce(PersistentArrayMap.java:373)
	at clojure.core$fn__9354.invokeStatic(core.clj:6721)
	at clojure.core$fn__9354.invoke(core.clj:6706)
	at clojure.core.protocols$fn__9145$G__9140__9154.invoke(protocols.clj:174)
	at clojure.core$reduce_kv.invokeStatic(core.clj:6732)
	at clojure.core$reduce_kv.invoke(core.clj:6723)
	at fn_fx.render_core$gather_event_data.invokeStatic(render_core.clj:275)
	at fn_fx.render_core$gather_event_data.invoke(render_core.clj:269)
	at fn_fx.render_core$get_add_listener$fn$reify__18691.changed(render_core.clj:300)
	

I have the same issue.. However the application still runs without any problems. Just a lot of these error messages cluttering up the REPL/output

The issues is the line that reads

           :listen/height {:event :height-change
                                 :fn-fx/include {::new-item #{:text}}}

Under (defui Stage...
There is no listened for this and I'm not really sure what it does.. so if you remove it there are no problems! :)

@gzll I wasn't able to reproduce this, on either Java 8 / JavaFX or Java 11 / OpenJFX.

Are you able to run the following commands, play with the app a bit, and see if it's still occurring? Thanks!

$ lein repl    ; Java 8, or:
$ lein with-profile +openjfx11 repl   ; Java 11
nREPL server started on port 50111 on host 127.0.0.1 - nrepl://127.0.0.1:50111
REPL-y 0.3.7, nREPL 0.2.12
Clojure 1.9.0
OpenJDK 64-Bit Server VM 11.0.1+13
    Docs: (doc function-name-here)
          (find-doc "part-of-name-here")
  Source: (source function-name-here)
 Javadoc: (javadoc java-object-or-class-here)
    Exit: Control+D or (exit) or (quit)
 Results: Stored in vars *1, *2, *3, an exception in *e

user=> (require '[other-examples.todo])
nil
user=> (other-examples.todo/-main)
#object[clojure.lang.Atom 0x2d4196d6 {:status :ready, :val {:todos [{:done? false, :text "Take out trash"}]}}]
user=> [{:done? false, :text Take out trash} {:done? true, :text something} {:done? true, :text something else} {:done? false, :text more crap}] 2
[{:done? false, :text Take out trash} {:done? true, :text something} {:done? true, :text more crap}] 2
[{:done? false, :text Take out trash} {:done? true, :text something}] 1
[{:done? false, :text Take out trash}] 0

user=> exit
Bye for now!

I could reproduce the problem with jdk8. Fix is in #42.

commented

Great

commented

Great