Class InjectionException

All Implemented Interfaces:
Serializable

public class InjectionException extends InvalidObjectException
The environment could not complete an object when deserialising: a required Injected field the driver cannot satisfy, a declaration the environment cannot honour at all, an InjectionAware.afterInjection() that threw – or an InjectionAware object met by a stream that refuses such objects instead of recording them.

Being an InvalidObjectException places these failures in the serialisation-problem family under IOException: the refusal of plain streams surfaces through the existing failure channel of readObject, while a catch that cares can still tell "the environment could not complete this object" from ordinary stream trouble. The failure that matters travels as the cause.

See Also:
  • Constructor Details

    • InjectionException

      public InjectionException(String message)
      Creates an exception with the designated description of the injection problem.
      Parameters:
      message - The description of the injection problem.
    • InjectionException

      public InjectionException(String message, Throwable cause)
      Creates an exception with the designated description of the injection problem and the failure causing it, that is the provider lookup or the afterInjection which threw.
      Parameters:
      message - The description of the injection problem.
      cause - The failure causing this injection problem.