-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
jrubyc failing - TypeError: failed to coerce org.objectweb.asm.ClassWriter to org.jruby.org.objectweb.asm.ClassVisitor #2887
Comments
I'm not sure it's apparent what JRuby version you're using ... thanks! |
@torcido no doubt this is some private code which you were trying to compile, Could you run this command again with --verbose:
This should show you which file this is blowing up on and then we can try and see what is different about it to cause this problem. |
This is using jruby 9.0.0.0.pre2 Compiling all in '/Volumes/src/gems/configuration_properties/gem_source/lib/configuration_properties'... And the spectacular content of that file:
class ConfigurationProperties |
This is some problem with shading of the ASM artifacts or the compiler's logic to guess the right shaded name(s). I'll have a look after 1.7.20, but @mkristian might help by confirming when and whether we are renaming ASM packages in our builds. |
on 9k.pre2 only jruby-core artifact has the regular ASM packages all other distribution artifacts (tar.gz and zip distributions, jruby-jars.gem, jruby-complete.jar) or local build uses renamce ASM packages. next 9k.rc will have throughout renamed ASM packages. 1.7.20 is basically the same as 9k.pre2 but as on more artifact "org.jruby:jruby-noasm" which depends on jruby-core-noasm.jar from the stacktrace I conclude that you either use jruby-stdlib.jar + jruby-core.jar or jruby-complete.jar ? how to execute jruby (do not really get it from the stacktraces) ? |
I am launching jruby via the jruby-complete jar, from a fairly simple script where the invocation looks something like: java -cp jruby-complete.jar org.jruby.Main ./jrubyc.rb "$@" Where jrubyc.rb is copied from the installation: require 'jruby/jrubyc'
status = JRuby::Compiler::compile_argv(ARGV)
if (status != 0)
puts "Compilation FAILED: #{status} error(s) encountered"
exit status
end |
thanx. I can reproduce it and something is not right with jruby-complete-9.0.0.0.pre2.jar :( |
Summarizing the error: The Ruby compiler.rb script is attempting to construct a new SkinnyMethodAdapter passing the previously-constructed ClassWriter in. However, the ClassWriter created from Ruby code is an org.objectweb.asm.ClassWriter and the one SkinnyMethodAdapter was loaded with is the mangled name org.jruby.org.objectweb.asm.ClassWriter. I suspect that the normal, unmangled ASM classes are getting into the jar you're using (complete, I think) causing this script to use them instead of the mangled names, and that mismatches with mangled JRuby ASM in the same jar. |
yes, the jruby-complete jar has the shaded and unshaded classes - which most probably causes the error. |
Running jrubyc on a directory is failing with the following error:
TypeError: failed to coerce org.objectweb.asm.ClassWriter to org.jruby.org.objectweb.asm.ClassVisitor
block in compile_files_with_options at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jruby/compiler.rb:179
call at org/jruby/RubyProc.java:303
block in compile_files_with_options at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jruby/compiler.rb:243
each at org/jruby/RubyArray.java:1571
block in compile_files_with_options at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jruby/compiler.rb:242
each at org/jruby/RubyArray.java:1571
compile_files_with_options at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jruby/compiler.rb:233
compile_argv at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/jruby/compiler.rb:94
at jrubyc.rb:3
It doesn't seem to matter which codebase we run it on, we're consistently getting this error. It's failing in both java 7 and 8.
The text was updated successfully, but these errors were encountered: