NamingException (Java SE 15 & JDK 15) (original) (raw)

All Implemented Interfaces:

[Serializable](../../../java.base/java/io/Serializable.html "interface in java.io")

Direct Known Subclasses:

[AttributeInUseException](directory/AttributeInUseException.html "class in javax.naming.directory"), [AttributeModificationException](directory/AttributeModificationException.html "class in javax.naming.directory"), [CannotProceedException](CannotProceedException.html "class in javax.naming"), [CommunicationException](CommunicationException.html "class in javax.naming"), [ConfigurationException](ConfigurationException.html "class in javax.naming"), [ContextNotEmptyException](ContextNotEmptyException.html "class in javax.naming"), [InsufficientResourcesException](InsufficientResourcesException.html "class in javax.naming"), [InterruptedNamingException](InterruptedNamingException.html "class in javax.naming"), [InvalidAttributeIdentifierException](directory/InvalidAttributeIdentifierException.html "class in javax.naming.directory"), [InvalidAttributesException](directory/InvalidAttributesException.html "class in javax.naming.directory"), [InvalidAttributeValueException](directory/InvalidAttributeValueException.html "class in javax.naming.directory"), [InvalidNameException](InvalidNameException.html "class in javax.naming"), [InvalidSearchControlsException](directory/InvalidSearchControlsException.html "class in javax.naming.directory"), [InvalidSearchFilterException](directory/InvalidSearchFilterException.html "class in javax.naming.directory"), [LimitExceededException](LimitExceededException.html "class in javax.naming"), [LinkException](LinkException.html "class in javax.naming"), [NameAlreadyBoundException](NameAlreadyBoundException.html "class in javax.naming"), [NameNotFoundException](NameNotFoundException.html "class in javax.naming"), [NamingSecurityException](NamingSecurityException.html "class in javax.naming"), [NoInitialContextException](NoInitialContextException.html "class in javax.naming"), [NoSuchAttributeException](directory/NoSuchAttributeException.html "class in javax.naming.directory"), [NotContextException](NotContextException.html "class in javax.naming"), [OperationNotSupportedException](OperationNotSupportedException.html "class in javax.naming"), [PartialResultException](PartialResultException.html "class in javax.naming"), [ReferralException](ReferralException.html "class in javax.naming"), [SchemaViolationException](directory/SchemaViolationException.html "class in javax.naming.directory"), [ServiceUnavailableException](ServiceUnavailableException.html "class in javax.naming")


public class NamingException extends Exception

This is the superclass of all exceptions thrown by operations in the Context and DirContext interfaces. The nature of the failure is described by the name of the subclass. This exception captures the information pinpointing where the operation failed, such as where resolution last proceeded to.

null is an acceptable value for any of these fields. When null, it means that no such information has been recorded for that field.

A NamingException instance is not synchronized against concurrent multithreaded access. Multiple threads trying to access and modify a single NamingException instance should lock the object.

This exception has been retrofitted to conform to the general purpose exception-chaining mechanism. The_root exception_ (or root cause) is the same object as the_cause_ returned by the Throwable.getCause() method.

Since:

1.3

See Also:

Serialized Form

Fields

Modifier and Type Field Description
protected Name remainingName Contains the remaining name that has not been resolved yet.
protected Name resolvedName Contains the part of the name that has been successfully resolved.
protected Object resolvedObj Contains the object to which resolution of the part of the name was successful.
protected Throwable rootException Contains the original exception that caused this NamingException to be thrown.

Constructors

Constructor Description
NamingException() Constructs a new NamingException.
NamingException​(String explanation) Constructs a new NamingException with an explanation.
Modifier and Type Method Description
void appendRemainingComponent​(String name) Add name as the last component in remaining name.
void appendRemainingName​(Name name) Add components from 'name' as the last components in remaining name.
Throwable getCause() Returns the cause of this exception.
String getExplanation() Retrieves the explanation associated with this exception.
Name getRemainingName() Retrieves the remaining unresolved portion of the name.
Name getResolvedName() Retrieves the leading portion of the name that was resolved successfully.
Object getResolvedObj() Retrieves the object to which resolution was successful.
Throwable getRootCause() Retrieves the root cause of this NamingException, if any.
Throwable initCause​(Throwable cause) Initializes the cause of this exception to the specified value.
void setRemainingName​(Name name) Sets the remaining name field of this exception.
void setResolvedName​(Name name) Sets the resolved name field of this exception.
void setResolvedObj​(Object obj) Sets the resolved object field of this exception.
void setRootCause​(Throwable e) Records the root cause of this NamingException.
String toString() Generates the string representation of this exception.
String toString​(boolean detail) Generates the string representation in more detail.