CycloneDX / cyclonedx-core-java

CycloneDX SBOM Model and Utils for Creating and Validating BOMs
https://cyclonedx.org/
Apache License 2.0
81 stars 59 forks source link

toXmlString() of BomXmlGenerator throws "NoSuchMethodError" in new version 9.0.4 #446

Closed afsahsyeda closed 2 months ago

afsahsyeda commented 2 months ago

On trying to convert an xmlbom of BomXmlGenerator class to string using toXmlString(), I am getting a "NoSuchMethodError" in version 9.0.4. This issue was not present in a previous version (was using 7.3.2). The issue occurs in the ObjectWriter.java class while trying to call "createGenerator" for XmlFactory. Here is the relevant screenshot: image

sschuberth commented 2 months ago

We're using toXmlString() just fine, so I believe this is something related to our code.

afsahsyeda commented 2 months ago

@sschuberth We are calling the toXmlString() function as is. It works in the previous versions. image

sschuberth commented 2 months ago

By "code" I actually meant your build system code, i.e. management of dependencies. I could imagine that there's e.g. a conflict of Jackson library versions on your end that could lead to this.

afsahsyeda commented 2 months ago

By "code" I actually meant your build system code, i.e. management of dependencies. I could imagine that there's e.g. a conflict of Jackson library versions on your end that could lead to this.

It works now, thanks!