Package org.milyn.cdr

Examples of org.milyn.cdr.SmooksConfigurationException


      return mapMessage;
    }
    catch (JMSException e)
    {
      final String errorMsg = "JMSException while trying to create TextMessae";
      throw new SmooksConfigurationException( errorMsg, e );
    }
  }
View Full Code Here


            }
            throw new NonUniqueResultException(exception);
          }

        } else {
          throw new SmooksConfigurationException("The returned result doesn't implement the '" + Collection.class.getName() + "' interface " +
              "and there for the unique result check can't be done.");
        }
      }

      if(result == null && onNoResult == OnNoResult.EXCEPTION) {
View Full Code Here

    }

    @Initialize
    public void intialize() throws SmooksConfigurationException {
        if(fileNamePattern == null) {
            throw new SmooksConfigurationException("Null 'fileNamePattern' configuration parameter.");
        }
        if(destinationDirectoryPattern == null) {
            throw new SmooksConfigurationException("Null 'destinationDirectoryPattern' configuration parameter.");
        }

        fileNameTemplate = new FreeMarkerTemplate(fileNamePattern);
        destinationDirectoryTemplate = new FreeMarkerTemplate(destinationDirectoryPattern);
View Full Code Here

    public void addVisitors(VisitorConfigMap visitorMap) {
        if (bindBeanId != null && bindBeanClass != null) {
            Bean bean;

            if (fieldsInMessage) {
                throw new SmooksConfigurationException("Unsupported reader based bean binding config.  Not supported when fields are defined in message.  See 'fieldsInMessage' attribute.");
            }

            if (vfRecordMetaData.isMultiTypeRecordSet()) {
                throw new SmooksConfigurationException(
                        "Unsupported reader based bean binding config for a multi record type record set.  "
                                + "Only supported for single record type record sets.  Use <jb:bean> configs for multi binding record type record sets.");
            }

            if (bindingType == BindingType.LIST) {
                Bean listBean = new Bean(ArrayList.class, bindBeanId,
                        SmooksResourceConfiguration.DOCUMENT_FRAGMENT_SELECTOR);

                bean = listBean.newBean(bindBeanClass, recordElementName);
                listBean.bindTo(bean);
                addFieldBindings(bean);

                listBean.addVisitors(visitorMap);
            } else if (bindingType == BindingType.MAP) {
                if (bindMapKeyField == null) {
                    throw new SmooksConfigurationException(
                            "'MAP' Binding must specify a 'keyField' property on the binding configuration.");
                }

                vfRecordMetaData.getRecordMetaData().assertValidFieldName(bindMapKeyField);
View Full Code Here

                    return;
                }

                recordMetaData = buildMultiRecordMetaData(recordDefs.get(0));
                if (recordMetaData == null) {
                    throw new SmooksConfigurationException("Unsupported fields definition '" + fields
                            + "'.  Must match either the single ('" + SINGLE_RECORD_PATTERN.pattern()
                            + "') or multi ('" + MULTI_RECORD_PATTERN.pattern() + "') record pattern.");
                }
            } else {
                for (String recordDef : recordDefs) {
                    recordDef = recordDef.trim();
                    RecordMetaData multiRecordMetaData = buildMultiRecordMetaData(recordDef);
                    if (multiRecordMetaData == null) {
                        throw new SmooksConfigurationException("Unsupported fields definition '" + recordDef
                                + "'.  Must match the multi record pattern ('" + MULTI_RECORD_PATTERN.pattern()
                                + "') .");
                    }
                    if (recordMetaDataMap == null) {
                        recordMetaDataMap = new HashMap<String, RecordMetaData>();
View Full Code Here

            String beanId = beanIdParam.getValue();

            SmooksResourceConfiguration beanCreatorConfig = findBeanCreatorConfig(beanId, extensionContext);

            if(beanCreatorConfig == null) {
                throw new SmooksConfigurationException("No <jb:wiring> configurations is found yet for beanId '" + beanId + "'. " +
                        "This can mean that no <jb:wiring> is present that wires the bean with the bean id or that it is configured after the <" + element.getNodeName() + ">. " +
                         "In this case you must set the selector in the '" + selectorAttrName + "' attribute.");
            } else {
                config.setSelector(beanCreatorConfig.getSelector());
            }
View Full Code Here

    public SmooksResourceConfiguration findBeanCreatorConfig(String beanId, ExtensionContext extensionContext) {
        List<SmooksResourceConfiguration> creatorConfigs = extensionContext.lookupResource(new ConfigSearch().resource(BeanInstancePopulator.class.getName()).param("wireBeanId", beanId));

        if(creatorConfigs.size() > 1) {
            throw new SmooksConfigurationException("Multiple <jb:wiring> configurations exist for beanId '" + beanId + "'. " +
                        "In this case you must set the selector in the '" + selectorAttrName + "' attribute because Smooks can't select a sensible default.");
        }
        if(creatorConfigs.size() == 1) {
            return creatorConfigs.get(0);
        }
View Full Code Here

            configurator.getParameters().setProperty("bindBeanId", binding.getBeanId());
            configurator.getParameters().setProperty("bindBeanClass", binding.getBeanClass().getName());
            configurator.getParameters().setProperty("bindingType", binding.getBindingType().toString());
            if (binding.getBindingType() == CSVBindingType.MAP) {
                if (binding.getKeyField() == null) {
                    throw new SmooksConfigurationException(
                            "CSV 'MAP' Binding must specify a 'keyField' property on the binding configuration.");
                }
                configurator.getParameters().setProperty("bindMapKeyField", binding.getKeyField());
            }
        }
View Full Code Here

            String beanId = beanIdParam.getValue();

            SmooksResourceConfiguration beanCreatorConfig = findBeanCreatorConfig(beanId, extensionContext);

            if(beanCreatorConfig == null) {
                throw new SmooksConfigurationException("No <jb:bean> configurations is found yet for beanId '" + beanId + "'. " +
                        "This can mean that no <jb:bean> is present that creates the bean with the bean id or that it is configured after the <" + element.getNodeName() + ">. " +
                         "In this case you must set the selector in the '" + selectorAttrName + "' attribute.");
            } else {
                config.setSelector(beanCreatorConfig.getSelector());
            }
View Full Code Here

    public SmooksResourceConfiguration findBeanCreatorConfig(String beanId, ExtensionContext extensionContext) {
        List<SmooksResourceConfiguration> creatorConfigs = extensionContext.lookupResource(new ConfigSearch().resource(BeanInstanceCreator.class.getName()).param("beanId", beanId));

        if(creatorConfigs.size() > 1) {
            throw new SmooksConfigurationException("Multiple <jb:bean> configurations exist for beanId '" + beanId + "'. " +
                        "In this case you must set the selector in the '" + selectorAttrName + "' attribute because Smooks can't select a sensible default.");
        }
        if(creatorConfigs.size() == 1) {
            return creatorConfigs.get(0);
        }
View Full Code Here

TOP

Related Classes of org.milyn.cdr.SmooksConfigurationException

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.