Package flex.messaging

Examples of flex.messaging.MessageException


            //TODO: QUESTION: Pete Support default soap endpoints?
            //String url = settings.getParsedDefaultUrl(contextPath);
            //message.setUrl(url);
           
            // FIXME: Need a better error here!
            throw new MessageException("A SOAP endpoint was not provided.");
        }

        return adapter.invoke(message);
    }
View Full Code Here


        }
        catch (Throwable t)
        {
            // this should never happen- ErrorFilter should catch everything
            t.printStackTrace();
            throw new MessageException(t.toString());
        }
    }
View Full Code Here

        }
        catch (Throwable t)
        {
            // this should never happen- ErrorFilter should catch everything
            t.printStackTrace();
            throw new MessageException(t.toString());
        }
    }
View Full Code Here

        {
            throw ex;
        }
        catch (Throwable ex)
        {
            throw new MessageException(ex);
        }
        finally
        {
            try
            {
View Full Code Here

   
    ServletRequestInfo info = getServletRequestInfo();
    if (info.currentJsonRequest == null)
    {
      ServletOutputStream servletOutputStream = info.getOutputStream();
      ErrorMessage errorMessage = new ErrorMessage(new MessageException(message));
      errorMessage.faultCode = exception.getClass().getSimpleName();
      serializeCompressedAmf3(errorMessage, servletOutputStream);
    }
    else
    {
View Full Code Here

            // Lookup and invoke.
            Object instance = createInstance(factoryInstance.getInstanceClass());
            if (instance == null)
            {
                MessageException me = new MessageException("Null instance returned from: " + factoryInstance);
                me.setCode("Server.Processing");
                throw me;
            }
            Class c = instance.getClass();

            MethodMatcher methodMatcher = remotingDestination.getMethodMatcher();
            Method method = methodMatcher.getMethod(c, methodName, parameters);
            result = method.invoke(instance, parameters.toArray());

            saveInstance(instance);
        }
        catch (InvocationTargetException ex)
        {
            /*
             * If the invocation exception wraps a message exception, unwrap it and
             * rethrow the nested message exception. Otherwise, build and throw a new
             * message exception.
             */
            Throwable cause = ex.getCause();
            if ((cause != null) && (cause instanceof MessageException))
            {
                throw (MessageException) cause;
            }
            else if (cause != null)
            {
                // Log a warning for this client's selector and continue
                if (Log.isError())
                {
                    Log.getLogger(LOG_CATEGORY).error("Error processing remote invocation: " +
                         cause.toString() + StringUtils.NEWLINE +
                         "  incomingMessage: " + message + StringUtils.NEWLINE +
                         ExceptionUtil.toString(cause));
                }
                MessageException me = new MessageException(cause.getClass().getName() + " : " + cause.getMessage());
                me.setCode("Server.Processing");
                me.setRootCause(cause);
                throw me;
            }
            else
            {
                MessageException me = new MessageException(ex.getMessage());
                me.setCode("Server.Processing");
                throw me;
            }
        }
        catch (IllegalAccessException ex)
        {
            MessageException me = new MessageException(ex.getMessage());
            me.setCode("Server.Processing");
            throw me;
        }

        return result;
    }
View Full Code Here

                        // Record a faulted invocation and its processing duration.
                        // Cast to an int is safe because no remoting invocation will have a longer duration in millis than Integer.MAX_VALUE.
                        destinationControl.incrementInvocationFaultCount((int)(System.currentTimeMillis() - startTime));
                    }
                   
                    throw new MessageException(t);
                }
            }
            else
            {
                // Destination '{id}' is not registered on the Remoting Service.
View Full Code Here

        MessageBroker broker = MessageBroker.getMessageBroker(serverId);

        if (broker == null)
        {
            // Unable to locate a MessageBroker initialized with server id ''{0}''
            MessageException me = new MessageException();
            me.setMessage(NO_MESSAGE_BROKER, new Object[] { serverId });
            throw me;
        }

        RemotingService rs = (RemotingService) broker.getServiceByType(REMOTING_SERVICE_CLASS);
        if (rs == null)
        {
            // MessageBroker with server id ''{0}'' does not contain a service with class flex.messaging.remoting.RemotingService
            MessageException me = new MessageException();
            me.setMessage(NO_REMOTING_SERVICE, new Object[] { serverId });
            throw me;
        }

        return (RemotingDestination) rs.getDestination(destinationName);
    }
View Full Code Here

        {
            // We can't use writeAMFNull here I think since we already added this object
            // to the object table on the server side.  The player won't have any way
            // of knowing we have this reference mapped to null.
            if (newInst == null)
                throw new MessageException("PropertyProxy.getInstanceToSerialize class: " + pp.getClass() + " returned null for instance class: " + instance.getClass().getName());

            // Grab a new proxy if necessary for the new instance
            pp = PropertyProxyRegistry.getProxyAndRegister(newInst);
            instance = newInst;
        }
View Full Code Here

        int version = amfIn.readUnsignedShort();

        if (version != MessageIOConstants.AMF0 && version != MessageIOConstants.AMF3)
        {
            //Unsupported AMF version {version}.
            MessageException ex = new MessageException();
            ex.setMessage(UNSUPPORTED_AMF_VERSION, new Object[] {new Integer(version)});
            ex.setCode("VersionMismatch");
            throw ex;
        }

        m.setVersion(version);
        context.setVersion(version);
View Full Code Here

TOP

Related Classes of flex.messaging.MessageException

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.