Package org.jboss.soa.esb.actions

Examples of org.jboss.soa.esb.actions.ActionProcessingException


            public void test() throws Exception {
                ServiceInvoker invoker = new ServiceInvoker("ServiceCat", "ServiceName");
                Message message = MessageFactory.getInstance().getMessage();

                message.getBody().add("Hi there!");
                MockAction.exception = new ActionProcessingException("invm_sync_error");
                try {
                    invoker.deliverSync(message, 2000);
                    fail("Expected FaultMessageException.");
                } catch(FaultMessageException e) {
                    assertEquals("org.jboss.soa.esb.actions.ActionProcessingException: invm_sync_error", e.getMessage());
View Full Code Here


           
            return setPayload(message, object);
        }
        catch (final TransformerConfigurationException e)
        {
            throw new ActionProcessingException(e.getMessage(), e);
        }
        catch (SAXException e)
        {
          throw new ActionProcessingException(e.getMessage(), e);
        }
        catch (ParserConfigurationException e)
        {
          throw new ActionProcessingException(e.getMessage(), e);
        }
        catch (TransformerException e)
        {
            throw new ActionProcessingException(e.getMessage(), e);
        }
    }
View Full Code Here

        {
            transformer = transformers.take();
        }
        catch (final InterruptedException e)
        {
            throw new ActionProcessingException(e.getMessage(), e);
        }
       
        try
        {
            transformer.transform(source, result);
        }
        finally
        {
            try
            {
                transformer.reset();
                transformers.put(transformer);
            }
            catch (final InterruptedException e)
            {
                throw new ActionProcessingException(e.getMessage(), e);
            }
        }
    }
View Full Code Here

        {
            return payloadProxy.getPayload(message);
        }
        catch (MessageDeliverException e)
        {
            throw new ActionProcessingException(e.getMessage(), e);
        }
    }
View Full Code Here

        {
            payloadProxy.setPayload(message, payload);
        }
        catch (MessageDeliverException e)
        {
            throw new ActionProcessingException(e.getMessage(), e);
        }
        return message;
    }
View Full Code Here

                logger.info("*******************************");
                logger.info("Removing message to avoid future redeliveries");
                ms.removeMessage(key, MessageStore.CLASSIFICATION_RDLVR);
            }
        } catch (MessageStoreException mse) {
            throw new ActionProcessingException(mse.getMessage(), mse);
        } catch (MessageDeliverException mde) {
            throw new ActionProcessingException(mde.getMessage(), mde);
        }
        return rdlvrMessage;

    }
View Full Code Here

            }
            Service noneExistingService = new Service("none-exising-category", "none-existing-service-name");
            ServiceInvoker si = new ServiceInvoker(noneExistingService);
            si.deliverSync(message, 1000);
        } catch (MessageStoreException mse) {
            throw new ActionProcessingException(mse.getMessage(), mse);
        } catch (MessageDeliverException mde) {
            //Adding this control code to show where the message now is.
            //We should get here on and we should have a message in the DLQ.
            try {
                Map<URI, Message> messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_DLQ);
                while (messageMap.size() == 0) { //we may have to wait for the DLQ Service to act.
                    logger.info("...Waiting for the DLQ Service to act.");
                    try {
                        Thread.sleep(100);
                    } catch (InterruptedException ie) {
                        logger.error(ie);
                    }
                    messageMap = ms.getAllMessages(MessageStore.CLASSIFICATION_DLQ);
                }
                for (URI key : messageMap.keySet()) {
                    dlqMessage = messageMap.get(key);
                    logger.info("*******************************");
                    logger.info("Message in the DLQ queue should be the same message: " + compare(message.getBody(), dlqMessage.getBody()));
                    logger.info("Message=" + message.getBody());
                    logger.info("dlqMessage=" + dlqMessage.getBody());
                    logger.info("*******************************");
                }
            } catch (MessageStoreException mse) {
                throw new ActionProcessingException(mse.getMessage(), mse);
            }
        } catch (RegistryException re) {
            throw new ActionProcessingException(re.getMessage(), re);
        } catch (FaultMessageException fme) {
            throw new ActionProcessingException(fme.getMessage(), fme);
        }
        return dlqMessage;

    }
View Full Code Here

    public void test_async() throws Exception {
        AbstractTestRunner testRunner = new AbstractTestRunner() {
            public void test() throws Exception {
                ServiceInvoker invoker = new ServiceInvoker("ServiceCat", "CallService");
                Message message = MessageFactory.getInstance().getMessage();
                ActionProcessingException exception = new ActionProcessingException("Exception!!!");

                message.getHeader().getCall().setFrom(new LogicalEPR("A", "B"));
                Message faultMessage = Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, exception);

                // Should not get a MessageDeliverException...
View Full Code Here

      logger.error("null binding for element [" + element + "] or operation [" + operation + "] in addition to soapaction [" + soapaction + "]");
    }
    SOAPProxyTransport transport = (binding != null) ? binding_to_transport.get(binding) : null;
    if (transport == null)
    {
      throw new ActionProcessingException("null transport for soapaction [" + soapaction + "], element [" + element + "], operation [" + operation + "], binding [" + binding + "]");
    }
    if ( logger.isDebugEnabled() )
    {
      logger.debug("using transport [" + transport.getClass().getName() + "] with endpoint address: [" + transport.getEndpointAddress() + "] for binding [" + binding + "]");
    }
View Full Code Here

    {
      payload = payloadProxy.getPayload(message);
    }
    catch (MessageDeliverException mde)
    {
      throw new ActionProcessingException(mde);
    }
    InputSource is = null;
    if (payload instanceof byte[])
    {
      byte[] byte_payload = (byte[])payload;
      if (byte_payload.length == 0)
      {
        throw new ActionProcessingException("message contains zero-length byte[] payload");
      }
      is = new InputSource( new ByteArrayInputStream(byte_payload) );
    }
    else if (payload instanceof String)
    {
      String string_payload = (String)payload;
      if (string_payload.length() == 0)
      {
        throw new ActionProcessingException("message contains zero-length String payload");
      }
      is = new InputSource( new StringReader(string_payload) );
    }
    else
    {
      throw new ActionProcessingException( "unsupported payload type: " + payload.getClass().getName() );
    }
    QName element = null;
    ContentHandler ch = new ElementFinder();
    try
    {
      XMLReader xr = XMLReaderFactory.createXMLReader();
      xr.setContentHandler(ch);
      xr.parse(is);
    }
    catch (SAXException saxe)
    {
      throw new ActionProcessingException(saxe);
    }
    catch (IOException ioe)
    {
      throw new ActionProcessingException(ioe);
    }
    catch (ElementFinder.ElementFound ef)
    {
      element = ef.element;
    }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.actions.ActionProcessingException

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.