Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Invalid XML characters" error during Maven run makeAggregateBom #257

Closed
monkeylijin opened this issue Jan 10, 2023 · 8 comments
Closed

Comments

@monkeylijin
Copy link

monkeylijin commented Jan 10, 2023

Hi,

I wanted to create a bom file with Cyclone DX.

I run the following command: mvn org.cyclonedx:cyclonedx-maven-plugin:makeAggregateBom

At the end I got the following log:

MacBook:nut-gateway lunzi$ mvn org.cyclonedx:cyclonedx-maven-plugin:makeAggregateBom
[INFO] Scanning for projects...
[INFO] 
[INFO] ------------------------< com.nut:nut-gateway >-------------------------
[INFO] Building nut-gateway 3.4.0
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- cyclonedx-maven-plugin:2.7.4:makeAggregateBom (default-cli) @ nut-gateway ---
[INFO] CycloneDX: Parameters
[INFO] ------------------------------------------------------------------------
[INFO] schemaVersion          : 1.4
[INFO] includeBomSerialNumber : true
[INFO] includeCompileScope    : true
[INFO] includeProvidedScope   : true
[INFO] includeRuntimeScope    : true
[INFO] includeTestScope       : false
[INFO] includeSystemScope     : true
[INFO] includeLicenseText     : false
[INFO] outputFormat           : all
[INFO] outputName             : bom
[INFO] outputReactorProjects  : true
[INFO] ------------------------------------------------------------------------
[INFO] CycloneDX: Creating BOM
[Fatal Error] :55:18649: Invalid XML characters found in element content of document (Unicode: 0xdccc)。
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  8.051 s
[INFO] Finished at: 2023-01-10T15:47:37+08:00
[INFO] ------------------------------------------------------------------------
[WARNING] The requested profile "dcits-nut" could not be activated because it does not exist.
[ERROR] Failed to execute goal org.cyclonedx:cyclonedx-maven-plugin:2.7.4:makeAggregateBom (default-cli) on project nut-gateway: An error occurred executing org.cyclonedx.maven.CycloneDxAggregateMojo: org.xml.sax.SAXParseException; lineNumber: 55; columnNumber: 18649; Invalid XML characters found in element content of document (Unicode: 0xdccc)。 -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
@hboutemy
Copy link
Contributor

it seems you have strange content in your pom.xml: without reproducer, we won't be able to do much
can you share a failing project, please?

@he1m4n6a
Copy link

he1m4n6a commented Sep 2, 2023

I had the same problem.

[INFO] CycloneDX: Resolving Aggregated Dependencies
[INFO] Downloading from ow2-snapshot: http://repository.ow2.org/nexus/content/repositories/snapshots/bv/krypton/framework/bv-starter/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from spring-libs-snapshot: https://repo.spring.io/libs-snapshot/bv/krypton/framework/bv-starter/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from spring-libs-release: https://repo.spring.io/libs-release/bv/krypton/framework/bv-starter/1.0.0-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata bv.krypton.framework:bv-starter:1.0.0-SNAPSHOT/maven-metadata.xml from/to spring-libs-snapshot (https://repo.spring.io/libs-snapshot): authentication failed for https://repo.spring.io/libs-snapshot/bv/krypton/framework/bv-starter/1.0.0-SNAPSHOT/maven-metadata.xml, status: 401 Unauthorized
[WARNING] Could not transfer metadata bv.krypton.framework:bv-starter:1.0.0-SNAPSHOT/maven-metadata.xml from/to spring-libs-release (https://repo.spring.io/libs-release): authentication failed for https://repo.spring.io/libs-release/bv/krypton/framework/bv-starter/1.0.0-SNAPSHOT/maven-metadata.xml, status: 401 Unauthorized
[INFO] Downloading from spring-libs-release: https://repo.spring.io/libs-release/bv/krypton/framework/bv-dependencies/1.0.0-SNAPSHOT/maven-metadata.xml
[INFO] Downloading from spring-libs-snapshot: https://repo.spring.io/libs-snapshot/bv/krypton/framework/bv-dependencies/1.0.0-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata bv.krypton.framework:bv-dependencies:1.0.0-SNAPSHOT/maven-metadata.xml from/to spring-libs-snapshot (https://repo.spring.io/libs-snapshot): authentication failed for https://repo.spring.io/libs-snapshot/bv/krypton/framework/bv-dependencies/1.0.0-SNAPSHOT/maven-metadata.xml, status: 401 Unauthorized
[WARNING] Could not transfer metadata bv.krypton.framework:bv-dependencies:1.0.0-SNAPSHOT/maven-metadata.xml from/to spring-libs-release (https://repo.spring.io/libs-release): authentication failed for https://repo.spring.io/libs-release/bv/krypton/framework/bv-dependencies/1.0.0-SNAPSHOT/maven-metadata.xml, status: 401 Unauthorized
[WARNING] BOM dependency listed but is not depended upon: pkg:maven/io.github.openfeign/feign-hystrix@11.8?type=jar
[INFO] CycloneDX: Creating BOM version 1.4 with 190 component(s)
[Fatal Error] :76:33687: An invalid XML character (Unicode: 0xdccc) was found in the element content of the document.
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary for bv-otc 1.0.0-SNAPSHOT:
[INFO]
[INFO] otc ............................................. FAILURE [ 9.220 s]
[INFO] otc-lib-feign ................................... SUCCESS [ 2.799 s]
[INFO] otc-lib-entity .................................. SUCCESS [ 1.518 s]
[INFO] otc-job ......................................... SUCCESS [ 0.714 s]
[INFO] otc-server ...................................... SUCCESS [ 2.221 s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 17.107 s
[INFO] Finished at: 2023-09-02T17:39:31Z
[INFO] ------------------------------------------------------------------------
[INFO] [jenkins-event-spy] Generated /var/lib/jenkins/workspace/test-server@tmp/withMavenad17dc69/maven-spy-20230902-173914-1249479097436346287476.log
[ERROR] Failed to execute goal org.cyclonedx:cyclonedx-maven-plugin:2.7.9:makeAggregateBom (default-cli) on project bv-otc: An error occurred executing org.cyclonedx.maven.CycloneDxAggregateMojo: org.xml.sax.SAXParseException; lineNumber: 76; columnNumber: 33687; An invalid XML character (Unicode: 0xdccc) was found in the element content of the document. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@hboutemy
Copy link
Contributor

hboutemy commented Sep 3, 2023

I can't reproduce, I don't see how to do anything without reproducing

at least please share the stacktrace (run with "mvn -e")

@hboutemy hboutemy changed the title Error during Maven run makeAggregateBom "Invalid XML character" error during Maven run makeAggregateBom Sep 3, 2023
@hboutemy hboutemy changed the title "Invalid XML character" error during Maven run makeAggregateBom "Invalid XML characters" error during Maven run makeAggregateBom Sep 3, 2023
@he1m4n6a
Copy link

he1m4n6a commented Sep 5, 2023

this is pom.xml

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <parent>
        <groupId>com.ob.otc</groupId>
        <artifactId>ob-otc</artifactId>
        <version>1.0.0-SNAPSHOT</version>
    </parent>

    <artifactId>ob-otc-lib-im</artifactId>
    <version>1.0.0-SNAPSHOT</version>
    <packaging>jar</packaging>

    <dependencies>
        <dependency>
            <groupId>ob.krypton.framework</groupId>
            <artifactId>ob-api</artifactId>
        </dependency>

        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>

        <dependency>
            <groupId>org.projectlombok</groupId>
            <artifactId>lombok</artifactId>
            <scope>provided</scope>
        </dependency>

        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
        </dependency>

        <dependency>
            <groupId>com.easemob.im</groupId>
            <artifactId>im-sdk-core</artifactId>
            <version>${im-sdk-core.version}</version>
        </dependency>

    </dependencies>

</project>

@he1m4n6a
Copy link

he1m4n6a commented Sep 5, 2023

[ERROR] Failed to execute goal org.cyclonedx:cyclonedx-maven-plugin:2.7.9:makeAggregateBom (default-cli) on project ob-otc: An error occurred executing org.cyclonedx.maven.CycloneDxAggregateMojo: org.xml.sax.SAXParseException; lineNumber: 97; columnNumber: 33687; An invalid XML character (Unicode: 0xdccc) was found in the element content of the document. -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.cyclonedx:cyclonedx-maven-plugin:2.7.9:makeAggregateBom (default-cli) on project bv-otc: An error occurred executing org.cyclonedx.maven.CycloneDxAggregateMojo: org.xml.sax.SAXParseException; lineNumber: 97; columnNumber: 33687; An invalid XML character (Unicode: 0xdccc) was found in the element content of the document.
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:306)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: org.apache.maven.plugin.MojoExecutionException: An error occurred executing org.cyclonedx.maven.CycloneDxAggregateMojo: org.xml.sax.SAXParseException; lineNumber: 97; columnNumber: 33687; An invalid XML character (Unicode: 0xdccc) was found in the element content of the document.
    at org.cyclonedx.maven.BaseCycloneDxMojo.generateBom (BaseCycloneDxMojo.java:355)
    at org.cyclonedx.maven.BaseCycloneDxMojo.execute (BaseCycloneDxMojo.java:303)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
Caused by: javax.xml.parsers.ParserConfigurationException: org.xml.sax.SAXParseException; lineNumber: 97; columnNumber: 33687; An invalid XML character (Unicode: 0xdccc) was found in the element content of the document.
    at org.cyclonedx.generators.xml.AbstractBomXmlGenerator.generateDocument (AbstractBomXmlGenerator.java:114)
    at org.cyclonedx.generators.xml.BomXmlGenerator14.generate (BomXmlGenerator14.java:63)
    at org.cyclonedx.maven.BaseCycloneDxMojo.saveBom (BaseCycloneDxMojo.java:363)
    at org.cyclonedx.maven.BaseCycloneDxMojo.generateBom (BaseCycloneDxMojo.java:350)
    at org.cyclonedx.maven.BaseCycloneDxMojo.execute (BaseCycloneDxMojo.java:303)
    at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:137)
    at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:301)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:211)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:165)
    at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:157)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:121)
    at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
    at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:56)
    at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:127)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:294)
    at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192)
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:960)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:293)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:196)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
    at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
    at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke (Method.java:566)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282)
    at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225)
    at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406)
    at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347)
[ERROR] 
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

@he1m4n6a
Copy link

he1m4n6a commented Sep 5, 2023

I suspect the com.easemob.im component is causing the problem

@hboutemy
Copy link
Contributor

hboutemy commented Sep 7, 2023

BaseCycloneDxMojo.generateBom (BaseCycloneDxMojo.java:355)

it seems recent PR #376 solved the issue: it's not yet released, but can you check by building latest SNAPSHOT?

@hboutemy
Copy link
Contributor

AFAIK, fixed by #376 in 2.7.10 that will be released soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants