Package org.jboss.soa.esb

Examples of org.jboss.soa.esb.ConfigurationException


        {
            smooks = SmooksResource.createSmooksResource(smooksConfig);
        }
        catch (Exception e)
        {
            throw new ConfigurationException("Failed to create Smooks instance for config '" + smooksConfig + "'.", e);
        }

        // Get the default profile from the config...
        defaultMessageProfile = configTree.getAttribute(Properties.MESSAGE_PROFILE, Profile.DEFAULT_PROFILE);
       
        // Create the Smooks PayloadProcessor...
        String resultTypeConfig = configTree.getAttribute("resultType", "STRING");
        ResultType resultType;
        try {
            resultType = ResultType.valueOf(resultTypeConfig);
        } catch(IllegalArgumentException e) {
            throw new ConfigurationException("Invalid 'resultType' config value '" + resultTypeConfig + "'.  Valid values are: " + Arrays.asList(ResultType.values()));
        }
        payloadProcessor = new PayloadProcessor( smooks, resultType );
        if(resultType == ResultType.JAVA) {
            String javaResultBeanId = configTree.getAttribute("javaResultBeanId");
            if(javaResultBeanId != null) {
View Full Code Here


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

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

    if (provider.getDatasource() != null) {
      if ((provider.getUsername() != null)
          || (provider.getDriver() != null)) {
        throw new ConfigurationException ("Invalid sql-provider configuration : a datasource and a username/password/driver "
            + "combination cannot both be defined.   Use only one (datasource or JDBC connection info)."
            + "Datasource : [" + provider.getDatasource() + "] JDBC URL [" + provider.getUrl() + "]");
      }
    } else if (provider.getUrl() == null) {
      throw new ConfigurationException ("Invalid sql-provider configuration : a datasource or a URL/username/password/driver "
          + "combination must be defined.   Use only one (datasource or JDBC connection info).  "
          + "URL was null.");
    } else if (provider.getUsername() == null) {
      throw new ConfigurationException ("Invalid sql-provider configuration :  a datasource or a URL/username/password/driver "
          + "combination must be defined.   Use only one (datasource or JDBC connection info).   "
          + "Username was null.");
    } else if (provider.getDriver() == null) {
      throw new ConfigurationException ("Invalid sql-provider configuration : either a datasource or a URL/username/password/driver "
          + "combination must be defined.   Use only one (datasource or JDBC connection info).   "
          + "Driver was null.");
    }

    SqlMessageFilter messageFilter = listener.getSqlMessageFilter();
    if(messageFilter == null) {
      messageFilter = bus.getSqlMessageFilter();
      if(messageFilter == null) {
        throw new ConfigurationException("No <sql-destination> defined on either <sql-listener> [" + listener.getName() + "] or <sql-bus> [" + bus.getBusid() + "].");
      }
    }
        listenerNode.setAttribute("pollLatencySeconds", String.valueOf(listener.getPollFrequencySeconds()));
        if (provider.isSetTransacted()) {
            listenerNode.setAttribute(ListenerTagNames.TRANSACTED_TAG, Boolean.toString(provider.getTransacted())) ;
View Full Code Here

  private static void assertListenerConfigOK(Listener listener, XMLBeansModel model) throws ConfigurationException {

    // Note we're purposely performing instanceof comparisons here...

    if(listener.getClass() != DualListenerImpl.class) {
      throw new ConfigurationException("Can only use the " + UntypedListenerMapper.class.getName() + " mapper on the base listener type.  Cannot use on " + listener.getClass().getName());
    }
    Bus bus = model.getBus(listener.getBusidref());
    if(bus.getClass() != BusImpl.class) {
      throw new ConfigurationException("The base Listener config [" + listener.getName() + "] must reference a base Bus config type (<bus>).");
    }
    Provider provider = model.getProvider(bus);
    if(provider.getClass().isAssignableFrom(BusProviderImpl.class)) {
      throw new ConfigurationException("A base Bus config type (<bus>) must be contained within a base Provider type (<bus-provider>).");
    }
  }
View Full Code Here

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

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

    FsMessageFilter messageFilter = listener.getFsMessageFilter();
    if(messageFilter == null) {
      messageFilter = bus.getFsMessageFilter();
      if(messageFilter == null) {
        throw new ConfigurationException("No <fs-detination> defined on either <fs-listener> [" + listener.getName() + "] or <fs-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

                    listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_SIMPLE_EXEC, Integer.toString(simpleSchedule.getExecCount())) ;
                }
            } else if (schedule instanceof CronSchedule) {
                final String cronExpression = ((CronSchedule)schedule).getCronExpression() ;
                if (cronExpression == null) {
                    throw new ConfigurationException("Missing cron expression from configuration") ;
                }
                listenerConfig.setAttribute(ListenerTagNames.SCHEDULE_CRON_EXPRESSION, cronExpression) ;
            } else {
                throw new ConfigurationException("Unknown schedule type specified in configuration: " + schedule.getClass().getName()) ;
            }

            if(domElement.hasAttribute("poll-frequency-seconds") || domElement.hasAttribute("schedule-frequency") ) {
                logger.warn("Schedule Listener '" + listenerConfig.getTagName() + "' defines both 'scheduleidref' and frequency attributes.  Using the 'scheduleidref'.");
            }
View Full Code Here

                        instance.addListener((ScheduledEventListener) listener, frequency);
                    }
                }
            }
        } catch (SchedulingException e) {
            throw new ConfigurationException(e);
        }

        return instance;
    }
View Full Code Here

        for(org.jboss.soa.esb.listeners.config.xbeanmodel120.Schedule scheduleConfig : scheduleConfigs) {
            String scheduleId = scheduleConfig.getScheduleid();
            Schedule schedule;

            if(schedulIds.contains(scheduleId)) {
                throw new ConfigurationException("Duplicate 'scheduleid' value of '" + scheduleId + "'.  Must be unique on a per <schedule-provider> basis.");
            }
            schedulIds.add(scheduleId);

            if(scheduleConfig instanceof SimpleScheduleDocument.SimpleSchedule) {
                SimpleSchedule simpleSchedule;
View Full Code Here

     */
    public Bus getBus(String busid) throws ConfigurationException {
        Bus bus = getOptionalBus(busid);

        if(bus == null) {
            throw new ConfigurationException("Invalid ESB Configuration: No <bus> configuration matching busid reference value [" + busid + "].");
        }

        return bus;
    }
View Full Code Here

                }

                // Make sure each Service config has a message aware listener...
                // http://jira.jboss.com/jira/browse/JBESB-648
                if(!exposesInVMListener(service) && !isGateway && !listenerAdded) {
                    throw new ConfigurationException("Service configuration for Service '" + service.getCategory() + ":" + service.getName() + "' doesn't define a Message-Aware Listener (i.e. is-gateway='false').");
                }
            }
        }

        return gateways;
View Full Code Here

                numScheduleProviders++;
            }
        }

        if(numScheduleProviders > 1) {
            throw new ConfigurationException("Configuration contains " + numScheduleProviders + " <schedule-provider> configurations.  Only one of this provider type can exist per configuration.");
        }
    }
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.