Claus Ibsen created CAMEL-27837:
-----------------------------------

             Summary: camel-dfdl: rootElement alone is ignored, a missing 
schema fails with NullPointerException
                 Key: CAMEL-27837
                 URL: https://issues.apache.org/jira/browse/CAMEL-27837
             Project: Camel
          Issue Type: Bug
          Components: camel-dfdl
            Reporter: Claus Ibsen
             Fix For: 4.25.0


Found while improving the option descriptions of camel-dfdl for CAMEL-23832 
(pull request https://github.com/apache/camel/pull/31142).
These are separate problems of the component; the descriptions change only 
documents the current behavior.

h4. 1. rootElement alone is ignored
{{DfdlEndpoint.doInit}} and {{DfdlDataFormat.doInit}} pass rootElement and 
rootNamespace to Daffodil 3.10.0 only when both are non-empty; otherwise 
compileSource(uri) picks the first global element. So rootElement alone is 
ignored, and a root element in no namespace can never be chosen (Daffodil takes 
"" as no namespace and null as infer).
Proposed change: call compileSource(uri, rootElement, rootNamespace-or-null) 
whenever rootElement is set, and pass an empty rootNamespace as "".

h4. 2. A missing schema fails with NullPointerException
ResourceHelper.resolveMandatoryResource returns a classpath resource for a 
missing schema; its getURI() is null and Daffodil calls uri.getScheme(). 
Schemes without a path (ref:, mem:, base64:) fail the same way in Paths.get.
Proposed change: check that the resource exists and throw FileNotFoundException.


_Claude Code on behalf of davsclaus_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to