Github user ijokarumawak commented on a diff in the pull request:

    https://github.com/apache/nifi/pull/2080#discussion_r133137100
  
    --- Diff: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/main/java/org/apache/nifi/processors/standard/EvaluateXPath.java
 ---
    @@ -219,6 +239,25 @@ public void onTrigger(final ProcessContext context, 
final ProcessSession session
             }
     
             final ComponentLog logger = getLogger();
    +        final DocumentBuilderFactory 
docBuilderFactory=docBuilderFactoryRef.get();
    +        final DocumentBuilder docBuilder;
    +        try {
    +            docBuilder = docBuilderFactory.newDocumentBuilder();
    +
    +            if (!context.getProperty(VALIDATE_DTD).asBoolean()) {
    +                docBuilder.setEntityResolver(new EntityResolver() {
    +                    @Override
    +                    public InputSource resolveEntity(String publicId, 
String systemId) throws SAXException, IOException {
    +                        return new InputSource(new StringReader(""));
    +                    }
    +                });
    +            }
    +        } catch (ParserConfigurationException e) {
    +            logger.error("Configuration error while constructing 
DocumentBuilder {}", new Object[]{e});
    +            session.transfer(flowFiles, REL_FAILURE);
    +            return;
    --- End diff --
    
    Throwing ProcessException would be more appropriate here, because the 
ParserConfigurationException is thrown regardless of incoming FlowFiles. By 
throwing ProcessException, incoming FlowFiles stay in the queue and can be 
processed after the user have fixed the issue.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to