forName method in class Class.
findSystemClass method in class
ClassLoader .
loadClass method in class ClassLoader.
but no definition for the class with the specified name could be found.
java.lang.Class#forName(java.lang.String) , java.lang.ClassLoader#findSystemClass(java.lang.String) , java.lang.ClassLoader#loadClass(java.lang.String, boolean)
| Modifier and Type | Field and Description |
|---|---|
| private static final ObjectStreamField[] | serialPersistentFields
Serializable fields for ClassNotFoundException. |
| private static final long | serialVersionUID
Hides java. |
| Access | Constructor and Description |
|---|---|
| public | |
| public | ClassNotFoundException(String
the detail message. s)Constructs a |
| public | ClassNotFoundException(String
the detail message s, Throwable the exception that was raised while loading the class ex)Constructs a |
| Modifier and Type | Method and Description |
|---|---|
| public Throwable | Returns: theException that was raised while loading a classReturns the exception that was raised if an error occurred while attempting to load the class. |
| private void | readObject(ObjectInputStream
the s)ObjectInputStream from which data is readHides java. Reconstitutes the ClassNotFoundException instance from a stream and initialize the cause properly when deserializing from an older version. |
| private void | writeObject(ObjectOutputStream
the out)ObjectOutputStream to which data is writtenHides java. To maintain compatibility with older implementation, write a serial "ex" field with the cause as the value. |
| serialPersistentFields | back to summary |
|---|---|
| private static final ObjectStreamField[] serialPersistentFields Serializable fields for ClassNotFoundException.
| |
| serialVersionUID | back to summary |
|---|---|
| private static final long serialVersionUID Hides java. use serialVersionUID from JDK 1.1.X for interoperability | |
| ClassNotFoundException | back to summary |
|---|---|
| public ClassNotFoundException() Constructs a | |
| ClassNotFoundException | back to summary |
|---|---|
| public ClassNotFoundException(String s) Constructs a
| |
| ClassNotFoundException | back to summary |
|---|---|
| public ClassNotFoundException(String s, Throwable ex) Constructs a | |
| getException | back to summary |
|---|---|
| public Throwable getException() Returns the exception that was raised if an error occurred while
attempting to load the class. Otherwise, returns API Note This method predates the general-purpose exception chaining facility.
The
| |
| readObject | back to summary |
|---|---|
| private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException Hides java. Reconstitutes the ClassNotFoundException instance from a stream and initialize the cause properly when deserializing from an older version. The getException and getCause method returns the private "ex" field in the older implementation and ClassNotFoundException::cause was set to null.
| |
| writeObject | back to summary |
|---|---|
| private void writeObject(ObjectOutputStream out) throws IOException Hides java. To maintain compatibility with older implementation, write a serial "ex" field with the cause as the value.
| |