Chapter 11. Exceptions

Exceptions thrown by the Web Bean manager fall into three groups:

Definition errors are developer errors. They may be detected by tooling at development time, and are also detected by the Web Bean manager at initialization time. If a definition error exists in a deployment, the deployment will be aborted by the Web Bean manager.

Deployment problems are detected by the Web Bean manager at initialization time. If a deployment problem exists in a deployment, the deployment will be aborted by the Web Bean manager.

Execution errors may not be detected until they actually occur at runtime.

All exceptions defined by this specification are runtime exceptions.

11.1. Definition errors

Definition errors are represented by instances of DefinitionException and its subclasses.

public class DefinitionException extends RuntimeException {
    
    public DefinitionException(String message) { ... }
    
}

This specification defines the following subclasses:

  • NonexistentTypeException

  • NonexistentMemberException

  • NonexistentFieldException

  • NonexistentMethodException

  • NonexistentConstructorException

Web Bean manager implementations may define their own subclasses of DefinitionException, and throw an instance of a subclass anywhere that this specification requires a DefinitionException to be thrown.

11.2. Deployment problems

Deployment problems are represented by instances of DeploymentException and its subclasses.

public class DeploymentException extends RuntimeException {
    
    public DeploymentException(String message) { ... }
    
}

This specification defines the following subclasses:

  • UnsatisfiedDependencyException

  • AmbiguousDependencyException

  • UnserializableDependencyException

  • NullableDependencyException

  • UnproxyableDependencyException

  • InconsistentSpecializationException

11.3. Execution errors

Execution errors are represented by instances of ExecutionException and its subclasses.

public class ExecutionException extends RuntimeException {
    
    public ExecutionException(String message) { ... }
    
}

This specification defines the following subclasses:

  • CreationException

  • UnremovedException

  • IllegalProductException

  • ObserverException

  • DuplicateBindingTypeException

  • ContextNotActiveException