Comments (5)
ok, some back and for with byteit101, uncovered that there is a conflict with jrubyfx's redefinition of java.util.Set which conflicts with Set.rb, the fix was to remove 'java.util.Set' from the from the java import call i.e. jrubyfx-fxmlloader.rb line 63
from jrubyfx.
Got the same problem when using jrubyfx in combination with activerecord. Fix described by amiracam worked for me, too. Thanks man.
from jrubyfx.
NP, the more we whack at jrubyfx the better. Finally, a reasonable enterprise real app gui framework for Ruby.
Anyhow, you may encounter a similar issue with to_array being sent when using to retrieve the underlying collection from a one to many dm association. The jrubyfx interface implementation sends :to_array which fails. It seems this is dynamically generated so I don't know where to look.
the stack can be found here:
https://gist.github.com/amiracam/6055902
my gut feeling is that its a similar issue i.e. to the Set issue.
However, I needed to carry on and so I was ok with being explicit and I used :to_a which is made available via lazy_array.rb which is part of dm-core / support.
e.g.
instead of my my_object.my_relationship.all
I do
my_object.my_relationship.all.to_a
where my_relationship is a Datamapper one to many i.e.
has n, :name_of_associated_model
e.g.
has n, Friends
not ideal I suppose but I didn't want to take the time to understand what the implications would be to a similar strategy to the Set issue i.e. which was to simply not import the java set class i.e. thus not to import the java array class.
I would be curious to know if you experience the same issue with active-record. Basically , I was trying to populate a javafx list widget with a collection of objects retrieved via a dm one to many e.g.
@list.items.add_all (my_object.my_relationship.all.to_a)
from jrubyfx.
I'll get the same behavior with the latest jrubyfx on rspec:
rspec spec/compiler_data_spec.rb :(
file:/home/max/Programmierung/gsoc/jruby/lib/jruby.jar!/jruby/java/core_ext/object.rb:73 warning: already initialized constant Set
ArgumentError: wrong number of arguments calling `initialize` (1 for 0)
new at org/jruby/java/proxies/JavaInterfaceTemplate.java:387
to_set at /home/max/Programmierung/gsoc/jruby/lib/ruby/1.9/set.rb:626
Matcher at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers/matcher.rb:27
DSL at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers/matcher.rb:8
Matchers at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers/matcher.rb:5
RSpec at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers/matcher.rb:4
(root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers/matcher.rb:3
require at org/jruby/RubyKernel.java:1082
require at /home/max/Programmierung/gsoc/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:58
(root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers.rb:1
require at org/jruby/RubyKernel.java:1082
require at /home/max/Programmierung/gsoc/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:58
(root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/matchers.rb:5
require at org/jruby/RubyKernel.java:1082
require at /home/max/Programmierung/gsoc/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:110
require at /home/max/Programmierung/gsoc/jruby/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:106
(root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/expectations.rb:1
map at org/jruby/RubyArray.java:2414
(root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-expectations-2.14.1/lib/rspec/expectations.rb:2
(root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:1
expect_with at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:447
expect_with at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:442
expectation_frameworks at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:410
configure_expectation_framework at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:889
ensure_example_groups_are_configured at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/example_group.rb:280
set_it_up at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/example_group.rb:294
subclass at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/example_group.rb:244
load at org/jruby/RubyKernel.java:1101
describe at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/example_group.rb:230
each at org/jruby/RubyArray.java:1614
describe at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/dsl.rb:18
(root) at /home/max/Programmierung/gsoc/jruby-visualizer/spec/compiler_data_spec.rb:3
(root) at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:1
load_spec_files at /home/max/Programmierung/gsoc/jruby/lib/ruby/gems/shared/gems/rspec-core-2.14.4/lib/rspec/core/configuration.rb:896
rspec spec/compiler_data_spec.rb 14,82s user 0,18s system 237% cpu 6,321 total
And with proposed exlude of Set from @amiracam, I get this:
% rspec spec/compiler_data_spec.rb
#<CompilerData:0x605be4bb>
F
Failures:
1) CompilerData should update AST and IR Scope after updating ruby code
Failure/Error: updated_ast_root.should be_true
expected: true value
got: false
# ./spec/compiler_data_spec.rb:22:in `(root)'
Finished in 0.084 seconds
1 example, 1 failure
Failed examples:
rspec ./spec/compiler_data_spec.rb:9 # CompilerData should update AST and IR Scope after updating ruby code
rspec spec/compiler_data_spec.rb 14,89s user 0,26s system 233% cpu 6,477 total
Hey @byteit101, can you please integrate this fix into your repo? Thanks.
from jrubyfx.
fixed on fxmlloader master
from jrubyfx.
Related Issues (20)
- jrubyfx sensitive to number of spaces in fxml HOT 2
- Enhancement: Provide Ruby binding impls HOT 1
- Setting TableView items doesn't seem to work HOT 4
- Jar classpath issue on windows HOT 1
- jarify with fxml: no .jrubyfx_cache in the jarfile HOT 1
- jarify with fxml: cannot access the fxml files
- jarify with fxml: require_relative doesn't work from inside a jarfile
- jrubfx-jarify compiled jar does not laucnch HOT 5
- cannot run the hello world app HOT 2
- gem install jrubyfx gem not found HOT 1
- Permission denied for 'jrubyfx_cache' HOT 2
- Need more documentation for controller functions HOT 1
- jrubyfx não encaminhando HOT 2
- Is this project active ? HOT 3
- Path to jfxrt.jar loading issue with 1.8.0_202-ea-b03 HOT 1
- Would it be possible to add a screenshot-example to the main README here? HOT 1
- Use javafx 17 modules HOT 3
- Warning: SCENE3D? HOT 1
- More examples perhaps? TextArea specifically
- Classic OOP style? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jrubyfx.