JDK-7111583 : JSR 292: JRuby test_respond_to.rb fails with: NoClassDefFoundError: org/jruby/runtime/ThreadContext
  • Type: Bug
  • Component: hotspot
  • Sub-Component: compiler
  • Affected Version: hs23
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2011-11-14
  • Updated: 2012-10-05
  • Resolved: 2012-10-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8
8-poolFixed
Related Reports
Relates :  
Relates :  
Relates :  
Description
Running JRuby's test suite via ant may result in a NoClassDefFoundError:

$ ant -v run-junit-precompiled
...
    [junit] junit.framework.TestListener: startTest(test_respond_to)
    [junit] Exception in thread "RubyThread-777: test/test_respond_to_generated_test.rb:4" java.lang.NoClassDefFoundError: org/jruby/runtime/ThreadContext
$ java -server -Xcomp -cp lib/jruby.jar -Djruby.home=$PWD org.jruby.Main test/test_respond_to.rb
LoadError: load error: builtin/java/java.net -- java.lang.NoClassDefFoundError: org/jruby/runtime/ThreadContext
       require at org/jruby/RubyKernel.java:961
        (root) at /export/twisti/jruby/lib/ruby/site_ruby/shared/builtin/javasupport.rb:44
  process_args at /export/twisti/jruby/lib/ruby/site_ruby/shared/builtin/javasupport.rb:90
           run at /export/twisti/jruby/lib/ruby/1.8/test/unit/autorunner.rb:11
        (root) at /export/twisti/jruby/lib/ruby/1.8/test/unit.rb:279
          call at org/jruby/RubyProc.java:269
          call at org/jruby/RubyProc.java:223

$ java -server -Xcomp -Xbootclasspath/a:lib/jruby.jar -Djruby.home=$PWD org.jruby.Main test/test_respond_to.rb
Loaded suite test/test_respond_to
Started
...
Finished in 6.367 seconds.

3 tests, 4 assertions, 0 failures, 0 errors

Comments
This is fixed by the new JSR 292 implementation.
05-10-2012

EVALUATION t@2 (l@2) stopped in SystemDictionary::handle_resolution_exception at line 174 in file "systemDictionary.cpp" 174 THROW_MSG_0(vmSymbols::java_lang_NoClassDefFoundError(), class_name->as_C_string()); (dbx) where current thread: t@2 =>[1] SystemDictionary::handle_resolution_exception(class_name = 0x87acb78, class_loader = CLASS, protection_domain = CLASS, throw_error = true, klass_h = CLASS, __the_thread__ = 0x807b800), line 174 in "systemDictionary.cpp" [2] SystemDictionary::resolve_or_fail(class_name = 0x87acb78, class_loader = CLASS, protection_domain = CLASS, throw_error = true, __the_thread__ = 0x807b800), line 149 in "systemDictionary.cpp" [3] SignatureStream::as_klass(this = 0xfd71e0c8, class_loader = CLASS, protection_domain = CLASS, failure_mode = NCDFError, __the_thread__ = 0x807b800), line 347 in "signature.cpp" [4] SignatureStream::as_java_mirror(this = 0xfd71e0c8, class_loader = CLASS, protection_domain = CLASS, failure_mode = NCDFError, __the_thread__ = 0x807b800), line 355 in "signature.cpp" [5] SystemDictionary::find_method_handle_type(signature = 0x9b28498, accessing_klass = CLASS, for_invokeGeneric = false, return_bcp_flag = false, __the_thread__ = 0x807b800), line 2421 in "systemDictionary.cpp" [6] SystemDictionary::find_method_handle_invoke(name = 0x80d37e0, signature = 0x9b28498, accessing_klass = CLASS, __the_thread__ = 0x807b800), line 2352 in "systemDictionary.cpp" [7] LinkResolver::lookup_implicit_method(result = CLASS, klass = CLASS, name = 0x80d37e0, signature = 0x9b28498, current_klass = CLASS, __the_thread__ = 0x807b800), line 234 in "linkResolver.cpp" [8] LinkResolver::resolve_method(resolved_method = CLASS, resolved_klass = CLASS, method_name = 0x80d37e0, method_signature = 0x9b28498, current_klass = CLASS, check_access = false, __the_thread__ = 0x807b800), line 358 in "linkResolver.cpp" [9] LinkResolver::linktime_resolve_virtual_method(resolved_method = CLASS, resolved_klass = CLASS, method_name = 0x80d37e0, method_signature = 0x9b28498, current_klass = CLASS, check_access = false, __the_thread__ = 0x807b800), line 772 in "linkResolver.cpp" [10] LinkResolver::resolve_virtual_call(result = CLASS, recv = CLASS, receiver_klass = CLASS, resolved_klass = CLASS, method_name = 0x80d37e0, method_signature = 0x9b28498, current_klass = CLASS, check_access = false, check_null_and_abstract = false, __the_thread__ = 0x807b800), line 763 in "linkResolver.cpp" [11] MethodHandles::resolve_MemberName(mname = CLASS, __the_thread__ = 0x807b800), line 671 in "methodHandles.cpp" [12] MHN_resolve_Mem(env = 0x807b93c, igcls = 0xfd71e7b8, mname_jh = 0xfd71e7b0, caller_jh = (nil)), line 3039 in "methodHandles.cpp" [13] 0xfa7bbac8(0x0, 0x0, 0x0, 0x0, 0x0, 0xe61f8450), at 0xfa7bbac8 (dbx)
14-11-2011

WORK AROUND Put jruby.jar on the boot class path.
14-11-2011