Examples of MessageDeliverException


Examples of org.jboss.soa.esb.listeners.message.MessageDeliverException

   
                          if (("true".equals(message.getProperties().getProperty(Environment.EXCEPTION_ON_DELIVERY_FAILURE, "false")) || exceptionOnDeliveryFailure)) {
                              if (timeout) {
                                  throw new ResponseTimeoutException("No response received for service [" + service + "], Told not to retry.") ;
                              } else {
                                  throw new MessageDeliverException("Failed to deliver message ["+message.getHeader()+"] to Service [" + service + "].  Told not to retry.");
                              }
                            }
                      }
                  }
                  catch (MalformedEPRException ex// so we can differentiate failure modes, since returning null is limiting
                  {
                    logger.debug("Invalid EPR for service (probably ESB-unaware): ignoring for message: "+message.getHeader());
   
                    serviceClusterInfo.removeDeadEPR(epr);
   
                    /*
                     * DO NOT remove from the registry - it is not dead!!
                     */
                  }
   
                }
            }
        } finally {
            message.getContext().removeContext(SecurityService.CONTEXT);
            message.getContext().removeContext(SecurityService.AUTH_REQUEST);
        }

        // Throw exception if delivery failed...
        if (timeout) {
            throw new ResponseTimeoutException("No response received for service [" + service + "].") ;
        } else {
            throw new MessageDeliverException("Failed to deliver message ["+message.getHeader()+"] to Service [" + service + "].  Check for errors.");
        }
    }
View Full Code Here

Examples of org.jboss.soa.esb.listeners.message.MessageDeliverException

                }
            }
        } catch (ServiceNotFoundException snfe) {
            logger.info("Service: " + service + " not found in the registry");
        } catch (RegistryException e) {
            throw new MessageDeliverException(e.getMessage(), e);
        }
        serviceClusterInfo = new ServiceClusterInfoImpl(service.getName(), serviceEprs);
        expirationDate = new Date(java.lang.System.currentTimeMillis() + registryCacheLife);
    }
View Full Code Here

Examples of org.jboss.soa.esb.listeners.message.MessageDeliverException

            * associated with the transaction.
            */

            if (transactional && !isActive)
            {
                throw new MessageDeliverException("Associated transaction is no longer active!");
            }
        }
        catch (final TransactionStrategyException ex)
        {
            throw new MessageDeliverException("Could not determine transactionality.", ex);
        }
       
        return transactional;
    }
View Full Code Here

Examples of org.jboss.soa.esb.listeners.message.MessageDeliverException

                    // could be stale EPR, so move on to next entry in registry.
                } catch (final CourierMarshalUnmarshalException e) {
                    logger.warn("Courier indicated (un)marshal related error "+e+" during delivery to EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"]. " + e.getMessage());

                    throw new MessageDeliverException("Caught (un)marshal related exception during attempted send/receive.", e);
                } catch (final CourierTransportException e) {
                    // meant to be masked by the SI fail-over

                    if (logger.isDebugEnabled()) {
                        logger.debug("Courier indicated transport related error "+e+" during send/receive with EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"]. ", e);
                    }
                } catch (CourierException e) {
                    // probable config error. Log it and move on to next EPR/service entry.

                    logger.warn("Possible configuration error while using Courier for EPR [" + targetEPR + "] and Service [" + service + "] and Message ["+message.getHeader()+"]. " + e.getMessage());
                } catch (MalformedEPRException e) {
                    // Hmmmm???... Can this really happen?  The Courier has already been created.  Haven't we already validated the EPR during the Courier lookup (above)??
                    logger.error("Unexpected error.  Badly formed EPR [" + targetEPR + "] for Service [" + service + "]. But the EPR has already been validated!!");

                    throw e;
                } catch (final CourierTimeoutException ex) {
                    logger.error("Response timeout using Courier for EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"].");

                    // timeout from synchronous invocation
                   
                    // would like to make this an independent exception (not inherit from MDE). But signatures and applications would break.
                   
                    throw new ResponseTimeoutException("Caught response timeout!", ex);
                } catch (final MessageDeliverException mde) {
                    throw mde ;
                } catch (Throwable t) {
                    logger.error("Unexpected throwable during attempted message delivery using Courier for EPR [" + targetEPR + "] for Service [" + service + "] and Message ["+message.getHeader()+"].", t);

                    // we don't know what state we're in so better to bail-out now!

                    throw new MessageDeliverException("Caught unexpected throwable during send. Bailing-out!", t);
                } finally {
                    CourierUtil.cleanCourier(courier);

                    // put back the old To since we will have changed it.
View Full Code Here

Examples of org.jboss.soa.esb.listeners.message.MessageDeliverException

    byte[] bodyBytes = null;

        try {
      bodyBytes = StreamUtils.readStream(request.getInputStream());
    } catch (IOException e) {
      throw new MessageDeliverException("Failed to read body data from http request", e);
    }

        String characterEncoding = request.getCharacterEncoding();
        Charset charset;
        if(characterEncoding == null) {
            charset = Charset.defaultCharset();
        } else {
            charset = Charset.forName(characterEncoding);
        }

        if(payloadAs == null) {
            String contentType = request.getContentType();

            if(contentType != null && HttpContentTypeUtil.isTextMimetype(contentType)) {
                try {
                    String payload = new String(bodyBytes, charset.name());

                    payloadProxy.setPayload(message, payload);

                    // In case it's a SOAP message, we need to check for WS-S info...
                    AuthenticationRequest authRequest = null;
                    try {
                      authRequest = ExtractorUtil.extract(payload, extractors);
                    } catch (final ExtractionException e) {
                        throw new MessageDeliverException(e.getMessage(), e);
                    }
                   
                    if(authRequest != null) {
                        PublicCryptoUtil.INSTANCE.addAuthRequestToMessage(authRequest, message);
                    }
                } catch (UnsupportedEncodingException e) {
                    throw new MessageDeliverException("Invalid Character encoding '" + characterEncoding + "' set on request.", e);
                }
            } else {
                payloadProxy.setPayload(message, bodyBytes);
            }
        } else if(payloadAs.equals("STRING")) {
            try {
                payloadProxy.setPayload(message, new String(bodyBytes, charset.name()));
            } catch (UnsupportedEncodingException e) {
                throw new MessageDeliverException("Invalid Character encoding '" + characterEncoding + "' set on request.", e);
            }
        } else {
            payloadProxy.setPayload(message, bodyBytes);
        }
View Full Code Here

Examples of org.jboss.soa.esb.listeners.message.MessageDeliverException

            if(outBytes.length > 0) {
                response.getOutputStream().write(outBytes);
            }
        } catch (IOException e) {
      throw new MessageDeliverException("Unexpected error when write the message to http response", e);
    }

        return null;
  }
View Full Code Here

Examples of org.jboss.soa.esb.listeners.message.MessageDeliverException

            sendEmail(configTree, payloadBytes);
        }
        catch (final AddressException e)
        {
            log.error("Send Mail Failed", e);
            throw new MessageDeliverException("AddressException while trying to send email", e);
        }
        catch (final MessagingException e)
        {
            throw new MessageDeliverException("MessageingException while trying to send email", e);
        }
        catch (final IOException e)
        {
            log.error("Send Mail Failed", e);
            throw new MessageDeliverException("IOException while trying to send email", e);
        }
    }
View Full Code Here

Examples of org.jboss.soa.esb.listeners.message.MessageDeliverException

                    {
                        authRequest = ExtractorUtil.extract((String)payload, extractors);
                    }
                    catch (ExtractionException e)
                    {
                      throw new MessageDeliverException(e.getMessage(), e);
                    }
                }
               
                try {
                  ExtractorUtil.addAuthRequestToMessage(authRequest, message);
                } catch (final SecurityServiceException e) {
                    throw new MessageDeliverException(e.getMessage(), e);
                }


                // Purposely not iterating over the Map.Entry Set because there's
                // a bug in the Map impl used by JBossRemoting.  Not all the
View Full Code Here

Examples of org.jboss.soa.esb.listeners.message.MessageDeliverException

            {
                return result.getBytes(charset) ;
            }
            catch (final UnsupportedEncodingException uee)
            {
                throw new MessageDeliverException("Unsupported encoding: " + charset, uee) ;
            }
        }
        else
        {
            return payload ;
View Full Code Here

Examples of org.jboss.soa.esb.listeners.message.MessageDeliverException

        } else if(nullGetPayloadHandling == NullPayloadHandling.LOG) {
            logger.info("Null data found in message location(s): " + getPayloadLocations);
        } else if(nullGetPayloadHandling == NullPayloadHandling.WARN) {
            logger.warn("Null data found in message location(s): " + getPayloadLocations);
        } else if(nullGetPayloadHandling == NullPayloadHandling.EXCEPTION) {
            throw new MessageDeliverException("Null data found in message location(s): " + getPayloadLocations);
        }
       
        return null;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.