Example usage for java.rmi RemoteException getMessage

List of usage examples for java.rmi RemoteException getMessage

Introduction

In this page you can find the example usage for java.rmi RemoteException getMessage.

Prototype

public String getMessage() 

Source Link

Document

Returns the detail message, including the message from the cause, if any, of this exception.

Usage

From source file:org.jenkins_ci.update_center.Main.java

private RemotePage findPage(String artifactId, Document pomDoc, ConfluencePluginList cpl) throws IOException {
    try {//from  w  ww. j ava 2 s .  co  m
        String p = Plugin.OVERRIDES.getProperty(artifactId);
        if (p != null) {
            return cpl.getPage(p);
        }
    } catch (RemoteException e) {
        System.err.println("** Override failed for " + artifactId);
        e.printStackTrace();
    }

    if (pomDoc != null) {
        String wikiPage = selectSingleValue(pomDoc, "/project/url");
        if (wikiPage != null) {
            try {
                return cpl.getPage(wikiPage); // found the confluence page successfully
            } catch (RemoteException e) {
                System.err.println("** Failed to fetch " + wikiPage);
                e.printStackTrace();
            } catch (IllegalArgumentException e) {
                System.err.println(e.getMessage());
            }
        }
    }

    // try to guess the Wiki page
    try {
        return cpl.findNearest(artifactId);
    } catch (RemoteException e) {
        System.err.println("** Failed to locate nearest");
        e.printStackTrace();
    }

    return null;
}

From source file:org.josso.gateway.identity.service.WebserviceSSOIdentityManager.java

public void userExists(String requester, String securityDomain, String username)
        throws NoSuchUserException, SSOIdentityException {
    try {//from   w w  w.  jav a  2s .co m
        if (logger.isDebugEnabled())
            logger.debug("[userExists()] : " + username);
        UserExistsRequestType request = new UserExistsRequestType(requester, securityDomain, username);
        UserExistsResponseType response = _wsSSOIdentityManager.userExists(request);
        if (!response.isUserexists())
            throw new NoSuchUserException(username);

    } catch (java.rmi.RemoteException e) {
        _errorCount++;
        throw new SSOIdentityException(e.getMessage(), e);
    } catch (Exception e) {
        _errorCount++;
        throw new SSOIdentityException(e.getMessage(), e);
    } finally {
        _processedCount++;
    }
}

From source file:org.ms123.common.rpc.JsonRpcServlet.java

protected Map<String, Object> buildResponse(final Map<String, Object> request,
        final RemoteException exception) {
    final Map<String, Object> response = new HashMap<String, Object>(3);
    final Map<String, Object> error = new HashMap<String, Object>(6);
    error.put("origin", ERROR_FROM_METHOD);
    error.put("code", null);
    error.put("message", exception.getMessage());
    error.put("class", exception.getClass().getName());
    final Throwable cause = exception.getCause();
    if (cause != null) {
    }/*  w  w  w  . j  av a  2  s  .c om*/
    response.put("id", request.get("id"));
    response.put("error", error);
    response.put("result", null);
    return response;
}

From source file:org.mskcc.cbio.portal.servlet.QueryBuilder.java

/**
 * Handles HTTP POST Request.//  w  w w .  jav a 2 s.c o m
 *
 * @param httpServletRequest  Http Servlet Request Object.
 * @param httpServletResponse Http Servlet Response Object.
 * @throws ServletException Servlet Error.
 * @throws IOException      IO Error.
 */
protected void doPost(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse)
        throws ServletException, IOException {

    XDebug xdebug = new XDebug(httpServletRequest);
    xdebug.startTimer();

    xdebug.logMsg(this, "Attempting to initiate new user query.");

    if (httpServletRequest.getRequestURL() != null) {
        httpServletRequest.setAttribute(ATTRIBUTE_URL_BEFORE_FORWARDING,
                httpServletRequest.getRequestURL().toString());
    }

    //  Get User Selected Action
    String action = httpServletRequest.getParameter(ACTION_NAME);

    String patientCaseSelect = httpServletRequest.getParameter(PATIENT_CASE_SELECT);

    //  Get User Selected Cancer Type
    String cancerTypeId = httpServletRequest.getParameter(CANCER_STUDY_ID);

    //  Get User Selected Genetic Profiles
    HashSet<String> geneticProfileIdSet = getGeneticProfileIds(httpServletRequest, xdebug);

    //  Get User Defined Gene List
    String geneList = httpServletRequest.getParameter(GENE_LIST);
    if (httpServletRequest instanceof XssRequestWrapper) {
        geneList = ((XssRequestWrapper) httpServletRequest).getRawParameter(GENE_LIST);
    }
    geneList = servletXssUtil.getCleanInput(geneList);
    httpServletRequest.setAttribute(GENE_LIST, geneList);

    //  Get all Cancer Types
    try {
        List<CancerStudy> cancerStudyList = accessControl.getCancerStudies();

        if (cancerTypeId == null) {
            cancerTypeId = cancerStudyList.get(0).getCancerStudyStableId();
        }

        httpServletRequest.setAttribute(CANCER_STUDY_ID, cancerTypeId);
        httpServletRequest.setAttribute(CANCER_TYPES_INTERNAL, cancerStudyList);

        //  Get Genetic Profiles for Selected Cancer Type
        ArrayList<GeneticProfile> profileList = GetGeneticProfiles.getGeneticProfiles(cancerTypeId);
        httpServletRequest.setAttribute(PROFILE_LIST_INTERNAL, profileList);

        //  Get Patient Sets for Selected Cancer Type
        xdebug.logMsg(this, "Using Cancer Study ID:  " + cancerTypeId);
        ArrayList<SampleList> sampleSets = GetSampleLists.getSampleLists(cancerTypeId);
        xdebug.logMsg(this, "Total Number of Patient Sets:  " + sampleSets.size());
        SampleList sampleSet = new SampleList();
        sampleSet.setName("User-defined Patient List");
        sampleSet.setDescription("User defined patient list.");
        sampleSet.setStableId("-1");
        sampleSets.add(sampleSet);
        httpServletRequest.setAttribute(CASE_SETS_INTERNAL, sampleSets);

        //  Get User Selected Patient Set
        String sampleSetId = httpServletRequest.getParameter(CASE_SET_ID);
        if (sampleSetId != null) {
            httpServletRequest.setAttribute(CASE_SET_ID, sampleSetId);
        } else {
            if (sampleSets.size() > 0) {
                SampleList zeroSet = sampleSets.get(0);
                httpServletRequest.setAttribute(CASE_SET_ID, zeroSet.getStableId());
            }
        }
        String sampleIds = httpServletRequest.getParameter(CASE_IDS);
        // TODO allowing only new line and tab chars, getRawParameter may be vulnerable here...
        if (sampleIds != null) {
            sampleIds = sampleIds.replaceAll("\\\\n", "\n").replaceAll("\\\\t", "\t");
        }

        httpServletRequest.setAttribute(XDEBUG_OBJECT, xdebug);

        String dbPortalVersion = GlobalProperties.getDbVersion();
        String dbVersion = DaoInfo.getVersion();
        LOG.info("version - " + dbPortalVersion);
        LOG.info("version - " + dbVersion);
        if (!dbPortalVersion.equals(dbVersion)) {
            String extraMessage = "";
            //extra message for the cases where property is missing (will happen often in transition period to this new versioning model):
            if (dbPortalVersion.equals("0"))
                extraMessage = "The db.version property also not found in your portal.properties file. This new property needs to be added by the administrator.";
            httpServletRequest.setAttribute(DB_ERROR, "Current DB Version: " + dbVersion + "<br/>"
                    + "DB version expected by Portal: " + dbPortalVersion + "<br/>" + extraMessage);
        }

        boolean errorsExist = validateForm(action, profileList, geneticProfileIdSet, sampleSetId, sampleIds,
                httpServletRequest);
        if (action != null && action.equals(ACTION_SUBMIT) && (!errorsExist)) {

            processData(cancerTypeId, geneList, geneticProfileIdSet, profileList, sampleSetId, sampleIds,
                    sampleSets, patientCaseSelect, getServletContext(), httpServletRequest, httpServletResponse,
                    xdebug);
        } else {
            if (errorsExist) {
                httpServletRequest.setAttribute(QueryBuilder.USER_ERROR_MESSAGE,
                        "Please fix the errors below.");
            }
            RequestDispatcher dispatcher = getServletContext().getRequestDispatcher("/WEB-INF/jsp/index.jsp");
            dispatcher.forward(httpServletRequest, httpServletResponse);
        }
    } catch (RemoteException e) {
        xdebug.logMsg(this, "Got Remote Exception:  " + e.getMessage());
        forwardToErrorPage(httpServletRequest, httpServletResponse, DB_CONNECT_ERROR, xdebug);
    } catch (DaoException e) {
        xdebug.logMsg(this, "Got Database Exception:  " + e.getMessage());
        forwardToErrorPage(httpServletRequest, httpServletResponse, DB_CONNECT_ERROR, xdebug);
    } catch (ProtocolException e) {
        xdebug.logMsg(this, "Got Protocol Exception:  " + e.getMessage());
        forwardToErrorPage(httpServletRequest, httpServletResponse, DB_CONNECT_ERROR, xdebug);
    }
}

From source file:org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.service.DelegatingService.java

public RunInstancesResponseType runInstances(RunInstancesType runInstancesRequestMsg) throws RemoteException {

    try {/*from  w  w  w . j av  a2s.com*/
        if (this.rm == null) {
            this.findManager();
        }
        return this.rm.runInstances(runInstancesRequestMsg);
    } catch (RemoteException e) {
        if (logger.isDebugEnabled()) {
            logger.error(e.getMessage(), e);
        } else {
            logger.error(e.getMessage());
        }
        throw e;
    } catch (Throwable t) {
        throw new RemoteException(this.unknown(t, "runInstances"));
    }
}

From source file:org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.service.DelegatingService.java

public TerminateInstancesResponseType terminateInstances(TerminateInstancesType terminateInstancesRequestMsg)
        throws RemoteException {

    try {/*from  w w  w .j a va2  s .c  o  m*/
        if (this.rm == null) {
            this.findManager();
        }
        return this.rm.terminateInstances(terminateInstancesRequestMsg);
    } catch (RemoteException e) {
        if (logger.isDebugEnabled()) {
            logger.error(e.getMessage(), e);
        } else {
            logger.error(e.getMessage());
        }
        throw e;
    } catch (Throwable t) {
        throw new RemoteException(this.unknown(t, "terminateInstances"));
    }
}

From source file:org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.service.DelegatingService.java

public RebootInstancesResponseType rebootInstances(RebootInstancesType rebootInstancesRequestMsg)
        throws RemoteException {

    try {//from ww  w.  ja va  2s.c o m
        if (this.rm == null) {
            this.findManager();
        }
        return this.rm.rebootInstances(rebootInstancesRequestMsg);
    } catch (RemoteException e) {
        if (logger.isDebugEnabled()) {
            logger.error(e.getMessage(), e);
        } else {
            logger.error(e.getMessage());
        }
        throw e;
    } catch (Throwable t) {
        throw new RemoteException(this.unknown(t, "rebootInstances"));
    }
}

From source file:org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.service.DelegatingService.java

public DescribeInstancesResponseType describeInstances(DescribeInstancesType describeInstancesRequestMsg)
        throws RemoteException {

    try {/*from w ww  . j  a v a 2s . c  om*/
        if (this.rm == null) {
            this.findManager();
        }
        return this.rm.describeInstances(describeInstancesRequestMsg);
    } catch (RemoteException e) {
        if (logger.isDebugEnabled()) {
            logger.error(e.getMessage(), e);
        } else {
            logger.error(e.getMessage());
        }
        throw e;
    } catch (Throwable t) {
        throw new RemoteException(this.unknown(t, "describeInstances"));
    }
}

From source file:org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.service.DelegatingService.java

public DescribeAvailabilityZonesResponseType describeAvailabilityZones(
        DescribeAvailabilityZonesType describeAvailabilityZonesRequestMsg) throws RemoteException {
    try {//  w  w w  . j  a  v  a  2s .  co  m
        if (this.general == null) {
            this.findGeneral();
        }
        return this.general.describeAvailabilityZones(describeAvailabilityZonesRequestMsg);
    } catch (RemoteException e) {
        if (logger.isDebugEnabled()) {
            logger.error(e.getMessage(), e);
        } else {
            logger.error(e.getMessage());
        }
        throw e;
    } catch (Throwable t) {
        throw new RemoteException(this.unknown(t, "describeAvailabilityZones"));
    }
}

From source file:org.nimbustools.messaging.gt4_0_elastic.v2008_05_05.service.DelegatingService.java

public CreateKeyPairResponseType createKeyPair(CreateKeyPairType createKeyPairRequestMsg)
        throws RemoteException {

    try {// w  ww .ja v  a2s  .com
        this.findSecurity();
        if (this.security != null) {
            return this.security.createKeyPair(createKeyPairRequestMsg);
        } else {
            return super.createKeyPair(createKeyPairRequestMsg);
        }
    } catch (RemoteException e) {
        if (logger.isDebugEnabled()) {
            logger.error(e.getMessage(), e);
        } else {
            logger.error(e.getMessage());
        }
        throw e;
    } catch (Throwable t) {
        throw new RemoteException(this.unknown(t, "createKeyPair"));
    }
}