[Neo] Neo4J.rb: Severe StackOverflowException in JRuby classloading

Ole Christian Rynning oc at rynning.no
Wed Oct 15 17:05:26 CEST 2008


Hi,

I'm trying to setup Neo4J.rb for the first time and I keep getting
StackOverflowException when trying to require it.

I tried both the bundled jar: neo-1.0-rc1-20080530.151028-34.jar and the
newest stable: neo-1.0-b7.jar

I'm using JRuby 1.1.4, fresh install, and have attempted to clone:
git://github.com/andreasronge/neo4j.git

$ java -version
java version "1.5.0_13"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_13-b05-237)
Java HotSpot(TM) Client VM (build 1.5.0_13-119, mixed mode, sharing)

and

$ java -version
java version "1.5.0_16"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_16-b06-284)
Java HotSpot(TM) Client VM (build 1.5.0_16-133, mixed mode, sharing)

$ jruby -v
jruby 1.1.4 (ruby 1.8.6 patchlevel 114) (2008-08-28 rev 7570) [i386-java]


BUG#1 (Trivial)

Rakefile:79: (file name of gem is not versioned)

77  desc "Run :package and install the .gem locally"
78  task :install => [:update_gemspec, :package] do
79    sh %{sudo gem install --local pkg/neo4j.gem --no-rdoc --no-ri}
80  end

Fix: append #{spec.version} to gem & don't use sudo! (user should rather
sudo gem:install IMHO)

BUG#2 (More severe) JRuby 1.1.4 incompatibility?

1) Is this a JRuby bug?
2) What versions of JRuby, etc are you running? => Andreas?

$ jirb -rubygems
irb(main):001:0> require 'neo4j'
LoadError: IO error -- neo4j/relations
    from
/usr/local/jruby-1.1.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:34:in
`require'
    from
/usr/local/jruby-1.1.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`require'
    from (irb):2:in `binding'
    from /usr/local/jruby-1.1.4/lib/ruby/1.8/irb.rb:150:in `eval_input'
    from /usr/local/jruby-1.1.4/lib/ruby/1.8/irb.rb:259:in `signal_status'
    from /usr/local/jruby-1.1.4/lib/ruby/1.8/irb.rb:147:in `eval_input'
    from /usr/local/jruby-1.1.4/lib/ruby/1.8/irb.rb:146:in `eval_input'
    from /usr/local/jruby-1.1.4/lib/ruby/1.8/irb.rb:70:in `start'
    from /usr/local/jruby-1.1.4/lib/ruby/1.8/irb.rb:69:in `catch'
    from /usr/local/jruby-1.1.4/lib/ruby/1.8/irb.rb:69:in `start'
    from /usr/local/jruby-1.1.4/bin/jirb:19
irb(main):002:0>

Excerpt from debug:
Exception `LoadError' at
/usr/local/jruby-1.1.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:34
- no such file to load -- what_methods
java.lang.StackOverflowError
        at
org.jruby.java.proxies.JavaInterfaceTemplate.appendFeaturesToClass(JavaInterfaceTemplate.java:85)
        at
org.jruby.java.proxies.JavaInterfaceTemplate.append_features(JavaInterfaceTemplate.java:73)
        at
org.jruby.java.proxies.JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.call(org/jruby/java/proxies/JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.gen)

... Repeat...

        at org.jruby.RubyClass.invoke(RubyClass.java:333)
        at
org.jruby.javasupport.util.RuntimeHelpers.invokeAs(RuntimeHelpers.java:366)
        at
org.jruby.java.proxies.JavaInterfaceTemplate.append_features(JavaInterfaceTemplate.java:80)
        at
org.jruby.java.proxies.JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.call(org/jruby/java/proxies/JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.gen)
        at
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneBlock.call(JavaMethod.java:580)
 java.lang.StackOverflowError
        at
java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:730)
        at org.jruby.RubyModule.searchMethod(RubyModule.java:898)
        at org.jruby.RubyClass.invoke(RubyClass.java:328)
        at
org.jruby.javasupport.util.RuntimeHelpers.invokeAs(RuntimeHelpers.java:366)
        at
org.jruby.java.proxies.JavaInterfaceTemplate.append_features(JavaInterfaceTemplate.java:80)
        at
org.jruby.java.proxies.JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.call(org/jruby/java/proxies/JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.gen)
        at
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneBlock.call(JavaMethod.java:580)

... Repeat ...

        at org.jruby.RubyClass.invoke(RubyClass.java:333)
        at
org.jruby.javasupport.util.RuntimeHelpers.invokeAs(RuntimeHelpers.java:366)
        at
org.jruby.java.proxies.JavaInterfaceTemplate.append_features(JavaInterfaceTemplate.java:80)
        at
org.jruby.java.proxies.JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.call(org/jruby/java/proxies/JavaInterfaceTemplate$s_method_1_0$RUBYFRAMEDINVOKER$append_features.gen)
        at
org.jruby.internal.runtime.methods.JavaMethod$JavaMethodOneBlock.call(JavaMethod.java:580)
        at org.jruby.RubyClass.invoke(RubyClass.java:333)
        at
org.jruby.javasupport.util.RuntimeHelpers.invokeAs(RuntimeHelpers.java:366)
/usr/local/jruby-1.1.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
`require': IO error -- neo4j/relations (LoadError)
        from
/usr/local/jruby-1.1.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
`require'
        from
/usr/local/jruby-1.1.4/lib/ruby/gems/1.8/gems/neo4j-0.0.2/lib/neo4j.rb:9
        from
/usr/local/jruby-1.1.4/lib/ruby/gems/1.8/gems/neo4j-0.0.2/lib/neo4j.rb:32:in
`require'
        from
/usr/local/jruby-1.1.4/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in
`require'
        from /usr/local/jruby-1.1.4/lib/ruby/1.8/irb/init.rb:256:in
`load_modules'
        from /usr/local/jruby-1.1.4/lib/ruby/1.8/irb/init.rb:254:in `each'
        from /usr/local/jruby-1.1.4/lib/ruby/1.8/irb/init.rb:254:in
`load_modules'
        from /usr/local/jruby-1.1.4/lib/ruby/1.8/irb/init.rb:21:in `setup'
        from /usr/local/jruby-1.1.4/lib/ruby/1.8/irb.rb:54:in `start'
        from /usr/local/jruby-1.1.4/bin/jirb:19

Fix: No idea.

oc


More information about the User mailing list