@Override public final RuntimeException couldNotObtainCredentialWithCause(final Throwable cause) { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), couldNotObtainCredentialWithCause$str()), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String invalidPasswordKeySpecificationForAlgorithm = "ELY01043: Invalid password key specification for algorithm \"%s\"";
@Override public final RuntimeException couldNotOpenConnection(final Throwable cause) { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), couldNotOpenConnection$str()), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String couldNotExecuteQuery = "ELY01050: Could not execute query \"%s\"";
@Override public final RuntimeException ldapRealmFailedObtainAttributes(final String dn, final Throwable cause) { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), ldapRealmFailedObtainAttributes$str(), dn), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String ldapRealmInvalidRdnForAttribute = "ELY01080: Attribute [%s] value [%s] must be in X.500 format in order to obtain RDN [%s].";
@Override public final RuntimeException cannotObtainExceptionRepositoryID(final String type, final Throwable cause) { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), cannotObtainExceptionRepositoryID$str(), type), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String errorMashalingParams = "WFLYIIOP0083: Cannot marshal parameter: unexpected number of parameters";
@Override public final RuntimeException failedToParsePath() { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), failedToParsePath$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String authenticationFailed = "UT000038: Authentication failed, requested user name '%s'";
@Override public final RuntimeException couldNotParseUriTemplate(final String path, final int i) { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), couldNotParseUriTemplate$str(), path, i)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String mismatchedBraces = "UT000057: Mismatched braces in attribute string %s";
@Override public final RuntimeException hostHasNotBeenRegistered(final Object host) { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), hostHasNotBeenRegistered$str(), host)); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String extraDataWrittenAfterChunkEnd = "UT000084: Attempted to write additional data after the last chunk";
@Override public final RuntimeException couldNotGenerateUniqueSessionId() { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), couldNotGenerateUniqueSessionId$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String controlFrameCannotHaveBodyContent = "UT000088: SPDY control frames cannot have body content";
@Override public final RuntimeException couldNotCreateClusterNodeSelector(final Exception e, final String clusterName) { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), couldNotCreateClusterNodeSelector$str(), clusterName), e); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String cannotSpecifyBothCallbackHandlerAndUserPass = "EJBCLIENT000054: Cannot specify both a callback handler and a username/password";
@Override public final RuntimeException asyncInvocationOnlyApplicableForSessionBeans() { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), asyncInvocationOnlyApplicableForSessionBeans$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String notStatefulSessionBean = "WFLYEJB0053: %s is not a Stateful Session bean in app: %s module: %s distinct-name: %s";
@Override public final RuntimeException failedToMarshalEjbParameters(final Exception e) { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), failedToMarshalEjbParameters$str()), e); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String unknownDeployment = "WFLYEJB0055: No matching deployment for EJB: %s";
@Override public final RuntimeException failedToLoadViewClassForComponent(final Exception e, final String componentName) { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), failedToLoadViewClassForComponent$str(), componentName), e); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String illegalCallToEjbHomeRemove = "WFLYEJB0073: Illegal call to EJBHome.remove(Object) on a session bean";
@Override public final RuntimeException failedToLoadViewClass(final Exception e, final String viewClassName) { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), failedToLoadViewClass$str(), viewClassName), e); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String couldNotDetermineEjbRefForInjectionTarget = "WFLYEJB0088: Could not determine type of ejb-ref %s for injection target %s";
@Override public final RuntimeException couldNotCreateCorbaObject(final Exception cause, final org.jboss.ejb.client.EJBLocator<?> locator) { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), couldNotCreateCorbaObject$str(), locator), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String incorrectEJBLocatorForBean = "WFLYEJB0099: Provided locator %s was not for EJB %s";
@Override public final RuntimeException passivationFailed(final Throwable cause, final Object id) { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), passivationFailed$str(), id), cause); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String activationFailed = "WFLYEJB0401: Failed to activate %s";
@Override public final RuntimeException jmxSubsystemNotInstalled() { final RuntimeException result = new RuntimeException(String.format(getLoggingLocale(), jmxSubsystemNotInstalled$str())); final StackTraceElement[] st = result.getStackTrace(); result.setStackTrace(Arrays.copyOfRange(st, 1, st.length)); return result; } private static final String inconsistentStatisticsSettings = "WFLYTX0012: Attributes %s and %s are alternatives; both cannot be set with conflicting values.";
/** * Returns the initial vote value of the peer epoch. * * @return long */ private long getPeerEpoch(){ if(self.getLearnerType() == LearnerType.PARTICIPANT) try { return self.getCurrentEpoch(); } catch(IOException e) { RuntimeException re = new RuntimeException(e.getMessage()); re.setStackTrace(e.getStackTrace()); throw re; } else return Long.MIN_VALUE; }
private <EX extends Throwable> EX withCallTraces( EX failure ) { for ( StackTraceElement[] waitCall : waitCalls ) { RuntimeException call = new RuntimeException( "Wait called" ); call.setStackTrace( waitCall ); failure.addSuppressed( call ); } return failure; } }
synchronized public void startLeaderElection() { try { if (getPeerState() == ServerState.LOOKING) { currentVote = new Vote(myid, getLastLoggedZxid(), getCurrentEpoch()); } } catch(IOException e) { RuntimeException re = new RuntimeException(e.getMessage()); re.setStackTrace(e.getStackTrace()); throw re; } this.electionAlg = createElectionAlgorithm(electionType); }
public static RuntimeException translateException(String msg, Exception cause) { RuntimeException runtimeException = new RuntimeException(String.format("%s: [%s] %s", msg, cause.getClass().getName(), cause.getMessage())); runtimeException.setStackTrace(cause.getStackTrace()); return runtimeException; }