Package org.jboss.soa.esb

Examples of org.jboss.soa.esb.ConfigurationException


        super.setActionConfig(actionConfig);

        endpointName = actionConfig.getProperties().getProperty(WebServiceUtils.JBOSSWS_ENDPOINT);
        contextName = actionConfig.getProperties().getProperty(WebServiceUtils.JBOSSWS_CONTEXT);
        if(endpointName == null) {
            throw new ConfigurationException("Property '" + WebServiceUtils.JBOSSWS_ENDPOINT + "' not specified.");
        }
    }
View Full Code Here


        listenerNode.setAttribute("name", listener.getName());

    try {
      bus = (JmsBus) model.getBus(listener.getBusidref());
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <jms-listener> must reference a <jms-bus>.");
    }
    try {
      provider = (JmsProviderType) model.getProvider(bus);
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <jms-provider> instance.  Unexpected exception - this should have caused a validation error!");
    }

    JmsMessageFilter messageFilter = listener.getJmsMessageFilter();
    if(messageFilter == null) {
      messageFilter = bus.getJmsMessageFilter();
      if(messageFilter == null) {
        throw new ConfigurationException("No <jms-detination> defined on either <jms-listener> [" + listener.getName() + "] or <jms-bus> [" + bus.getBusid() + "].");
      }
    }

    final Class<?> gatewayClass ;
    if (provider instanceof JmsJcaProvider) {
View Full Code Here

        {
            activationMapper.setDestinationType(activationConfigValues, false) ;
        }
        else
        {
            throw new ConfigurationException("Unknown destination type: " + messageFilter.getDestType()) ;
        }

        activationMapper.setMessageSelector(activationConfigValues, messageFilter.getSelector()) ;
        final Integer maxThreads = (listener.isSetMaxThreads() ? Integer.valueOf(listener.getMaxThreads()) : null) ;
        activationMapper.setMaxThreads(activationConfigValues, maxThreads) ;
       
        final Element activationConfigElement = YADOMUtil.addElement(listenerNode, JcaConstants.ELEMENT_ACTIVATION_CONFIG) ;
        for(Map.Entry<String, String> entry: activationConfigValues.entrySet())
        {
            addPropertyElement(activationConfigElement, entry.getKey(), entry.getValue()) ;
        }

    final Set<String> defaultPropertyNames = activationConfigValues.keySet() ;
    log.debug("Default activation-config properties :" + defaultPropertyNames );

    /*
     *   add user activation-config properties specified in the provider element.
     */
        ActivationConfig activationConfig = jmsJcaProvider.getActivationConfig();
        if ( activationConfig != null )
        {
            List<Property> propertyList = activationConfig.getPropertyList();
            for (Iterator<Property> iterator = propertyList.iterator(); iterator.hasNext();)
        {
          Property prop = iterator.next();
          if ( defaultPropertyNames.contains( prop.getName() ))
              throw new ConfigurationException( "activation-config already contains [" + prop.getName() + "], which cannot be overridden");

                addPropertyElement(activationConfigElement, prop.getName(), prop.getValue()) ;
        }
        }
    }
View Full Code Here

        throws ConfigurationException
    {
        final String activationMapper = getActivationMapperClass(listener, bus, jmsJcaProvider); ;
        if (activationMapper == null)
        {
            throw new ConfigurationException("Could not locate ActivationMapper for adapter " + jmsJcaProvider.getAdapter()) ;
        }
        final Class activationMapperClass ;
        try
        {
            activationMapperClass = ClassUtil.forName(activationMapper.trim(), JmsListenerMapper.class) ;
        }
        catch (final ClassNotFoundException cnfe)
        {
            throw new ConfigurationException("Could not locate activation mapper class " + activationMapper, cnfe) ;
        }
       
        if (!ActivationMapper.class.isAssignableFrom(activationMapperClass))
        {
            throw new ConfigurationException("Activation mapper class " + activationMapper + " does not implement ActivationMapper interface") ;
        }
        try
        {
            return (ActivationMapper)(activationMapperClass.newInstance()) ;
        }
        catch (final Throwable th)
        {
            throw new ConfigurationException("Failed to instantiate activation mapper class " + activationMapper, th) ;
        }
    }
View Full Code Here

       
        final PropertyManager propertyManager = ModulePropertyManager.getPropertyManager(ModulePropertyManager.JCA_MODULE);
        final String activationMapper = propertyManager.getProperty("org.jboss.soa.esb.jca.activation.mapper." + adapter) ;
        if (activationMapper == null)
        {
            throw new ConfigurationException("Could not locate activation mapper for adapter " + adapter) ;
        }
        return activationMapper ;
    }
View Full Code Here

        listenerNode.setAttribute("name", listener.getName());

    try {
      bus = (FtpBus) model.getBus(listener.getBusidref());
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <ftp-listener> must reference a <ftp-bus>.");
    }
    try {
      provider = (FtpProvider) model.getProvider(bus);
    } catch (ClassCastException e) {
      throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <ftp-provider> instance.  Unexpected exception - this should have caused a validation error!");
    }

    FtpMessageFilter messageFilter = listener.getFtpMessageFilter();
    if(messageFilter == null) {
      messageFilter = bus.getFtpMessageFilter();
      if(messageFilter == null) {
        throw new ConfigurationException("No <ftp-detination> defined on either <ftp-listener> [" + listener.getName() + "] or <ftp-bus> [" + bus.getBusid() + "].");
      }
    }
    // Map the standard listener attributes - common across all listener types...
    MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
    // Map the <property> elements targeted at the listener - from the listener itself.
View Full Code Here

        {
          port = Integer.parseInt(origHostname.substring(portLocation)) ;
        }
        catch (final NumberFormatException nfe)
        {
          throw new ConfigurationException("Failed to parse port value") ;
        }
      }
      else
      {
        port = -1 ;
      }
    }
    else
    {
      hostname = origHostname ;
      port = -1 ;
    }
    final URI uri ;
    try
    {
      uri = new URI(messageFilter.getProtocol().toString(),
        userInfo, hostname, port, inputDir, null, null) ;
    }
    catch (final URISyntaxException urise)
    {
      throw new ConfigurationException("Unexpected exception creating FTP URI, " + urise.getMessage()) ;
    }
    toElement.setAttribute(ListenerTagNames.URL_TAG, uri.toASCIIString());
    toElement.setAttribute(FTPEpr.INPUT_SUFFIX_TAG, messageFilter.getInputSuffix());
    toElement.setAttribute(FTPEpr.WORK_SUFFIX_TAG, messageFilter.getWorkSuffix());
    toElement.setAttribute(FTPEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
View Full Code Here

            try {
                instance = newComposerInstance(ClassUtil.forName(className, Factory.class));
            } catch (ClassCastException e) {
                if (legacyAdapterType == null) {
                    throw new ConfigurationException("Composer class [" + className + "] not an instance of '" + MessageComposer.class.getName() + "' and no " + LegacyMessageComposerAdapter.class.getSimpleName() + " specified.", e);
                } else if (LegacyMessageComposerAdapter.class.isAssignableFrom(legacyAdapterType)) {
                    instance = newComposerInstance(legacyAdapterType);
                } else {
                    throw new ConfigurationException("Legacy composer adapter class [" + legacyAdapterType.getName() + "] not an instance of '" + LegacyMessageComposerAdapter.class.getName() + "'.");
                }
            } catch (ClassNotFoundException e) {
                throw new ConfigurationException("Composer class [" + className + "] not found in classpath.", e);
            }

            instance.setConfiguration(config);
            return instance;
        }
View Full Code Here

        private static MessageComposer newComposerInstance(Class composerClass) throws ConfigurationException {
            try {
                return (MessageComposer) composerClass.newInstance();
            } catch (InstantiationException e) {
                if(composerClass.getEnclosingClass() != null) {
                    throw new ConfigurationException("Failed to instantiate composer class [" + composerClass.getName() + "].  This may be because it is not a top level class.", e);
                } else {
                    throw new ConfigurationException("Failed to instantiate composer class [" + composerClass.getName() + "].", e);
                }
            } catch (IllegalAccessException e) {
                throw new ConfigurationException("Failed to instantiate composer class [" + composerClass.getName() + "].", e);
            }
        }
View Full Code Here

         * Is the input suffix valid for this type of gateway?
         */

    protected void checkInputSuffix() throws ConfigurationException {
        if (_inputSuffix.length() < 1)
            throw new ConfigurationException("Invalid "
                    + ListenerTagNames.FILE_INPUT_SFX_TAG + " attribute");
    }
View Full Code Here

TOP

Related Classes of org.jboss.soa.esb.ConfigurationException

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.