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

slightly more complex fxml doesn't load #48

Closed
amiracam opened this issue May 8, 2013 · 13 comments
Closed

slightly more complex fxml doesn't load #48

amiracam opened this issue May 8, 2013 · 13 comments

Comments

@amiracam
Copy link

amiracam commented May 8, 2013

I created an fxml file that used split panes , basically a left nav pane holding a liar and on the right a top and bottom panes both holding tables. A header section containing labels and a basic user login pane.

I would attach the fxml in question but I don't see how to do that here, other than to copy it to the bottom of this issue.

Here's the error stack:

monteiro:lib charles$ jruby -S schema_browser_application.rb
[converter for Java::JavafxSceneLayout::ColumnConstraints, new]
[converter for Java::JavafxSceneLayout::RowConstraints, new]
[converter for Java::JavafxSceneInput::DragEvent, accept_transfer_modes]
[converter for Java::JavafxSceneEffect::DropShadow, color]
[converter for #Class:Java::JavafxSceneEffect::DropShadow, new]
[converter for Java::JavafxSceneImage::ImageView, viewport]
[converter for Java::JavafxSceneMedia::MediaPlayer, cycle_count]
[converter for Java::JavafxSceneControl::Pagination, page_count]
[converter for Java::JavafxSceneControl::Pagination, new]
[converter for Java::JavafxSceneControl::ProgressIndicator, progress]
[converter for Java::JavafxSceneControl::ProgressIndicator, new]
[converter for Java::JavafxSceneControl::ProgressBar, progress]
[converter for Java::JavafxSceneControl::ProgressBar, new]
[converter for #Class:Java::JavafxScenePaint::RadialGradient, new]
[converter for #Class:Java::JavafxScenePaint::LinearGradient, new]
[converter for Java::JavafxSceneLayout::Region, min_width]
[converter for Java::JavafxSceneLayout::Region, min_height]
[converter for Java::JavafxSceneLayout::Region, pref_width]
[converter for Java::JavafxSceneLayout::Region, pref_height]
[converter for Java::JavafxSceneLayout::Region, max_width]
[converter for Java::JavafxSceneLayout::Region, max_height]
[converter for Java::JavafxSceneLayout::Region, padding]
[converter for Java::JavafxSceneTransform::Rotate, axis]
[converter for #Class:Java::JavafxSceneTransform::Rotate, new]
[converter for Java::JavafxSceneControl::TableView, column_resize_policy]
[converter for Java::JavafxAnimation::Timeline, cycle_count]
/Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-fxmlloader-0.0.1/lib/fxmlloader/real_elts.rb:62 warning: singleton on non-persistent Java type Java::JavafxFxml::ObjectBuilder (http://wiki.jruby.org/Persistence)
Exception running Application:

<RuntimeError: oh no!>

/Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-fxmlloader-0.0.1/lib/fxmlloader/rrba.rb:400:in coerce' /Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-fxmlloader-0.0.1/lib/fxmlloader/rrba.rb:344:incoerce'
/Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-fxmlloader-0.0.1/lib/fxmlloader/rrba.rb:235:in []=' /Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-fxmlloader-0.0.1/lib/fxmlloader/elts.rb:424:inapplyProperty'
/Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-fxmlloader-0.0.1/lib/fxmlloader/elts.rb:284:in processValue3' /Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-fxmlloader-0.0.1/lib/fxmlloader/elts.rb:243:inprocessPropertyAttribute'
/Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-fxmlloader-0.0.1/lib/fxmlloader/elts.rb:152:in processInstancePropertyAttributes' org/jruby/RubyArray.java:1613:ineach'
/Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-fxmlloader-0.0.1/lib/fxmlloader/elts.rb:151:in processInstancePropertyAttributes' /Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-fxmlloader-0.0.1/lib/fxmlloader/value_elts.rb:86:inprocessEndElement'
/Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-fxmlloader-0.0.1/lib/jrubyfx-fxmlloader.rb:409:in processEndElement' /Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-fxmlloader-0.0.1/lib/jrubyfx-fxmlloader.rb:205:inload'
/Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-0.9.2-java/lib/jrubyfx/fxml_controller.rb:89:in load_into' schema_browser_application.rb:13:instart'
/Users/charles/.rvm/gems/ruby-1.9.3-p0/gems/jrubyfx-0.9.2-java/lib/jrubyfx/java_fx_impl.rb:121:in launch_app_after_platform' org/jruby/gen/InterfaceImpl1875744039.gen:13:inrun'
monteiro:lib charles$


here's the fxml in question:

@edubkendo
Copy link
Member

@amiracam It looks like your code got cut off or otherwise didnt process correctly. A couple hints, for future issues. First, you can use Github Flavored Markdown in issues and comments, which will provide syntax highlighting for code as well as visually set it off from the rest of the text. I don't think its specifically aware of fxml yet, but you can certainly label it as xml. Second, for larger error output and larger blocks of code such as an entire file, it's often a good idea to create a Github Gist and just link to that from the issue or comment (I just started doing this more often very recently myself, after first filing an issue with a very, very large error message). For files, some text editors have plugins which will submit the gist for you automatically, like this one for Sublime Text: https://github.com/bgreenlee/sublime-github

@amiracam
Copy link
Author

amiracam commented May 8, 2013

ah yes, I see that the fxml got cut off, I will look into the Github Gist and follow up on this thread with that info, thanks for the feedback

@byteit101
Copy link
Member

Fixed in byteit101/JRubyFX-FXMLLoader@5203817

@amiracam
Copy link
Author

amiracam commented May 8, 2013

well I found out how to turn debugging on :)

Here;s the culprit:

coercing...
!! Non-normal RUBY coerce (0.22937625754527163, [D) ("0.22937625754527163", [String, class [D])
Exception running Application:
#<RuntimeError: oh no!>

apparently the stack is too long so I will have to GIST but Im guessing the line above is telling ?

@byteit101
Copy link
Member

yes, I should have fixed that in fxml master with byteit101/JRubyFX-FXMLLoader@4f298a9

git clone that repo and then rake gem and then gem install pkg/something.gem

@amiracam
Copy link
Author

amiracam commented May 8, 2013

right and thanks, figured out as much , with IDEA I actually have to setup the gem server and specify in the bundler gemfile one of the sources as localhost:8808, after creating the new gem of course , I also changed the versions just to make sure I didn't get into any conflicts , anyhow don't mean to digress on IDEA quirks. The app starts fine, I now need to hook some callbacks and see if those work out.

@byteit101
Copy link
Member

@amiracam mind If we toss your fxml example in the samples?

@amiracam
Copy link
Author

amiracam commented May 9, 2013

No. not at all but let's finish it :) , the basic app is just a schema browser which I will use as testing UI for a larger project where we are porting away from Oracle Stored Procs to a generic rdms Jruby/Sinatra/Ruby Sequel service. We do "customized" table dumps so this will help with that testing i.e. with certain enhancements. Point being the generic schema browser-ish app I will gladly share and you can of course have the fxml that I have now but it yet does not do much yet. I have to hook up to connecting to Sinatra , downloading the tables for the targetted database, displaying schema in the top table based on the table list selection and retrieving / displaying partial set of records in the bottom table based on a button click event.

So do you want the fxml and the the app/ controller rb files now ? or do you want to wait until this is fleshed out better ?

@byteit101
Copy link
Member

Well I just want it to test FXML parsing :-)

@amiracam
Copy link
Author

amiracam commented May 9, 2013

well sure then, just that it took me 5 minutes to create with Scene builder :), so not that I'm saving you all a ton of time, how do I provide it to you ?

@byteit101
Copy link
Member

I have the FXML file as you pasted it in jruby-users which is what I used to debug and test. I was just asking if its ok if I toss it in the git repo so I don't break it again accidentally 😄

@amiracam
Copy link
Author

amiracam commented May 9, 2013

ah right, that did go in fine at the user's group but went only partially
at github, yes of course. Do you mind sharing what exactly broke ? I do
want to get educated i.e. jrubyfx might be a strategic direction for us vs
Apache Flex

On Wed, May 8, 2013 at 10:06 PM, Patrick Plenefisch <
notifications@github.com> wrote:

I have the FXML file as you pasted it in jruby-users which is what I used
to debug and test. I was just asking if its ok if I toss it in the git repo
so I don't break it again accidentally [image: 😄]


Reply to this email directly or view it on GitHubhttps://github.com//issues/48#issuecomment-17645541
.

Charles A. Monteiro
www.monteirosfusion.com
sent from the road

@byteit101
Copy link
Member

Its not secret, I already pasted the urls to the diffs, but I guess I'll explain it also:

  1. First error (aka the one you reported) was because I didn't have a string => double[] converter since dividerPositions is a double[] and FXML is a large string, so I just added a string=> double[] converter and better error message than "oh no!"
  2. Second error was about fxml references (aka <Font fx:id="x1" ... /> ... font="$x1") and I had used @namespace instead of parentLoader.namespace by accident and the Expression class was expecting a different java class so I just did it myself along with some debug spew
  3. Third error was a goof on my part for forgetting empty possibilities so I ixed my fix for #2 and got rid of a nearby warning

If you want more info, we are on #jruby on freenode on IRC

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

3 participants