-
Notifications
You must be signed in to change notification settings - Fork 30
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
Java error when using .add_change_listener after jarification #39
Comments
@Hobogrammer do you have a small app that I can use to reproduce this? |
@byteit101 This was the code I was using in my tiny app before the work around. https://github.com/Hobogrammer/Tadoku-Character-Counter/tree/b8ff291cb4d16c0d88586f8f62856d06a3a7b127 |
I don't even see the .addChangeListener in official JavaFX docs. Where is this method coming from? http://docs.oracle.com/javafx/2/api/javafx/beans/property/SimpleStringProperty.html |
oh duh, its a jrubyfx method with the same name as a javafx 1 method which makes it hard to google |
Yeah, the actual javafx 2.0 method is just https://github.com/jruby/jrubyfx/blob/master/lib/jrubyfx/core_ext/observable_value.rb#L28 |
For current users of jrubyfx I think things are still in enough flux where we can just change the API to match current JavaFX, but does JRubyFX even work with older JavaFX? (sorry for the aside in this report :) ) |
I don't think so, its something completely different. I just found it confusing until I realized what was going on that we (@enebo actually) called it add_change_listener to wrap addListener, and javafx 1 had addChangeListener |
Perhaps there was an overload issue? I don't know why I would have added that name without following what I thought was FX naming. Hmmm I bet this was some mongo commit where I explained nothing too... |
anyway, the interesting issue is why does jarification make this fail? its just a simple wrapper |
This is typically the execution environment which causes these issues. If we extend a class we cannot really extend it in the Java sense since we are not actually constructing a Java class at runtime which extends the signatures. This in turn means to access protected methods (or package) we end up using setAccessible to make those methods execute in spite of being called from a non-extending (or non-package) Java object (our Ruby wrapped one). This is just speculation. @Hobogrammer Can you describe the way in which you execute the jar and how you created it? |
Sorry about the delay. simply used |
I think this is actually a bug in JRuby as I was modifying this stuff, and the following happened:
|
During development the usage of the
.add_change_listener
method works correctly, however once you try running the jarified version of the program java throws the following errorThe text was updated successfully, but these errors were encountered: