Index (Frames) | Index (No Frames) | Package | Package Tree | Tree
java.lang

Class ClassNotFoundException

java.lang.Object
|
+--java.lang.Throwable
   |
   +--java.lang.Exception
      |
      +--java.lang.ClassNotFoundException


public class ClassNotFoundException

extends Exception

Thrown when a class is requested by reflection, but the class definition cannot be found. This exception is often chained from another Throwable.

Authors:See Also:

Constructor Summary

ClassNotFoundException()

Create an exception without a message.
ClassNotFoundException(java.lang.String s)

Create an exception with a message.
ClassNotFoundException(java.lang.String s, java.lang.Throwable ex)

Create an exception with a message and chain it to the exception which occurred while loading the class.

Method Summary

java.lang.ThrowablegetCause()

Returns the exception which occurred while loading the class, otherwise returns null.
java.lang.ThrowablegetException()

Returns the exception which occurred while loading the class, otherwise returns null.

Constructor Details

ClassNotFoundException

public ClassNotFoundException()

Create an exception without a message. Note that this initializes the cause to null.


ClassNotFoundException

public ClassNotFoundException(java.lang.String s)

Create an exception with a message. Note that this initializes the cause to null.

Parameters:


ClassNotFoundException

public ClassNotFoundException(java.lang.String s, java.lang.Throwable ex)

Create an exception with a message and chain it to the exception which occurred while loading the class.

Since:Parameters:


Method Details

getCause

public Throwable getCause()

Returns the exception which occurred while loading the class, otherwise returns null.

Since:Returns:


getException

public Throwable getException()

Returns the exception which occurred while loading the class, otherwise returns null. This is a legacy method; the preferred choice now is Throwable#getCause().

Since:Returns: