protected Endpoint createEndpoint(String uri, String remaining, Map<String, Object> parameters) throws Exception {
final String resourceUri = remaining;
InputStream is = ResourceHelper.resolveMandatoryResourceAsInputStream(getCamelContext().getClassResolver(), resourceUri);
StreamSource source = new StreamSource(is);
ValidatingProcessor validator = new ValidatingProcessor();
validator.setSchemaSource(source);
LOG.debug("{} using schema resource: {}", this, resourceUri);
configureValidator(validator, uri, remaining, parameters);
// force loading of schema at create time otherwise concurrent
// processing could cause thread safe issues for the javax.xml.validation.SchemaFactory
validator.loadSchema();
// and make sure to close the input stream after the schema has been loaded
IOHelper.close(is);
return new ProcessorEndpoint(uri, this, validator);
}