Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4764778

Interrupted thread can't load classes from classes directory (sol)

XMLWordPrintable

    • b71
    • x86, sparc
    • generic, solaris_7, solaris_8, windows_nt
    • Verified

      It is important to note that this program only fails on
      internal builds that don't have images made. If you have made
      images, then it works. I assume that if one includes classes of
      their own not in a jar, then maybe they can't load their classes
      if the thread is interrupted...

      import java.nio.channels.*;

      public class Blah {
          public static void main(String[] args) throws Exception {
              Thread.currentThread().interrupt();
              SocketChannel.open().close(); // Any class not yet loaded
          }
      }

      /export/mantis> /export/cache1/build/solaris-sparc/bin/java Blah
      Exception in thread "main" java.lang.NoClassDefFoundError: java/nio/channels/SocketChannel
              at Blah.main(Blah.java:6)

      This bug has been present for several years.

            psoper Pete Soper (Inactive)
            mmcclosksunw Michael Mccloskey (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: