Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Part of custom control rendered twice on 2nd run #100

Open
pilhuhn opened this issue May 7, 2016 · 1 comment
Open

Part of custom control rendered twice on 2nd run #100

pilhuhn opened this issue May 7, 2016 · 1 comment

Comments

@pilhuhn
Copy link
Contributor

pilhuhn commented May 7, 2016

I have a custom control for charts in https://github.com/pilhuhn/hawkfx which displays and works nicely on the first invocation.
When I stop and restart the program, a part of the custom control is rendered twice.
If I clear assets/.jrubyfx_cache/ the rendering is again correct. See below for screenshots

I have created a smaller sample app

fx-bug.zip

and the output of two runs of the sample app on the command line looks like:

snert:fx-bug hrupp$ jruby simple_test.rb
/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-fxmlloader-0.4.1-java/lib/fxmlloader/elts.rb:158: warning: `<<' after local variable or literal is interpreted as binary operator
/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-fxmlloader-0.4.1-java/lib/fxmlloader/elts.rb:158: warning: even though it seems like here document
saved /Users/hrupp/src/fx-bug/assets/.jrubyfx_cache/8a27485946241550e0f6e0750e4975ba4f113a65.rb to cache
saved /Users/hrupp/src/fx-bug/assets/.jrubyfx_cache/5b514f096053457c3854b2af3a1b05170f4e3533.rb to cache
snert:fx-bug hrupp$ jruby simple_test.rb
/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-fxmlloader-0.4.1-java/lib/fxmlloader/elts.rb:158: warning: `<<' after local variable or literal is interpreted as binary operator
/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-fxmlloader-0.4.1-java/lib/fxmlloader/elts.rb:158: warning: even though it seems like here document
JIT compiled method for file:/Users/hrupp/src/fx-bug/assets/ChartView.fxml FAILED with error:
Cannot create instance of javafx.scene.chart.LineChart with given set of properties: [prefHeight, visible]
com.sun.javafx.fxml.builder.ProxyBuilder.build(com/sun/javafx/fxml/builder/ProxyBuilder.java:247)
java.lang.reflect.Method.invoke(java/lang/reflect/Method.java:498)
org.jruby.javasupport.JavaMethod.invokeDirectWithExceptionHandling(org/jruby/javasupport/JavaMethod.java:438)
org.jruby.javasupport.JavaMethod.invokeDirect(org/jruby/javasupport/JavaMethod.java:302)
RUBY.new(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-fxmlloader-0.4.1-java/lib/jrubyfx-fxmlloader.rb:228)
RUBY.build(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/module.rb:92)
RUBY.block in __build_via_jit(/Users/hrupp/src/fx-bug/assets/.jrubyfx_cache/5b514f096053457c3854b2af3a1b05170f4e3533.rb:44)
org.jruby.RubyBasicObject.yieldUnder(org/jruby/RubyBasicObject.java:1744)
org.jruby.RubyBasicObject.specificEval(org/jruby/RubyBasicObject.java:1767)
org.jruby.RubyBasicObject.instance_eval(org/jruby/RubyBasicObject.java:1647)
RUBY.with(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/module.rb:49)
RUBY.__build_via_jit(/Users/hrupp/src/fx-bug/assets/.jrubyfx_cache/5b514f096053457c3854b2af3a1b05170f4e3533.rb:19)
RUBY.__build_via_jit(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-fxmlloader-0.4.1-java/lib/fxmlloader/fxml_jit_info.rb:89)
RUBY.load(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-fxmlloader-0.4.1-java/lib/jrubyfx-fxmlloader.rb:314)
RUBY.load_fxml(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/controller.rb:260)
RUBY.initialize_controller(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/controller.rb:242)
RUBY.new(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/controller.rb:154)
RUBY.build(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/module.rb:92)
RUBY.method_missing(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/dsl.rb:108)
RUBY.initialize(/Users/hrupp/src/fx-bug/lib/simple_controller.rb:13)
org.jruby.RubyClass.finvoke(org/jruby/RubyClass.java:543)
org.jruby.RubyBasicObject.send19(org/jruby/RubyBasicObject.java:1640)
org.jruby.RubyKernel.send19(org/jruby/RubyKernel.java:1998)
RUBY.finish_initialization(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/controller.rb:271)
RUBY.load_into(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/controller.rb:136)
RUBY.fxml(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/core_ext/stage.rb:82)
simple_test.block in start(simple_test.rb:11)
org.jruby.RubyBasicObject.yieldUnder(org/jruby/RubyBasicObject.java:1744)
org.jruby.RubyBasicObject.specificEval(org/jruby/RubyBasicObject.java:1767)
org.jruby.RubyBasicObject.instance_eval(org/jruby/RubyBasicObject.java:1647)
RUBY.with(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/module.rb:49)
simple_test.start(simple_test.rb:10)
RUBY.block in launch_app_after_platform(/Users/hrupp/.rvm/gems/jruby-9.1.0.0/gems/jrubyfx-1.1.1-java/lib/jrubyfx/java_fx_impl.rb:119)
org.jruby.RubyProc.call(org/jruby/RubyProc.java:342)
org.jruby.RubyProc.call(org/jruby/RubyProc.java:248)
org.jruby.javasupport.Java$ProcToInterface.callProc(org/jruby/javasupport/Java.java:1029)
org.jruby.javasupport.Java$ProcToInterface.access$200(org/jruby/javasupport/Java.java:1006)
org.jruby.javasupport.Java$ProcToInterface$ConcreteMethod.call(org/jruby/javasupport/Java.java:1067)
com.sun.javafx.application.PlatformImpl.lambda$runAndWait$175(com/sun/javafx/application/PlatformImpl.java:326)
com.sun.javafx.application.PlatformImpl.lambda$null$173(com/sun/javafx/application/PlatformImpl.java:295)
java.security.AccessController.doPrivileged(Native Method)
com.sun.javafx.application.PlatformImpl.lambda$runLater$174(com/sun/javafx/application/PlatformImpl.java:294)
com.sun.glass.ui.InvokeLaterDispatcher$Future.run(com/sun/glass/ui/InvokeLaterDispatcher.java:95)
Reverting to normal parsing...

1st-run
2nd-run

@byteit101
Copy link
Member

Know bug. jrubfx-fxmlloader has some caching issues with certain constructs. You can either attempt to debug the current jrubyfx-fxmlloader, which is a pain and very messy, or wait for a clean fix that is dependent upon jruby/jruby#3366 is fixed in jruby

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants