Package org.springframework.beans

# Class MethodInvocationException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
org.springframework.core.NestedRuntimeException
org.springframework.beans.BeansException
org.springframework.beans.PropertyAccessException
org.springframework.beans.MethodInvocationException

All Implemented Interfaces:
  `Serializable`

public class MethodInvocationException extends PropertyAccessException
Thrown when a bean property getter or setter method throws an exception, analogous to an InvocationTargetException.

Author:
  Rod Johnson, Juergen Hoeller
See Also:
  - Serialized Form

## Field Summary

Fields
Modifier and Type
Field
Description
`static final String`
`ERROR_CODE`
Error code that a method invocation error will be registered with.

## Constructor Summary

Constructors
Constructor
Description
`MethodInvocationException(PropertyChangeEvent propertyChangeEvent, Throwable cause)`
Create a new MethodInvocationException.

## Method Summary

Modifier and Type
Method
Description
`String`
`getErrorCode()`
Return a corresponding error code for this type of exception.

### Methods inherited from class org.springframework.beans.PropertyAccessException

`getPropertyChangeEvent, getPropertyName, getValue`

### Methods inherited from class org.springframework.core.NestedRuntimeException

`contains, getMostSpecificCause, getRootCause`

### Methods inherited from class java.lang.Throwable

`addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Field Details

### ERROR_CODE

public static final String ERROR_CODE
Error code that a method invocation error will be registered with.

See Also:
  - Constant Field Values

## Constructor Details

### MethodInvocationException

public MethodInvocationException(PropertyChangeEvent propertyChangeEvent, @Nullable Throwable cause)
Create a new MethodInvocationException.

Parameters:
  `propertyChangeEvent` - the PropertyChangeEvent that resulted in an exception
  `cause` - the Throwable raised by the invoked method

## Method Details

### getErrorCode

public String getErrorCode()
Description copied from class: `PropertyAccessException`
Return a corresponding error code for this type of exception.

Specified by:
  `getErrorCode` in class `PropertyAccessException`