Skip to content
This repository

undefined method `exception' for java.lang.reflect.UndeclaredThrowableException on JRuby with MiniTest #74

Open
trejkaz opened this Issue September 24, 2012 · 2 comments

2 participants

Trejkaz (pen name) Troy Nichols
Trejkaz (pen name)

A failing test under JRuby with MiniTest currently causes ci_reporter itself to bomb out rather than reporting the exception which occurred in the test:

 [java] Caused by: org.jruby.exceptions.RaiseException: (NoMethodError) undefined method `exception' for java.lang.reflect.UndeclaredThrowableException:Java::JavaLangReflect::UndeclaredThrowableException
 [java]     at RUBY.name(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/minitest.rb:52)
 [java]     at RUBY.to_xml(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/test_suite.rb:146)
 [java]     at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1612)
 [java]     at RUBY.to_xml(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/test_suite.rb:140)
 [java]     at org.jruby.RubyProc.call(org/jruby/RubyProc.java:259)
 [java]     at RUBY._nested_structures(jar:file:ruby-testing-gems.jar!/gems/builder-3.0.0/lib/builder/xmlbase.rb:155)
 [java]     at RUBY.method_missing(jar:file:ruby-testing-gems.jar!/gems/builder-3.0.0/lib/builder/xmlbase.rb:63)
 [java]     at RUBY.to_xml(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/test_suite.rb:136)
 [java]     at RUBY.to_xml(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/test_suite.rb:86)
 [java]     at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1612)
 [java]     at RUBY.to_xml(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/test_suite.rb:85)
 [java]     at org.jruby.RubyProc.call(org/jruby/RubyProc.java:259)
 [java]     at RUBY._nested_structures(jar:file:ruby-testing-gems.jar!/gems/builder-3.0.0/lib/builder/xmlbase.rb:155)
 [java]     at RUBY.method_missing(jar:file:ruby-testing-gems.jar!/gems/builder-3.0.0/lib/builder/xmlbase.rb:63)
 [java]     at RUBY.to_xml(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/test_suite.rb:84)
 [java]     at RUBY.write_report(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/report_manager.rb:18)
 [java]     at org.jruby.RubyIO.open(org/jruby/RubyIO.java:1180)
 [java]     at RUBY.write_report(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/report_manager.rb:17)
 [java]     at RUBY.finish_suite(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/minitest.rb:195)
 [java]     at RUBY._run_suite(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/minitest.rb:96)
 [java]     at RUBY._run_suites(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/minitest.rb:83)
 [java]     at org.jruby.RubyArray.map(org/jruby/RubyArray.java:2355)
 [java]     at RUBY._run_suites(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/minitest.rb:83)
 [java]     at RUBY._run_anything(jar:file:ruby-testing-gems.jar!/gems/ci_reporter-1.7.0/lib/ci/reporter/minitest.rb:75)
 [java]     at RUBY.run_tests(jar:file:/ruby-complete.jar!/META-INF/jruby.home/lib/ruby/1.9/minitest/unit.rb:909)
 [java]     at org.jruby.RubyBasicObject.__send__(org/jruby/RubyBasicObject.java:1667)
 [java]     at org.jruby.RubyKernel.send(org/jruby/RubyKernel.java:2060)
 [java]     at RUBY._run(jar:file:/ruby-complete.jar!/META-INF/jruby.home/lib/ruby/1.9/minitest/unit.rb:896)

Seems like it's expecting a Failure but actually getting the exception object itself, but then attempting to call exception on it to get the exception.

This is on version 1.7.0 but nothing in the change history since then sounds like it is MiniTest-related.

Trejkaz (pen name)

Still happens on ci_reporter-1.7.2, minitest-4.0.0, builder-3.1.3. Going to try updating JRuby itself next to see if that gets me anywhere.

Troy Nichols

Hi. I have this problem too. Anyone discover a workaround?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.