Skip to content

Validate does not support Product_Resource - pds4-jparser JAXB context built against outdated IM schema (1K00) #1550

@jshughes

Description

@jshughes

Checked for duplicates

Yes - I've already checked

🐛 Describe the bug

When validating a Product_Resource label (introduced in PDS4 IM schema version 1Q00), validate fails with a noisy JAXB unmarshal error and silently skips content validation for the product.

The root cause is that pds4-jparser's JAXB context is generated from schema version 1K00 (pom.xml model-version property), so ProductResource is not a known type. Two symptoms result:

  1. Noisy error logs to stderr from FileAreaExtractor.findAndFlagBadFilenames() (line 89-91), which logs a ParseException at ERROR level when it encounters any unrecognized product type:
[main] ERROR gov.nasa.pds.tools.validate.rule.FileAreaExtractor - Error occurred while trying to get the table file areas: unexpected element (uri:"http://pds.nasa.gov/pds4/pds/v1", local:"Product_Resource")
Fatal error: [...url=.../tc_Invalid_Product_Resource.xml...]: unexpected element (uri:"http://pds.nasa.gov/pds4/pds/v1", local:"Product_Resource")
[main] ERROR gov.nasa.pds.objectAccess.ObjectAccess - Failed to load the product from the label.
  1. Content/data validation is silently skippedDataDefinitionAndContentValidationRule.validate() catches ParseException from Label.open() and ignores it (line 160: // Ignore. Shouldn't happen), so any data-level validation for Product_Resource labels is never performed.

Note: Schema and Schematron validation still work correctly (they don't use JAXB), so structural label errors are still caught.

🕵️ Expected behavior

  • No noisy JAXB error logs when a valid but unrecognized product type is encountered
  • Once pds4-jparser is updated to include Product_Resource (schema 1Q00), full content validation should work

📜 To Reproduce

  1. Run validate against any label with root element <Product_Resource xmlns="http://pds.nasa.gov/pds4/pds/v1" ...>
  2. Observe ERROR-level logs from FileAreaExtractor and ObjectAccess in stderr

🩺 Test Data / Additional context

Test files from pds4-information-model:

  • model-lddtool/src/test/resources/data/update_version/github931/tc_Invalid_Product_Resource.xml
  • model-lddtool/src/test/resources/data/update_version/github931/tc_Valid_Product_Resource.xml

⚙️ Engineering Details

Primary fix (pds4-jparser): Update pds4-jparser to generate JAXB classes from schema 1Q00 (which defines Product_Resource). See sister issue: NASA-PDS/pds4-jparser#192

Secondary fix (validate): In FileAreaExtractor.java:89, change LOG.error(...) to LOG.debug(...) — a ParseException from an unknown product type is expected behavior when validate encounters a newer IM version than pds4-jparser was built against, not an error condition.

🎉 Integration & Test

  • Add Cucumber test scenario for Product_Resource label validation once pds4-jparser is updated

Metadata

Metadata

Assignees

Labels

B17B18bugSomething isn't workingi&t.skips.highsprint-backlogtask-spillovertask from previous build increment have spilled over into current planning increment.

Type

No fields configured for Bug.

Projects

Status

🏁 Done

Status

Done

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions