Example usage for org.springframework.remoting RemoteInvocationFailureException getCause

List of usage examples for org.springframework.remoting RemoteInvocationFailureException getCause

Introduction

In this page you can find the example usage for org.springframework.remoting RemoteInvocationFailureException getCause.

Prototype

public synchronized Throwable getCause() 

Source Link

Document

Returns the cause of this throwable or null if the cause is nonexistent or unknown.

Usage

From source file:test.annotated.splitaggregate.AnnotationTest.java

public static void main(String[] args) {

    // Test Job//  w  w w .  ja  v  a 2 s . co m
    AnnotatedSATestJob annoatedJob = new AnnotatedSATestJob();

    try {

        GridNode node = Grid.startLightGridNode();

        log.info("GridNode ID : " + node.getId());

        // Submit Job
        log.debug("Submitting Job");

        GridJobFuture future = node.getJobSubmissionService().submitJob(annoatedJob);
        try {
            log.info("Job Result : " + future.getResult());
        } catch (RemoteInvocationFailureException e) {
            e.getCause().printStackTrace();
        }

        node.getNodeRegistrationService().unregister();

        log.info("Unregistered, Terminating...");

    } catch (Exception e) {
        e.printStackTrace();
    }
    System.exit(0);
}

From source file:test.node.TestNodeNARRunner.java

public static void main(String[] args) {
    try {/*w w w.jav a  2  s .  c  om*/

        log.info("GridNode Starting...");
        StopWatch sw = new StopWatch();
        sw.start();

        GridNode node = Grid.startGridNode();

        log.info("GridNode ID : " + node.getId());

        sw.stop();

        log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis() + " ms]");

        // Submit Job
        log.debug("Reading NAR");

        sw.start();

        GridArchive archive;
        archive = GridArchive.fromFile(new File("simpletestjob.nar"));

        log.debug("Submitting NAR");

        GridJobFuture future = (GridJobFuture) node.getJobSubmissionService().submitArchive(archive).values()
                .toArray()[0];

        try {
            log.info("RESULT : " + future.getResult());
        } catch (RemoteInvocationFailureException e) {
            e.getCause().printStackTrace();
        }

        sw.stop();
        log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis() + " ms");

        log.debug("Press any key to unregister GridNode and terminate");
        System.in.read();
        node.getNodeRegistrationService().unregister();

        log.info("Unregistered, Terminating...");
        System.exit(0);

    } catch (GridArchiveException e) {
        log.fatal("GridArchiveException", e);
    } catch (GridExecutionException e) {
        log.fatal("Execution Failed", e);
    } catch (IOException e) {
        log.error("IOException", e);
    }

}

From source file:test.node.TestNodeRunner.java

public static void main(String[] args) {

    // Test Job/*from   ww w .  ja  va 2  s . com*/
    TestJob testJob = new TestJob();

    try {

        log.info("GridNode Starting...");
        StopWatch sw = new StopWatch();
        sw.start();

        GridNode node = Grid.startGridNode();

        log.info("GridNode ID : " + node.getId());

        sw.stop();

        log.info("GridNode Started Up. [" + sw.getLastTaskTimeMillis() + " ms]");

        // Submit Job
        log.debug("Submitting Job");

        sw.start();

        GridJobFuture future = node.getJobSubmissionService().submitJob(testJob, new ResultCallback() {

            public void onResult(Serializable result) {
                System.err.println(result);
            }

        });
        try {
            log.info("Job Result : " + future.getResult());
        } catch (RemoteInvocationFailureException e) {
            e.getCause().printStackTrace();
        }

        sw.stop();
        log.info("GridJob Finished. Duration " + sw.getLastTaskTimeMillis() + " ms");

        log.debug("Press any key to unregister GridNode and terminate");
        System.in.read();
        node.getNodeRegistrationService().unregister();

        log.info("Unregistered, Terminating...");
        System.exit(0);

    } catch (IOException e) {
        e.printStackTrace();
    } catch (Exception e) {
        e.printStackTrace();
    }

}

From source file:de.juwimm.cms.util.Communication.java

public void removeDocument(int documentId) throws Exception {
    try {//from w w w  .  j av a  2 s . com
        getClientService().removeDocument(Integer.valueOf(documentId));
    } catch (RemoteInvocationFailureException e) {
        throw (Exception) e.getCause();
    }
}

From source file:de.juwimm.cms.util.Communication.java

public void removePicture(int pictureId) throws Exception {
    try {//  www  . j a  v  a  2 s . c o m
        getClientService().removePicture(Integer.valueOf(pictureId));
    } catch (RemoteInvocationFailureException e) {
        throw (Exception) e.getCause();
    }
}

From source file:de.juwimm.cms.util.Communication.java

public void removeResources(Integer[] pictureIds, Integer[] documentIds, boolean forceDeleteHistory)
        throws Exception {
    try {//from   w  w w .j a v a2s .  c  o m
        getClientService().removeResources(pictureIds, documentIds, forceDeleteHistory);
    } catch (RemoteInvocationFailureException ex) {
        throw (Exception) ex.getCause();
    }
}