use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class FileSystemSender method configure.
@Override
public void configure() throws ConfigurationException {
super.configure();
getFileSystem().configure();
try {
actor.configure(fileSystem, getParameterList(), this);
} catch (ConfigurationException e) {
throw new ConfigurationException(getLogPrefix(), e);
}
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class XmlUtils method getXPathTransformerPool.
public static TransformerPool getXPathTransformerPool(String namespaceDefs, String xPathExpression, OutputType outputType, boolean includeXmlDeclaration, ParameterList params, int xsltVersion) throws ConfigurationException {
List<String> paramNames = null;
if (params != null) {
paramNames = new ArrayList<String>();
Iterator<Parameter> iterator = params.iterator();
while (iterator.hasNext()) {
paramNames.add(iterator.next().getName());
}
}
try {
String xslt;
xslt = createXPathEvaluatorSource(namespaceDefs, xPathExpression, outputType, includeXmlDeclaration, paramNames, true, StringUtils.isEmpty(namespaceDefs), null, xsltVersion);
if (log.isDebugEnabled())
log.debug("xpath [" + xPathExpression + "] resulted in xslt [" + xslt + "]");
return getUtilityTransformerPool(xslt, "XPath:" + xPathExpression + "|" + outputType + "|" + namespaceDefs + "|" + xsltVersion, !includeXmlDeclaration, false, xsltVersion);
} catch (TransformerConfigurationException e) {
throw new ConfigurationException(e);
}
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class JavaxValidationContext method getSchemaObject.
/**
* Returns the {@link Schema} associated with this validator. This is an XSD schema containing knowledge about the
* schema source as returned by {@link #getSchemaSources(List)}
*/
protected synchronized Schema getSchemaObject(String schemasId, List<nl.nn.adapterframework.validation.Schema> schemas) throws ConfigurationException {
Schema schema = javaxSchemas.get(schemasId);
if (schema == null) {
SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
factory.setResourceResolver(new LSResourceResolver() {
@Override
public LSInput resolveResource(String s, String s1, String s2, String s3, String s4) {
return null;
}
});
try {
Collection<Source> sources = getSchemaSources(schemas);
schema = factory.newSchema(sources.toArray(new Source[sources.size()]));
javaxSchemas.put(schemasId, schema);
} catch (Exception e) {
throw new ConfigurationException("cannot read schema's [" + schemasId + "]", e);
}
}
return schema;
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class XmlUtils method getUtilityTransformerPool.
private static TransformerPool getUtilityTransformerPool(String xslt, String key, boolean omitXmlDeclaration, boolean indent, int xsltVersion) throws ConfigurationException {
String fullKey = key + "-" + omitXmlDeclaration + "-" + indent;
TransformerPool result = utilityTPs.get(fullKey);
if (result == null) {
try {
TransformerPool newtp = TransformerPool.getUtilityInstance(xslt, xsltVersion);
result = utilityTPs.put(fullKey, newtp);
if (result == null) {
result = newtp;
}
} catch (TransformerConfigurationException te) {
throw new ConfigurationException("Could not create TransformerPool for [" + key + "]", te);
}
}
return result;
}
use of nl.nn.adapterframework.configuration.ConfigurationException in project iaf by ibissource.
the class XmlValidatorTest method testSoapNamespaceFeature.
/*
* <tr> <td>{@link #setSoapNamespace(String) soapNamespace}</td> <td>the
* namespace of the SOAP Envelope, when this property has a value and the
* input message is a SOAP Message the content of the SOAP Body is used for
* validation, hence the SOAP Envelope and SOAP Body elements are not
* considered part of the message to validate. Please note that this
* functionality is deprecated, using {@link
* nl.nn.adapterframework.soap.SoapValidator} is now the preferred solution
* in case a SOAP Message needs to be validated, in other cases give this
* property an empty value</td>
* <td>http://schemas.xmlsoap.org/soap/envelope/</td></tr>
*
*/
public void testSoapNamespaceFeature(String schema, String root, String inputFile) throws ConfigurationException, IOException, PipeRunException, XmlValidatorException, PipeStartException {
XmlValidator validator = new XmlValidator();
try {
validator.setImplementation(implementation);
} catch (Exception e) {
throw new RuntimeException(e);
}
validator.registerForward(createSuccessForward());
validator.setThrowException(true);
validator.setFullSchemaChecking(true);
validator.setRoot(root);
validator.setSoapNamespace("http://www.w3.org/2003/05/soap-envelope");
validator.setSchema(schema);
validator.configure();
validator.start();
assertNull(runAndEvaluate(validator, inputFile, null));
}
Aggregations