Package java.lang.reflect

Examples of java.lang.reflect.InvocationTargetException


            Constructor constructor = localInitialContext.getConstructor(Hashtable.class, LocalInitialContextFactory.class);
            context = (Context) constructor.newInstance(env, this);
        } catch (Throwable e) {
            if (e instanceof InvocationTargetException) {
                InvocationTargetException ite = (InvocationTargetException) e;
                if (ite.getTargetException() != null){
                    e = ite.getTargetException();
                }
            }

            if (e instanceof NamingException){
                throw (NamingException) e;
View Full Code Here


        }
    catch(Throwable t)
    {
            if( t instanceof InvocationTargetException)
            {
                InvocationTargetException ite = (InvocationTargetException) t;
                Throwable wrappedThrowable = ite.getTargetException();
                if( wrappedThrowable instanceof StandardException)
                    throw (StandardException) wrappedThrowable;
            }
      throw StandardException.unexpectedUserException(t);
    }
View Full Code Here

        }
    }

    public int getExceptionMutableInt() throws InvocationTargetException {
        if (this.exceptionMutableInt == -1) {
            throw new InvocationTargetException(new Exception("Thrown when -1"));
        }
        if (this.exceptionMutableInt == -2) {
            throw new InvocationTargetException(new Error("Thrown when -2"));
        }
        if (exceptionMutableInt == -3) {
            throw new InvocationTargetException(new Throwable("Thrown when -3"));
        }
        return this.exceptionMutableInt;
    }
View Full Code Here

    public static String getErrorMessage(Throwable t) {
        if (t == null) {
            return "";
        }
        if (t instanceof InvocationTargetException) {
            InvocationTargetException ex = (InvocationTargetException) t;
            t = ex.getTargetException();
        }
        String errMsg = t instanceof RuntimeException ? t.getMessage() : t.toString();
        if (errMsg == null || errMsg.length() == 0 || "null".equals(errMsg)) {
            errMsg = t.getClass().getName() + " at " + t.getStackTrace()[0].toString();
        }
View Full Code Here

        IRunnableWithProgress op = new IRunnableWithProgress() {
            public void run(IProgressMonitor monitor) throws InvocationTargetException {
                try {
                    doFinish(file, orgName, moduleName, status, monitor);
                } catch (CoreException e) {
                    throw new InvocationTargetException(e);
                } finally {
                    monitor.done();
                }
            }
        };
View Full Code Here

        try {
            ret = method.invoke(targetObject, octx.getMessageObjects());
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new InvocationTargetException(e);
        }
        octx.setReturn(ret);
    }
View Full Code Here

            // handleCallback(msg, currentConversationID);
            // dispatch the wire down the chain and get the response
            Message resp = headInvoker.invoke(msg);
            Object body = resp.getBody();
            if (resp.isFault()) {
                throw new InvocationTargetException((Throwable)body);
            }
            return body;
        } catch (InvocationTargetException e) {
            throw e;
        } catch (Throwable e) {
View Full Code Here

    public Object doTheWork(Object[] args) throws InvocationTargetException {
        Element response = null;
       
        if(! (operation.getInterface() instanceof WSDLInterface)) {
            throw new InvocationTargetException(null,"Unsupported service contract");
        }
       
        org.apache.ode.bpel.iapi.MyRoleMessageExchange mex = null;
        Future onhold = null;
       
        //Process the BPEL process invocation
        try {
            txMgr.begin();
            mex = odeServer.getBpelServer().getEngine().createMessageExchange(new GUID().toString(),
                                                                              bpelServiceName,
                                                                              bpelOperationName);
            onhold = mex.invoke(createInvocationMessage(mex, args));
           
            txMgr.commit();
        } catch (Exception e) {
            try {
                txMgr.rollback();
            } catch (SystemException se) {

            }
            throw new InvocationTargetException(e, "Error invoking BPEL process : " + e.getMessage());
        }


        // Waiting until the reply is ready in case the engine needs to continue in a different thread
        if (onhold != null) {
            try {
                onhold.get();
            } catch (Exception e) {
                throw new InvocationTargetException(e,"Error invoking BPEL process : " + e.getMessage());
            }
        }

        //Process the BPEL invocation response
        try {
            txMgr.begin();
            // Reloading the mex in the current transaction, otherwise we can't
            // be sure we have the "freshest" one.
            mex = (MyRoleMessageExchange)odeServer.getBpelServer().getEngine().getMessageExchange(mex.getMessageExchangeId());

            Status status = mex.getStatus();
            System.out.println("Status: " + status.name());
            Element invocationResponse = mex.getResponse().getMessage();
            System.out.println("Response: " + DOMUtils.domToString(invocationResponse));
           
            //process the method invocation result
            response = processResponse(invocationResponse);
           
            txMgr.commit();
            // end of transaction two
        } catch (Exception e) {
            try {
                txMgr.rollback();
            } catch (SystemException se) {

            }
            throw new InvocationTargetException(e, "Error retrieving BPEL process invocation status : " + e
                .getMessage());
        }
   
   
        return response;
View Full Code Here

            } finally {
                session.close();
            }
        } catch (JMSException e) {
            throw new InvocationTargetException(e);
        } catch (NamingException e) {
            throw new InvocationTargetException(e);
        }
    }
View Full Code Here

    }

    public void setExceptionMutableInt(int exceptionMutableInt) throws InvocationTargetException {
        this.exceptionMutableInt = exceptionMutableInt;
        if (exceptionMutableInt == -1) {
            throw new InvocationTargetException(new Exception("Thrown when -1"));
        }
        if (exceptionMutableInt == -2) {
            throw new InvocationTargetException(new Error("Thrown when -2"));
        }
        if (exceptionMutableInt == -3) {
            throw new InvocationTargetException(new Throwable("Thrown when -3"));
        }
    }
View Full Code Here

TOP

Related Classes of java.lang.reflect.InvocationTargetException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.