Uploaded image for project: 'Maven Doxia'
  1. Maven Doxia
  2. DOXIA-744

Null Pointer Exception

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Blocker
    • Resolution: Not A Problem
    • 2.0.0
    • None
    • Core
    • Windows 10
    • Important

    Description

      While trying to run mvn site the following happens:

       

      [INFO] ------------------------------------------------------------------------
      [INFO] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time:  01:50 min
      [INFO] Finished at: 2024-10-02T03:55:28+02:00
      [INFO] ------------------------------------------------------------------------
      [ERROR] Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.20.0:site (default-site) on project templateengine: Failed to render site: Error generating maven-surefire-report-plugin:3.5.0:report report: Cannot invoke "Object.toString()" because "value" is null -> [Help 1]
      org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-site-plugin:3.20.0:site (default-site) on project templateengine: Failed to render site
          at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:333)
          at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
          at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
          at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
          at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
          at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
          at org.apache.maven.cli.MavenCli.execute (MavenCli.java:903)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:280)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:203)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:568)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Failed to render site
          at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:119)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
          at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
          at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
          at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
          at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
          at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
          at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
          at org.apache.maven.cli.MavenCli.execute (MavenCli.java:903)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:280)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:203)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:568)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
      Caused by: org.apache.maven.doxia.siterenderer.RendererException: Error generating maven-surefire-report-plugin:3.5.0:report report
          at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:210)
          at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:300)
          at org.apache.maven.plugins.site.render.SiteMojo.renderNonDoxiaDocuments (SiteMojo.java:282)
          at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:147)
          at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:112)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
          at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
          at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
          at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
          at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
          at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
          at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
          at org.apache.maven.cli.MavenCli.execute (MavenCli.java:903)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:280)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:203)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:568)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
      Caused by: java.lang.NullPointerException: Cannot invoke "Object.toString()" because "value" is null
          at org.apache.maven.doxia.sink.impl.SinkUtils.getAttributeString (SinkUtils.java:188)
          at org.apache.maven.doxia.sink.impl.AbstractXmlSink.writeStartTag (AbstractXmlSink.java:126)
          at org.apache.maven.doxia.sink.impl.Xhtml5BaseSink.writeStartTag (Xhtml5BaseSink.java:1647)
          at org.apache.maven.doxia.sink.impl.AbstractXmlSink.writeStartTag (AbstractXmlSink.java:95)
          at org.apache.maven.doxia.sink.impl.Xhtml5BaseSink.anchor (Xhtml5BaseSink.java:1204)
          at org.apache.maven.doxia.sink.impl.AbstractSink.anchor (AbstractSink.java:354)
          at org.apache.maven.reporting.AbstractMavenReportRenderer.startSection (AbstractMavenReportRenderer.java:132)
          at org.apache.maven.reporting.AbstractMavenReportRenderer.startSection (AbstractMavenReportRenderer.java:116)
          at org.apache.maven.plugins.surefire.report.SurefireReportRenderer.renderSectionPackages (SurefireReportRenderer.java:220)
          at org.apache.maven.plugins.surefire.report.SurefireReportRenderer.renderBody (SurefireReportRenderer.java:119)
          at org.apache.maven.reporting.AbstractMavenReportRenderer.render (AbstractMavenReportRenderer.java:93)
          at org.apache.maven.plugins.surefire.report.AbstractSurefireReport.executeReport (AbstractSurefireReport.java:159)
          at org.apache.maven.reporting.AbstractMavenReport.generate (AbstractMavenReport.java:354)
          at org.apache.maven.plugins.site.render.ReportDocumentRenderer.renderDocument (ReportDocumentRenderer.java:199)
          at org.apache.maven.doxia.siterenderer.DefaultSiteRenderer.render (DefaultSiteRenderer.java:300)
          at org.apache.maven.plugins.site.render.SiteMojo.renderNonDoxiaDocuments (SiteMojo.java:282)
          at org.apache.maven.plugins.site.render.SiteMojo.renderLocale (SiteMojo.java:147)
          at org.apache.maven.plugins.site.render.SiteMojo.execute (SiteMojo.java:112)
          at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:126)
          at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute2 (MojoExecutor.java:328)
          at org.apache.maven.lifecycle.internal.MojoExecutor.doExecute (MojoExecutor.java:316)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:212)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:174)
          at org.apache.maven.lifecycle.internal.MojoExecutor.access$000 (MojoExecutor.java:75)
          at org.apache.maven.lifecycle.internal.MojoExecutor$1.run (MojoExecutor.java:162)
          at org.apache.maven.plugin.DefaultMojosExecutionStrategy.execute (DefaultMojosExecutionStrategy.java:39)
          at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:159)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:105)
          at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:73)
          at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:53)
          at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:118)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:261)
          at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:173)
          at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:101)
          at org.apache.maven.cli.MavenCli.execute (MavenCli.java:903)
          at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:280)
          at org.apache.maven.cli.MavenCli.main (MavenCli.java:203)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
          at jdk.internal.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:77)
          at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
          at java.lang.reflect.Method.invoke (Method.java:568)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:255)
          at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:201)
          at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:361)
          at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:314)
      [ERROR]
      [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
      [DEBUG] Shutting down adapter factory; available factories [file-lock, rwlock-local, semaphore-local, noop]; available name mappers [discriminating, file-gav, file-hgav, file-static, gav, static]
      [DEBUG] Shutting down 'file-lock' factory
      [DEBUG] Shutting down 'rwlock-local' factory
      [DEBUG] Shutting down 'semaphore-local' factory
      [DEBUG] Shutting down 'noop' factory

       

      I can see the problem within:

       

      https://github.com/apache/maven-doxia/blob/master/doxia-core/src/main/java/org/apache/maven/doxia/sink/impl/SinkUtils.java

       

      171:             Object value = att.getAttribute(key);   // gives back null - for what kind of key ever
      173:              if (value instanceof AttributeSet) {   // works, because has implicit null check
      183:                         } else {   // here we go
      188:      .append(value.toString())   / crash - missing null pointer check before calling toString()
      

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              powerstat Kai Hofmann
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: