Uploaded image for project: 'Maven JXR'
  1. Maven JXR
  2. JXR-18

JXR Fails with NPE if the .java file is empty (class commented out)

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.1
    • Component/s: jxr
    • Labels:
      None
    • Environment:
      M2.0.4

      Description

      If you build a project and one of your java files exists (but is empty / commented out), JXR generates a NPE

      [INFO] Generate "Source Xref" report.
      [INFO] Scanning W:\1244 - Knowledge Management System (KMS)\dev\modules\kms-services\src\main\java
      Unable to processPath W:\1244 - Knowledge Management System (KMS)\dev\modules\kms-services\src\main\java\com\cswgroup\kms\services\cont
      ent\contenthandler\AddCheckOutMetadataHandler.java => W:\1244 - Knowledge Management System (KMS)\dev\modules\kms-services\target/site/
      xref\com\cswgroup\kms\services\content\contenthandler\AddCheckOutMetadataHandler.html
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD ERROR
      [INFO] ------------------------------------------------------------------------
      [INFO] Error during report generation

      Embedded error: Error while generating the HTML source code of the projet.
      [INFO] ------------------------------------------------------------------------
      [INFO] Trace
      org.apache.maven.lifecycle.LifecycleExecutionException: Error during report generation
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:559)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeStandaloneGoal(DefaultLifecycleExecutor.java:488)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:458)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:306)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:273)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:140)
      at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:322)
      at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
      at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
      at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
      Caused by: org.apache.maven.plugin.MojoExecutionException: Error during report generation
      at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:389)
      at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:412)
      at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:534)
      ... 16 more
      Caused by: org.apache.maven.reporting.MavenReportException: Error while generating the HTML source code of the projet.
      at org.apache.maven.plugin.jxr.JxrReport.generateXrefForSources(JxrReport.java:202)
      at org.apache.maven.plugin.jxr.JxrReport.executeReport(JxrReport.java:165)
      at org.apache.maven.reporting.AbstractMavenReport.generate(AbstractMavenReport.java:117)
      at org.apache.maven.plugins.site.SiteMojo.generateReportsPages(SiteMojo.java:802)
      at org.apache.maven.plugins.site.SiteMojo.execute(SiteMojo.java:301)
      ... 18 more
      Caused by: java.lang.NullPointerException
      at org.apache.maven.jxr.CodeTransform.getHeader(CodeTransform.java:651)
      at org.apache.maven.jxr.CodeTransform.transform(CodeTransform.java:716)
      at org.apache.maven.jxr.CodeTransform.transform(CodeTransform.java:787)
      at org.apache.maven.jxr.JXR.transform(JXR.java:195)
      at org.apache.maven.jxr.JXR.processPath(JXR.java:114)
      at org.apache.maven.jxr.JXR.xref(JXR.java:331)
      at org.apache.maven.plugin.jxr.JxrReport.createXref(JxrReport.java:384)
      at org.apache.maven.plugin.jxr.JxrReport.generateXrefForSources(JxrReport.java:189)
      ... 22 more
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 1 minute 11 seconds
      [INFO] Finished at: Thu Apr 20 16:02:41 BST 2006
      [INFO] Final Memory: 22M/67M
      [INFO] ------------------------------------------------------------------------

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                siveton Siveton Vincent
                Reporter:
                magnayn nigel magnay
              • Votes:
                1 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: