JDK-6471091 : java.lang.NoSuchMethodError: java.lang.ThreadDeath: method (Ljava/lang/String;)V not found
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 6
  • Priority: P4
  • Status: Closed
  • Resolution: Fixed
  • OS: solaris_9
  • CPU: sparc
  • Submitted: 2006-09-15
  • Updated: 2012-10-08
  • Resolved: 2006-11-14
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 6 JDK 7 Other
6u4Fixed 7Fixed hs10Fixed
Related Reports
Relates :  
Description
I think one of the fixes to rethrow the original exception when exceptions are thrown during constant pool resolution is causing NoSuchMethodErrors to be thrown.  I was writing a test case for another issue and got this output.

$j160/fastdebug/bin/java -server -Xint sm
Exception in thread "main" java.lang.NoSuchMethodError: java.lang.ThreadDeath: method <init>(Ljava/lang/String;)V not found
        at sm.main(sm.java:29)

TraceExceptions output indicates that the NoSuchMethodError is being thrown in this code on the THROW_MSG_0 line:

  // The original attempt to resolve this constant pool entry failed so find the
  // original error and throw it again (JVMS 5.4.3).
  if (in_error) {
    symbolOop error = SystemDictionary::find_resolution_error(this_oop, which);
    guarantee(error != (symbolOop)NULL, "tag mismatch with resolution error table");
    ResourceMark rm;
    // exception text will be the class name
    const char* className = this_oop->unresolved_klass_at(which)->as_C_string();
    THROW_MSG_0(error, className);
  }

ThreadDeath has no constructor taking a String argument so of course this code isn't going to work.  I don't know what's changed to cause this to show up in mustang but 1.5.0 doesn't have this problem.

Comments
EVALUATION Only LinkageErrrors that occur during initial resolution should be rethrown at subsequent resolution attempts.
27-09-2006