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:gov.nih.nci.caarray.services.external.v1_0.grid.client.GridDataApiUtils.java

/**
 * {@inheritDoc}//from  w ww  .  j  av  a2 s .com
 */
@Override
protected MageTabFileSet exportMageTab(CaArrayEntityReference experimentRef)
        throws InvalidReferenceException, DataTransferException {
    try {
        return client.getMageTabExport(experimentRef);
    } catch (IncorrectEntityTypeFault f) {
        throw new IncorrectEntityTypeException(f.getCaArrayEntityReference(), GridApiUtils.getMessage(f));
    } catch (NoEntityMatchingReferenceFault f) {
        throw new NoEntityMatchingReferenceException(f.getCaArrayEntityReference(), GridApiUtils.getMessage(f));
    } catch (DataStagingFault f) {
        throw new DataTransferException(GridApiUtils.getMessage(f));
    } catch (RemoteException e) {
        throw new DataTransferException(e.getMessage());
    }
}

From source file:edu.du.penrose.systems.fedoraApp.web.bus.SearchFedoraFormController.java

public ModelAndView onSubmit(HttpServletRequest request, HttpServletResponse response, Object command,
        BindException errors) throws Exception {

    SearchFedoraCmd searchCmd = (SearchFedoraCmd) command;
    Administrator administrator = (Administrator) request.getSession()
            .getAttribute("edu.du.penrose.systems.fedora.client.Administrator");

    FieldSearchQuery query = new FieldSearchQuery();
    query.setTerms(searchCmd.getQuery());

    FieldSearchResult fsResult = null;//from   w  w w . j a v a2 s .com
    int maxResults = 100;
    String[] resultFields = new String[3];
    String[] displayFields = resultFields;
    resultFields[0] = "pid";
    resultFields[1] = "cDate";
    resultFields[2] = "title";

    try {

        fsResult = administrator.getAPIA().findObjects(resultFields, new NonNegativeInteger("" + maxResults),
                query);
    } catch (java.rmi.RemoteException e) {
        Exception newE = new Exception(e.getMessage() + " - Details in $FEDORA_HOME/server/logs/fedora.log", e);
        throw newE;
    }

    searchCmd.setResultFields(resultFields);
    searchCmd.setFsDataResults(this.convertSearchData(fsResult, displayFields));

    request.setAttribute("edu.du.penrose.systems.fedoraApp.web.data.SearchFedoraCmd", searchCmd);

    return new ModelAndView(this.getSuccessView());
}

From source file:is.idega.idegaweb.egov.gumbo.webservice.client.business.FJSWSClient.java

public String createLicenseFeeClaim(String ssn, String shipNr, List<ProcessPaymentCode> entries) {
    IWMainApplicationSettings settings = IWMainApplication.getDefaultIWApplicationContext()
            .getApplicationSettings();/*from ww  w.ja  v  a  2 s  .co  m*/

    String DOFSSN = settings.getProperty("DOFSSN", "6608922069");
    String DOFCode = settings.getProperty("DOFCompanyCode", "9635");

    String period = getPeriod(ssn, shipNr);

    ProcessPaymentLogHeader header = getGumboDAO().createHeader();

    if (shipNr != null && !"".equals(shipNr)) {
        if (shipNr.length() < 4) {
            shipNr = "0000".substring(0, 4 - shipNr.length()) + shipNr;
        }
    }

    TBRSundurlidun wsEntries[] = new TBRSundurlidun[entries.size()];
    int counter = 0;
    ProcessPaymentLog log = null;
    for (ProcessPaymentCode entry : entries) {
        log = getGumboDAO().createLogEntry(header, ssn, shipNr, period, entry.getPaymentCode(), 1,
                entry.getAmount(), entry.getAmount());
        wsEntries[counter++] = new TBRSundurlidun(entry.getPaymentCode(), new BigDecimal(1),
                new BigDecimal(entry.getAmount()), new BigDecimal(entry.getAmount()), log.getId().toString());
    }

    TBRStofnaKrofu iStofnaKrofu = new TBRStofnaKrofu(getHeader(header), wsEntries, DOFCode, ssn, "FV2", shipNr,
            period, DOFSSN);
    try {
        TBRStofnaKrofuSvar ret = getPort().stofnaKrofuVeidileyfi(iStofnaKrofu);
        getGumboDAO().updateHeader(header, ret.getSvarHaus().getKodi(), ret.getSvarHaus().getSkyring(),
                ret.getLykill());
        if (ret.getSvarHaus().getKodi() != 0) {
            System.out.println("FJS ERROR = " + ret.getSvarHaus().getSkyring() + ", "
                    + ret.getSvarHaus().getNanariSkyring());
        }
        return ret.getLykill();
    } catch (RemoteException e) {
        getGumboDAO().updateHeader(header, -1l, e.getMessage(), "-1"); // Have to get this to commit somehow, independant of the rest of the process?
        System.out.println("FJS ERROR = " + e.getMessage());
        e.printStackTrace();
    }

    return null;
}

From source file:com.sec.ose.osi.report.standard.data.SummaryRowGenerator.java

public ArrayList<SummaryRow> createSummaryRow() {

    ArrayList<SummaryRow> summarySheetRows = new ArrayList<SummaryRow>(2);
    String projectName = "";

    try {/*ww  w.  j  a v a  2 s .c o m*/

        int numOfProject = projectsInfo.size();
        int index = 0;
        for (ProjectInfoForIdentifyReport projectInfo : projectsInfo) {
            projectName = projectInfo.getProjectName();
            if (!ProjectAPIWrapper.isExistedProjectName(projectName))
                continue;

            String msgHead = "[" + (++index) + "/" + numOfProject + "] Working on " + projectName + "\n";
            observer.setMessageHeader(msgHead);

            SummaryRow summaryRow = createSummaryRow(projectName, observer);
            if (summaryRow != null)
                summarySheetRows.add(summaryRow);
        }

        projectName = "Total"; // for Error
        SummaryRow totalRow = createTotalRow(summarySheetRows, observer);
        if (totalRow != null)
            summarySheetRows.add(totalRow);

    } catch (RemoteException e) {
        log.warn(e);
        String message = "Error on generation summary at \"" + projectName + "\"\n" + e.getMessage();
        observer.setFailMessage(message);
        return null;
    }

    return summarySheetRows;

}

From source file:com.collabnet.ccf.teamforge.TFAppHandler.java

/**
 * This method retrieves all the comments added to a particular artifact
 * (represented by the ArtifactSoapDO) and adds all the comments that are
 * added after the lastModifiedDate into the ArtifcatSoapDO's flex fields
 * with the field name as "Comment Text" [as this is the name displayed in
 * the TF trackers for the Comments]/*from   w ww. j  a  va  2s . c  om*/
 * 
 * It calls the private method addComments which can add comments for a list
 * of artifacts by querying the ISourceForgeSoap object for this particular
 * TF system.
 * 
 * The comments added by the connector user are ignored by this method.
 * 
 * @param artifact
 *            - The ArtifactSoapDO object whose comments need to be added
 * @param lastModifiedDate
 *            - The last read time of this tracker
 * @param connectorUser
 *            - The username that is configured to log into the TF to
 *            retrieve the artifact data.
 * @param resyncUser
 *            - The resync user for CCF
 */
public void addComments(ArtifactDO artifact, Date lastModifiedDate, String connectorUser, String resyncUser,
        boolean isPreserveBulkCommentOrder) {
    try {
        CommentList commentList = connection.getTeamForgeClient().getCommentList(artifact.getId());
        CommentRow[] comments = commentList.getDataRows();

        if (comments != null) {
            if (isPreserveBulkCommentOrder && comments.length > 1) {
                Collections.reverse(Arrays.asList(comments));
            }
            for (CommentRow comment : comments) {
                String createdBy = comment.getCreatedBy();
                Date createdDate = comment.getDateCreated();
                if (createdBy.equals(connectorUser) || createdBy.equals(resyncUser)) {
                    continue;
                }
                if (lastModifiedDate.after(createdDate) || lastModifiedDate.equals(createdDate)) {
                    continue;
                }
                String description = comment.getDescription();
                description = "\nOriginal commenter: " + createdBy + "\n" + description;
                this.addComment(TFArtifactMetaData.TFFields.commentText.getFieldName(), artifact, description);
            }
        }
    } catch (RemoteException e) {
        log.error("Could not get comments list for artifact " + artifact.getId() + ": " + e.getMessage());
    }
}

From source file:com.collabnet.ccf.pi.sfee.v44.SFEEConnectionFactory.java

/**
 * Connection Factory implementation for the TF adaptor. 1. connectionInfo -
 * contains the server URL. 2. credentialInfo - contains the user name and
 * password delimited by ':'/*from   w  w  w .j  a v  a 2  s . com*/
 * 
 * The Repository ID contains the TF tracker ID
 */
public Connection createConnection(String systemId, String systemKind, String repositoryId,
        String repositoryKind, String connectionInfo, String credentialInfo,
        ConnectionManager<Connection> connectionManager) throws ConnectionException {
    if (StringUtils.isEmpty(repositoryId)) {
        throw new IllegalArgumentException("Repository Id cannot be null");
    }

    String username = null;
    String password = null;
    if (credentialInfo != null) {
        String[] splitCredentials = credentialInfo.split(PARAM_DELIMITER);
        if (splitCredentials != null) {
            if (splitCredentials.length == 1) {
                username = splitCredentials[0];
                password = "";
            } else if (splitCredentials.length == 2) {
                username = splitCredentials[0];
                password = splitCredentials[1];
            } else {
                throw new IllegalArgumentException("Credentials info is not valid.");
            }
        }
    }
    Connection connection = null;
    ISourceForgeSoap sfSoap = null;
    if (connectionManager.isUseStandardTimeoutHandlingCode()) {
        sfSoap = (ISourceForgeSoap) ClientSoapStubFactory.getSoapStub(ISourceForgeSoap.class, connectionInfo);
    } else {
        sfSoap = new SourceForgeSOAPTimeoutWrapper(connectionInfo, connectionManager);
    }
    String sessionId = null;
    try {
        sessionId = login(sfSoap, username, password);
        connection = new Connection(username, password, sfSoap, sessionId);
        connectionManager.registerConnection(sessionId, connection);
    } catch (RemoteException e) {
        String cause = "While trying to login into TF " + connectionInfo + " an exception occured: "
                + e.getMessage();
        log.error(cause, e);
        throw new ConnectionException(cause, e);
    }
    return connection;
}

From source file:com.collabnet.ccf.teamforge.TFConnectionFactory.java

public void closeConnection(Connection connection) throws ConnectionException {
    try {//from  w  w  w.  j  a va  2s . co  m
        if (connection.supports60()) {
            connection.getTeamForgeClient().logoff60(connection.getUserId());
        } else if (connection.supports50()) {
            connection.getTeamForgeClient().logoff50(connection.getUserId());
        } else {
            connection.getTeamForgeClient().logoff44(connection.getUserId());
        }
    } catch (RemoteException e) {
        String cause = "An error occured while trying to close the connection for " + e.getMessage();
        log.error(cause, e);
        throw new ConnectionException(cause, e);
    }

}

From source file:com.symbian.driver.remoting.master.TestMaster.java

/**
 * Start master./*  www . java 2  s  .  c o  m*/
 */
public void start() {

    String bindingName = null;
    String jobsFolder = null;
    String lHostName = null;
    String lServiceName = null;

    // start rmi registry
    /*
     * The user can specify the ip@ or the host name at config --server
     */
    try {

        TDConfig CONFIG = TDConfig.getInstance();
        lHostName = CONFIG.getPreference(TDConfig.SERVER_NAME);
        lServiceName = CONFIG.getPreference(TDConfig.SERVICE);

        LOGGER.fine("Host: " + lHostName + " RMI Service: " + lServiceName);

        jobsFolder = CONFIG.getPreferenceFile(TDConfig.JOBS_FOLDER).getAbsolutePath();
        if (lHostName.matches("^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}$")) {
            LOGGER.fine("Using host ip address for RMI from the config : " + lHostName);
            lHostName = InetAddress.getByName(lHostName).getHostName();
        }

        if (lHostName == null) {
            LOGGER.log(Level.SEVERE, "Could not determine the Host Name. Please check your config.");
            System.exit(-1);
        }

        System.getProperties().setProperty("java.rmi.server.hostname", lHostName);
        Registry lRegistry = LocateRegistry.createRegistry(1099);
        LOGGER.fine("Master: RMI registry ready. " + lRegistry);

    } catch (ParseException lE) {
        LOGGER.log(Level.SEVERE, "Master: Can not parse configuration.", lE);
        System.exit(-1);
    } catch (UnknownHostException lUHE) {
        LOGGER.log(Level.SEVERE, "Invalid host name " + lHostName, lUHE);
        System.exit(-1);
    } catch (RemoteException lRemoteException) {
        LOGGER.log(Level.SEVERE, "Master: RMI registry failed to start " + lRemoteException.getMessage(),
                lRemoteException);
        System.exit(-1);
    }

    File storeFolder = new File(SERIALIZE_FOLDER);
    if (!(storeFolder.isDirectory())) {
        if (!(storeFolder.mkdirs())) {
            LOGGER.log(Level.SEVERE,
                    "Master: Unable to create the store folder." + "Please ensure that the " + SERIALIZE_FOLDER
                            + " folder exists. It is needed by Master for placing system restore files.");
            System.exit(-1);
        }
    }

    try {
        if (ClientRegister.getInstance().needRestore()) {
            LOGGER.info("Restoring Client register.");
            ClientRegister.getInstance().restoreSnapshot();
        }
        if (JobTracker.getInstance().needRestore()) {
            LOGGER.info("Restoring Job tracker.");
            JobTracker.getInstance().restoreSnapshot();
        }
        JobCounter jobCounter = new JobCounter();
        if (jobCounter.needRestore()) {
            LOGGER.info("Restoring Job counter.");
            jobCounter.restoreSnapshot();
        }
        QueuedExecutor queuedExecutor = new QueuedExecutor();
        if (queuedExecutor.needRestore()) {
            LOGGER.info("Restoring execution queue.");
            queuedExecutor.restoreSnapshot();
        }
        bindingName = "//" + lHostName + "/" + lServiceName;
        MasterRemote master = new MasterRemoteImpl(jobsFolder, jobCounter, queuedExecutor);
        Naming.rebind(bindingName, master);
        LOGGER.info("Remote Service Name : " + bindingName);
    } catch (RemoteException lRE) {
        LOGGER.log(Level.SEVERE, "Master: Problem with contacting the RMI Registry: ", lRE);
        System.exit(-1);
    } catch (IOException lE) {
        LOGGER.log(Level.SEVERE, "Master: Problem with starting up TestMaster: ", lE);
        System.exit(-1);
    }
}

From source file:com.collabnet.ccf.pi.sfee.v44.SFEEAppHandler.java

private void addComments(List<ArtifactSoapDO> artifactHistory, ArtifactSoapDO artifact, Date lastModifiedDate,
        String connectorUser, String resyncUser) {
    try {/*from   ww  w. j  a  v  a  2 s  . c  o m*/
        CommentSoapList commentList = mSfSoap.getCommentList(mSessionId, artifact.getId());
        CommentSoapRow[] comments = commentList.getDataRows();
        if (comments != null) {
            for (CommentSoapRow comment : comments) {
                String createdBy = comment.getCreatedBy();
                Date createdDate = comment.getDateCreated();
                if (createdBy.equals(connectorUser) || createdBy.equals(resyncUser)) {
                    continue;
                }
                if (lastModifiedDate.after(createdDate) || lastModifiedDate.equals(createdDate)) {
                    continue;
                }
                String description = comment.getDescription();
                description = "\nOriginal commenter: " + createdBy + "\n" + description;
                boolean commentSet = false;
                for (ArtifactSoapDO artifactDO : artifactHistory) {
                    // TODO If nothing is matching what will happen?
                    // if(artifactDO.getLastModifiedDate().after(createdDate)
                    // ||
                    // artifactDO.getLastModifiedDate().equals(createdDate)){
                    // TODO If more than one comment is added, How this will
                    // behave?
                    this.addComment(ArtifactMetaData.SFEEFields.commentText.getFieldName(), artifactDO,
                            description);
                    commentSet = true;
                    break;
                    // }
                }
                if (!commentSet) {
                    log.error("Comment " + description + " Could not be set " + createdDate);
                }
            }
        }
    } catch (RemoteException e) {
        log.error("Could not get comments list for artifact " + artifact.getId() + ": " + e.getMessage());
    }
}

From source file:com.collabnet.ccf.teamforge.TFConnectionFactory.java

/**
 * Connection Factory implementation for the TF adaptor. 1. connectionInfo -
 * contains the server URL. 2. credentialInfo - contains the user name and
 * password delimited by ':'/*from ww  w  .  ja  v  a  2  s .  c  om*/
 * 
 * The Repository ID contains the TF tracker ID
 */
public Connection createConnection(String systemId, String systemKind, String repositoryId,
        String repositoryKind, String connectionInfo, String credentialInfo,
        ConnectionManager<Connection> connectionManager) throws ConnectionException {
    if (StringUtils.isEmpty(repositoryId)) {
        throw new IllegalArgumentException("Repository Id cannot be null");
    }

    String username = null;
    String password = null;
    if (credentialInfo != null) {
        String[] splitCredentials = credentialInfo.split(PARAM_DELIMITER);
        if (splitCredentials != null) {
            if (splitCredentials.length == 1) {
                username = splitCredentials[0];
                password = "";
            } else if (splitCredentials.length == 2) {
                username = splitCredentials[0];
                password = splitCredentials[1];
            } else {
                throw new IllegalArgumentException("Credentials info is not valid.");
            }
        }
    }
    Connection connection = null;

    try {
        String key = systemId + systemKind + repositoryId + repositoryKind + connectionInfo + credentialInfo;
        // we want to make sure that we always get a new connection here since we do connection management on our own
        /*
         * connection = Connection.getConnection(connectionInfo, username,
         * password, null, key, Long.toString(System.currentTimeMillis()),
         * false);
         */
        //Added new implementation to get connection as getConnection() is deprecated with new api.
        connection = Connection.builder(connectionInfo).userNamePassword(username, password)
                .httpAuth(key, Long.toString(System.currentTimeMillis())).proxy(null)
                .soapTimeout(getSoapTimeout()).validateBeforeBuild(false).build();
        connection.login();
    } catch (RemoteException e) {
        String cause = "While trying to login into TF " + connectionInfo + " an exception occured: "
                + e.getMessage();
        log.error(cause, e);
        throw new ConnectionException(cause, e);
    }
    return connection;
}