naming/src/main/java/org/jboss/as/naming/util/NamingUtils.java
public static NamingException namingException(final String message, final Throwable cause, final Name remainingName) {
        final NamingException exception = namingException(message, cause);
        exception.setRemainingName(remainingName);
        return exception;
    }
public static NamingException namingException(final String message, final Throwable cause, final Name remainingName) {
        final NamingException exception = namingException(message, cause);
        exception.setRemainingName(remainingName);
        return exception;
    }
Return a general naming exception with a root cause and a remaining name field.

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