user2025166
user2025166

Reputation: 21

update to jruby-1.7.4 with loading problems

I have a jruby project with several self written gems (Java code with jars and Ruby code compiled to *.class) working perfect with jruby-1.7.0 (language level 1.9) running on several java jvm's like jdk1.7.0_07 or java-7-oracle.

After upgrade to jruby-1.7.4 I get several errors.

  1. blame_file! -Method missing in dependencies.rb of activesupport, which I fixed with hint from GitHub
  2. Loading problems: LoadError: load error: dibta-gui -- java.lang.ArrayIndexOutOfBoundsException: 3 require at org/jruby/RubyKernel.java:1054 require at /home/frank/.rvm/rubies/jruby-1.7.4/lib/ruby/shared/rubygems/custom_require.rb:60 (root) at -e:1
  3. When I run jruby with -d, I get a long list with stacktrace where I post only some lines:
    1. java.lang.ClassNotFoundException: rubygems.defaults.OperatingSystemService at java.net.URLClassLoader$1.run(URLClassLoader. java:366)......
    2. java.lang.ClassNotFoundException: Dibta-guiService at java.net.URLClassLoader$1.run(URLClassLoader.java:366)....
    3. java.lang.NoSuchMethodError: org.jruby.javasupport.util.RuntimeHelpers.preLoad(Lorg/jruby/runtime/ThreadContext;Ljava/lang/String;Z)V at dibta_gui.load(dibta_gui.rb)....
    4. java.lang.ArrayIndexOutOfBoundsException: 3 at org.jruby.runtime.scope.ManyVarsDynamicScope.setValueDepthZero(ManyVarsDynamicScope.java:147)....

I am using rvm to switch between rubies. Please Help!

Frank

Upvotes: 0

Views: 701

Answers (1)

user2025166
user2025166

Reputation: 21

After trying to load gems individually via jirb, I soon found out, that only my gems did not load, and always with the ArrayIndexOutOfBoundsException. My gems included java *.class files compiled with rubyc. This was the reason. I rebuild them with *.rb files and everything works.

Does anyone know why *.class files inside a gem are not loaded using jruby-1.7.4?

also check this answer

require self made gem in jruby fails after update to jruby-1.7.13

Upvotes: 0

Related Questions