Package org.jboss.soa.esb

Examples of org.jboss.soa.esb.ConfigurationException


    {
      for (int i = 0; i < nrQueuesOrTopics; i++)
      {
                environment = new Properties();
        String sAtt = configTrees[i].getAttribute(ATT_DEST_NAME);
        if (null == sAtt) throw new ConfigurationException("Missing attribute '" + ATT_DEST_NAME);
       
                String jndiURL = configTrees[i].getAttribute(JMSEpr.JNDI_URL_TAG);
                if (jndiURL!=null) environment.setProperty(Context.PROVIDER_URL, jndiURL);
               
                String contextFactory = configTrees[i].getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG);
                if (contextFactory!=null) environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
               
                String prefix = configTrees[i].getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG);
                if (prefix!=null) environment.setProperty(Context.URL_PKG_PREFIXES, prefix);
                List<KeyValuePair> properties=configTrees[i].childPropertyList();
                final String[] jndiPrefixes = JndiUtil.getJndiPrefixes(KeyValuePair.getValue(JMSEpr.JNDI_PREFIXES, properties)) ;
                for (KeyValuePair property : properties) {
                    for(String jndiPrefix: jndiPrefixes) {
                        if (property.getKey().startsWith(jndiPrefix)) {
                            environment.setProperty(property.getKey(), property.getValue());
                            break ;
                        }
                    }
                }
               
                String connectionFactory = configTrees[i].getAttribute(JMSEpr.CONNECTION_FACTORY_TAG, CONNECTION_FACTORY);
               
                connectionPools[i] = JmsConnectionPoolContainer.getPool(environment, connectionFactory);
                sessions[i] = connectionPools[i].getSession() ;
                producers[i] = createProducer( connectionPools[i], sAtt, sessions[i], environment );
               
                final String persistentStr = configTrees[i].getAttribute( PERSISTENT_ATTR, "true" );
                deliveryModes[i] = persistentStr.equalsIgnoreCase( "true" ) ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT;
               
                final String priorityStr = configTrees[i].getAttribute( PRIORITY_ATTR );
                priorities[i] = priorityStr == null ? Message.DEFAULT_PRIORITY : Integer.parseInt( priorityStr );
               
                final String ttlStr = configTrees[i].getAttribute( TIME_TO_LIVE_ATTR );
                timeToLives[i] = ttlStr == null ? Message.DEFAULT_TIME_TO_LIVE : Long.parseLong( ttlStr );
               
        producers[i].setDeliveryMode( deliveryModes[i] );
        producers[i].setPriority( priorities[i] );
        producers[i].setTimeToLive( timeToLives[i] );
      }
    }
    catch (NamingException ex)
    {
      throw new ConfigurationException(ex);
    }
  }
View Full Code Here


            instance = (T) type.newInstance();
    }
    catch (Exception ex)
    {
      _logger.error(ex);
      throw new ConfigurationException(ex);
    }
    return instance;
  }
View Full Code Here

        super(config);
        this.config = config;
        try {
            endpointUrl = new URL(config.getRequiredAttribute("endpointUrl"));
        } catch (MalformedURLException e) {
            throw new ConfigurationException("Invalid endpoint URL '" + config.getRequiredAttribute("endpointUrl") + "'.", e);
        }

        //Overriding to set true by default
        unwrap = config.getAttribute("unwrap", "true").equals("true");
View Full Code Here

      }
    }
    catch( RemoteFileSystemStrategyException e )
    {
      _logger.error( "Could not configure the remoteFileSystemStrategy.", e );
      throw new ConfigurationException(e);
    }
    catch (ClassNotFoundException e)
    {
      _logger.error( "ClassNotFound while trying to create the the remoteFileSystemStrategy.", e );
      throw new ConfigurationException(e);
    }
  }
View Full Code Here

    super(config);
    host = config.getAttribute(SERVER_HOST_TAG);
    try {
         address = InetAddress.getByName(host).getHostAddress();
    }catch (Exception e) {
      throw new ConfigurationException("Invalid host configuration");
    }
    port = config.getAttribute(SERVER_PORT_TAG);
    httpContext = config.getAttribute(REQUEST_CONTEXT_TAG);
    serviceCategory = config.getAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG);
    serviceName = config.getAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG);

    if (config.getAttribute(DISPATCH_SERVLET_CLASS) != null) {
      dispatchServletClassName = config.getAttribute(DISPATCH_SERVLET_CLASS);
    }

        boolean synchronous = !config.getAttribute("synchronous", "true").equalsIgnoreCase("false");
        if (!synchronous) {
      String asyncResponse = config.getAttribute("asyncResponse");
      if (asyncResponse != null) {
        if (ClassUtil.getResourceAsStream(asyncResponse, getClass()) == null) {
          throw new ConfigurationException("Asynchronous response resource file '" + asyncResponse
                  + "' not found on classpath.");
        }
      }
    }

        //validate allow http method configuration
        if (config.getAttribute(ALLOW_HTTP_METHOD) != null) {
          String allowMethods = config.getAttribute(ALLOW_HTTP_METHOD);
          String[] methods = allowMethods.split(",");
          List<String> standardMesthods = new ArrayList<String>();
          standardMesthods.add("GET");
          standardMesthods.add("POST");
          standardMesthods.add("DELETE");
          standardMesthods.add("PUT");
          standardMesthods.add("OPTIONS");
          standardMesthods.add("HEAD");
          standardMesthods.add("TRACE");

          for (String method : methods) {
            if (!standardMesthods.contains(method.toUpperCase())) {
              throw new ConfigurationException("Invalid allow http method configuration, please specify the specify method list with comma-separated(e.g. POST,GET,PUT,DELETE");
            }
          }
        }

    try {
      Set ports = HttpServerDelegate.getInstance().queryObjects("jboss.web:port="+ port+",type=Connector,*");
      if (ports.size() > 0) {
        //When this gateway stared on JBoss default port 8080 or 80, the configured host will be ignored
        Set contexts = HttpServerDelegate.getInstance().queryObjects("jboss.web:host=localhost"  + ",path=" + httpContext + ",*");
          if (contexts.size() > 0) {
          throw new ConfigurationException("There is already an http context named " + httpContext + ", choose another one");
        }
          logger.info("This http gateway listener [" + config.getAttribute(ListenerTagNames.NAME_TAG) "] will be started on JBoss default port " + port + " and the configured host will be ignored.");
        //the created context will be attached jboss.web domain
        useJBossWebServletEngine = true;
      } else {
        //if the port is not the jboss.web used, check if the http context name is duplicate
        Set contexts = HttpServerDelegate.getInstance().queryObjects(HttpServerDelegate.DOMAIN_NAME + ":host=" + HttpServerDelegate.defaultVHost  + ",path=" + httpContext + ",*");
        if (contexts.size() > 0) {
          throw new ConfigurationException("There is already an http context named " + httpContext + ", choose another one");
        }
      }
    } catch (Exception e) {
      throw new ConfigurationException(e);
    }

    //Check the http security configuration
    if (config.getAttribute(AUTH_METHOD) != null) {
      if (config.getAttribute(SECURITY_DOMAIN) == null) {
        throw new ConfigurationException("Security domain configuration for this context not found for http authentication method " + config.getAttribute(AUTH_METHOD));
      }

      if (config.getAttribute(SECURITY_ROLE) == null) {
        throw new ConfigurationException("Security role configuration for this context not found for http authentication method " + config.getAttribute(AUTH_METHOD));
      }
        }
  }
View Full Code Here

    super(config);
    m_config = config;
    m_cfgFile = ListenerUtil.getValue(m_config, HibernateEpr.HIBERNATE_CFG_TAG, null);
   
    if (m_cfgFile == null)
      throw new ConfigurationException("No configuration file specified!");
  }
View Full Code Here

    for (ConfigTree ct : m_config.getChildren(MESSAGE_FILTER)) {
      try {
        String tempEvent = ListenerUtil.getValue(ct, HibernateEpr.EVENT_TAG, null);
       
        if (tempEvent == null)
          throw new ConfigurationException("No event specified.");
       
        String[] events = tempEvent.split(",");
        for (int i = 0; i<events.length; i++) {
          HibernateEventBean heb = new HibernateEventBean();
          heb.setEvent(events[i]);
          heb.setClassname(ListenerUtil.getValue(ct, HibernateEpr.CLASS_NAME_TAG, null));
         
          if (heb.getClassname() == null)
            throw new ConfigurationException("No classname specified.");
         
          eventList.add(heb)
        }       
      } catch (ConfigurationException ce) {
        m_logger.error("Problem parsing Message Filter event/classname");
View Full Code Here

     */
    public String getRequiredAttribute(String name) throws ConfigurationException {
        String ret = getAttribute(name);

        if (ret == null) {
            throw new ConfigurationException("Required configuration property '" + name + "' not defined on configuration '" + _name + "'.");
        }

        return ret;
    }
View Full Code Here

                    ((FileFilterInit) _theFilter).init(config);
                }
            }
            catch (final ClassNotFoundException ex)
            {
                throw new ConfigurationException(ex);
            }
            catch (final IllegalAccessException ex)
            {
                throw new ConfigurationException(ex);
            }
            catch (final InstantiationException ex)
            {
                throw new ConfigurationException(ex);
            }
            catch (final ConfigurationException ex)
            {
                throw ex;
            }
View Full Code Here

    }

    @Override
    protected void seeIfOkToWorkOnDir(File p_oDir) throws ConfigurationException {
        if (!p_oDir.exists())
            throw new ConfigurationException("Directory " + p_oDir.toString() + " not found");
        if (!p_oDir.isDirectory())
            throw new ConfigurationException(p_oDir.toString() + " is not a directory");
        if (!p_oDir.canRead())
            throw new ConfigurationException("Can't read directory " + p_oDir.toString());
        if (!p_oDir.canWrite())
            throw new ConfigurationException("Can't write/rename in directory " + p_oDir.toString());
    } // ________________________________
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.