open class InvalidClassException : ObjectStreamException
kotlin.Any
   ↳ kotlin.Throwable
   ↳ java.lang.Exception
   ↳ java.io.IOException
   ↳ java.io.ObjectStreamException
   ↳ java.io.InvalidClassException

Thrown when the Serialization runtime detects one of the following problems with a Class.

  • The serial version of the class does not match that of the class descriptor read from the stream
  • The class contains unknown datatypes
  • The class does not have an accessible no-arg constructor
  • The ObjectStreamClass of an enum constant does not represent an enum type
  • Other conditions given in the Java Object Serialization Specification

Summary

Public constructors

Report an InvalidClassException for the reason specified.

InvalidClassException(cname: String!, reason: String!)

Constructs an InvalidClassException object.

Properties
String!

Name of the invalid class.

open String?

Produce the message and include the classname, if present.

Public constructors

InvalidClassException

InvalidClassException(reason: String!)

Report an InvalidClassException for the reason specified.

Parameters
reason String!: String describing the reason for the exception.

InvalidClassException

InvalidClassException(
    cname: String!,
    reason: String!)

Constructs an InvalidClassException object.

Parameters
cname String!: a String naming the invalid class.
reason String!: a String describing the reason for the exception.

Properties

classname

var classname: String!

Name of the invalid class.

message

open val message: String?

Produce the message and include the classname, if present.

Return
String? the detail message string of this Throwable instance (which may be null).

Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.

Last updated 2025-02-10 UTC.