Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

XML deserialization fails for pedigree/commits on a metadata/tools/components component

Chiusa
#942 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Dushyant7090 ci sta già lavorando.

Dal 24/9/2026.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
java, xml
Ambito
backend

Direzione di ricerca

Start with org.cyclonedx.parsers.XmlParser and the metadata/tools path in ToolInformationDeserializer, then reproduce the supplied XML with XmlParser.parse(). Compare this path with the working JSON and top-level component cases; done means the minimal XML parses successfully and the serialized structure round-trips without the reported ArrayList mapping error.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A CycloneDX 1.5 BOM whose metadata → tools → components component carries a pedigree with commits/commit cannot be deserialized from XML. XmlParser.parse() throws while mapping
Pedigree.commits. The same document deserializes fine as JSON, and the same pedigree/commit on a top-level component deserializes fine from XML — so this is specific to the XML +
tools-component code path. The library will happily serialize this structure but then cannot read its own output, breaking round-tripping.

Version

org.cyclonedx:cyclonedx-core-java:13.2.0 (latest on Maven Central). Runtime: jackson-databind/jackson-dataformat-xml 2.22.2, woodstox-core 7.2.0.

Minimal reproduction

Parse the following (minimal — everything non-essential removed) with new XmlParser().parse(bytes):

<?xml version="1.0" encoding="UTF-8"?>
<bom xmlns="http://cyclonedx.org/schema/bom/1.5">
  <metadata>
    <tools>
      <components>
        <component type="application">
          <name>t</name>
          <pedigree>
            <commits>
              <commit>
                <uid>u</uid>
              </commit>
            </commits>
          </pedigree>
        </component>
      </components>
    </tools>
  </metadata>
</bom>

Code to reproduce

  byte[] xml = Files.readAllBytes(Path.of("trigger.xml"));
  new org.cyclonedx.parsers.XmlParser().parse(xml); // throws

Stack tracke:

  org.cyclonedx.exception.ParseException: com.fasterxml.jackson.databind.JsonMappingException:
  Cannot deserialize value of type `java.util.ArrayList<org.cyclonedx.model.Commit>` from Object value (token `JsonToken.START_OBJECT`)
   (through reference chain: org.cyclonedx.model.Component["pedigree"]->org.cyclonedx.model.Pedigree["commits"]) (through reference chain: org.cyclonedx.model.Bom["metadata"])
        at org.cyclonedx.parsers.XmlParser.parse(XmlParser.java:101)
  ...
  Caused by: java.lang.IllegalArgumentException: Cannot deserialize value of type `java.util.ArrayList<org.cyclonedx.model.Commit>` from Object value (token `JsonToken.START_OBJECT`)
        at com.fasterxml.jackson.databind.ObjectMapper.convertValue(ObjectMapper.java:4661)
        at org.cyclonedx.util.deserializer.ToolInformationDeserializer.parseComponents(ToolInformationDeserializer.java:71)
        at org.cyclonedx.util.deserializer.ToolInformationDeserializer.parseToolInformation(ToolInformationDeserializer.java:49)
        at org.cyclonedx.util.deserializer.ToolInformationDeserializer.deserialize(ToolInformationDeserializer.java:43)
        at org.cyclonedx.util.ToolsJsonParser.parse(ToolsJsonParser.java:49)
        at org.cyclonedx.util.deserializer.MetadataDeserializer.deserialize(MetadataDeserializer.java:91)
  ...
  Caused by: com.fasterxml.jackson.databind.exc.MismatchedInputException: Cannot deserialize value of type `java.util.ArrayList<org.cyclonedx.model.Commit>` from Object value (token
  `JsonToken.START_OBJECT`)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.handleNonArray(CollectionDeserializer.java:404)
        at com.fasterxml.jackson.databind.deser.std.CollectionDeserializer.deserialize(CollectionDeserializer.java:253)

Open PR #833 appears to address exactly this path but is not yet merged/released.

Lingua principale
Java
Stelle
122
Fork
92
Merge medio
1g 11h
PR unite (30g)
36

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di CycloneDX/cyclonedx-core-java

Tutte le issue di CycloneDX/cyclonedx-core-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.