Package org.jboss.soa.esb.actions

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


      try {
        Class<?> clazz = ClassUtil.forName( className, getClass() );
            xstream.useAttributeFor( (String)me.getKey(), clazz );
      } catch (ClassNotFoundException e) {
        logger.error("ClassNotFoundException: ", e);
        throw new ActionProcessingException("Could not add alias : " + (String)me.getKey() + ", class : " + className ,e );
      }
    }
  }
View Full Code Here


      return XPathUtil.getNodeFromXPathExpression( xml, xPathExpression );
    }
    catch (ParserConfigurationException e)
    {
      logger.error( "ParserConfigurationException:", e );
      throw new ActionProcessingException( e );
    }
    catch (SAXException e)
    {
      logger.error( "SAXException : ", e );
      throw new ActionProcessingException( e );
    }
    catch (IOException e)
    {
      logger.error( "IOException: ", e );
      throw new ActionProcessingException( e );
    }
    catch (XPathExpressionException e)
    {
      logger.error( "XPathExpressionException", e );
      throw new ActionProcessingException( e );
    }
  }
View Full Code Here

        Map beans;
       
        try {
            beans = (Map) payloadProxy.getPayload(message);
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException(e);
        }

        // Set the document data beans on the template and apply it...
        thisTransTemplate.setAttributes(beans);
        try {
            payloadProxy.setPayload(message, thisTransTemplate.toString());
        } catch (MessageDeliverException e) {
            throw new ActionProcessingException(e);
        }

        return message;
    }
View Full Code Here

      final String error = "Exception caught while processing script: '" + source + "'" ;
      if (logger.isDebugEnabled())
      {
        logger.debug(error, bsfe) ;
      }
      throw new ActionProcessingException(error, bsfe);
    }
    finally
    {
      bsf.terminate();
    }
View Full Code Here

      {
        messageScript = payloadProxy.getPayload(message);
      }
      catch (MessageDeliverException mde)
      {
        throw new ActionProcessingException(mde);
      }
      if (messageScript instanceof String)
        return (String)messageScript;
      else if (messageScript instanceof byte[])
        return new String( (byte[])messageScript );
      else
      {
        throw new ActionProcessingException("script not specified in message");
      }
    }
  }
View Full Code Here

            }
        }
        catch (Exception e) {
            logger.error("Error executing Groovy script.", e);
           
            throw new ActionProcessingException("Error executing Groovy script.", e);
    }
  }
View Full Code Here

            if(script == null || !cacheScript) {
                try {
                    String scriptText = GroovyActionProcessor.getScriptFromClasspath(scriptPath);
                    script = constructScriptInstance(scriptText);
                } catch (IOException e) {
                    throw new ActionProcessingException("Error reading script '" + scriptPath + "' stream.");
                }
            }
           
            return script;
        } else {
            // So, the script is being passed in in the message...
            Object messageScript;

            try {
                messageScript = payloadProxy.getPayload(message);
            } catch (MessageDeliverException e) {
                throw new ActionProcessingException(e);
            }

            if(messageScript instanceof String) {
                return constructScriptInstance((String)messageScript);
            } else if(messageScript instanceof byte[]) {
                return constructScriptInstance(new String((byte[])messageScript));
            } else {
                throw new ActionProcessingException("Groovy script not specified in message.");
            }
        }
    }
View Full Code Here

            handleRouting(jmsSession, message) ;
        } catch (final JMSException jmse) {
            try {
                if (jmsSession.getTransacted()) {
                    jmsSession.rollback() ;
                    throw new ActionProcessingException("Unexpected exception routing message", jmse) ;
                } else {
                    // Try to acquire again
                    final JmsSession newJmsSession = getJmsSession() ;
                    try {
                        handleRouting(newJmsSession, message) ;
                    } finally {
                        pool.closeSession(newJmsSession) ;
                    }
                }
            } catch (final JMSException jmse2) {
                throw new ActionProcessingException("Unexpected exception routing message", jmse) ;
            }
        } finally {
            pool.closeSession(jmsSession) ;
        }
    }
View Full Code Here

   
    private void handleRouting(final JmsSession jmsSession, Object message) throws JMSException, ActionProcessingException {
        SESSION.set(jmsSession) ;
        try {
            if(!(message instanceof org.jboss.soa.esb.message.Message)) {
                throw new ActionProcessingException("Cannot send Object [" + message.getClass().getName() + "] to destination [" + destinationName + "]. Object must be an instance of org.jboss.soa.esb.message.Message) .");
            }
       
            final org.jboss.soa.esb.message.Message esbMessage = (org.jboss.soa.esb.message.Message)message;

            try {
                Message jmsMessage = null;
               
                if ( unwrap ) {
                    Object objectFromBody = getPayloadProxy().getPayload(esbMessage);
                    jmsMessage = createJMSMessageWithObjectType( objectFromBody );
                }
                else  {
                    jmsMessage = createObjectMessage(Util.serialize(esbMessage));
                }
               
                setStringProperties(jmsMessage);
                setJMSProperties( esbMessage, jmsMessage );
                setJMSReplyTo( jmsMessage, esbMessage );
                send( jmsMessage );
            } catch (JMSException jmse) {
                throw jmse ;
            } catch(Exception e) {
                final String errorMessage = "Exception while sending message [" + message + "] to destination [" + destinationName + "]." ;
                logger.error(errorMessage);
                throw new ActionProcessingException(errorMessage, e);
            }
        } finally {
            SESSION.set(null) ;
        }
    }
View Full Code Here

    private JmsSession getJmsSession() throws ActionProcessingException {
        try {
            return pool.getSession() ;
        } catch (final ConnectionException ce) {
            throw new ActionProcessingException("Unexpected ConnectionException acquiring JMS session", ce) ;
        } catch (NamingException ne) {
            throw new ActionProcessingException("Unexpected NamingException acquiring JMS session", ne) ;
        } catch (JMSException jmse) {
            throw new ActionProcessingException("Unexpected JMSException acquiring JMS session", jmse) ;
        }
    }
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.