United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6471091 java.lang.NoSuchMethodError: java.lang.ThreadDeath: method <init>(Ljava/lang/String;)V not found
JDK-6471091 : java.lang.NoSuchMethodError: java.lang.ThreadDeath: method (Ljava/lang/String;)V not found

Details
Type:
Bug
Submit Date:
2006-09-15
Status:
Closed
Updated Date:
2012-10-08
Project Name:
JDK
Resolved Date:
2006-11-14
Component:
hotspot
OS:
solaris_9
Sub-Component:
runtime
CPU:
sparc
Priority:
P4
Resolution:
Fixed
Affected Versions:
6
Fixed Versions:
hs10 (b03)

Related Reports
Backport:
Backport:
Relates:

Sub Tasks

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.
                                     
2006-09-27



Hardware and Software, Engineered to Work Together