naming/src/main/java/org/jboss/as/naming/util/NamingUtils.java
public static NamingException namingException(final String message, final Throwable cause) {
        final NamingException exception = new NamingException(message);
        if (cause != null) exception.initCause(cause);
        return exception;
    }
public static NamingException namingException(final String message, final Throwable cause) {
        final NamingException exception = new NamingException(message);
        if (cause != null) exception.initCause(cause);
        return exception;
    }
Return a general naming exception with a root cause.

@param message the message
@param cause the exception cause, or {@code null} for none
@return the exception