Maven Javadoc Plugin
  1. Maven Javadoc Plugin
  2. MJAVADOC-292

javadoc:jar FATAL ERROR Host name may not be null


    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.7
    • Fix Version/s: 2.8
    • Component/s: None
    • Labels:
    • Environment:
      Ubuntu 10.04 & Windows XP. Running maven 2.2.1 java 1.6.0_14


      For some reason (that I have yet to determine) I am using a bad URL when linking to the jdk6 apidocs. This causes my javadoc:jar to terminate with a fatal error. This is doubly problematic because
      (a) the error message does not include the URL that is at fault; and
      (b) the build crashes out where other similar badly configured javadoc link URLs continue after emitting a warning message.

      [INFO] [INFO] [javadoc:jar {execution: attach-javadocs}]
      [INFO] [INFO] ------------------------------------------------------------------------
      [INFO] [INFO] ------------------------------------------------------------------------
      [INFO] [INFO] Host name may not be null
      [INFO] [INFO] ------------------------------------------------------------------------
      [INFO] [INFO] Trace
      [INFO] java.lang.IllegalArgumentException: Host name may not be null
      [INFO] 	at org.apache.commons.httpclient.HttpHost.<init>(
      [INFO] 	at org.apache.commons.httpclient.HttpHost.<init>(
      [INFO] 	at org.apache.commons.httpclient.HttpMethodBase.setURI(
      [INFO] 	at org.apache.commons.httpclient.HttpMethodBase.<init>(
      [INFO] 	at org.apache.commons.httpclient.methods.GetMethod.<init>(
      [INFO] 	at org.apache.maven.plugin.javadoc.JavadocUtil.fetchURL(
      [INFO] 	at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.isValidJavadocLink(
      [INFO] 	at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.addLinkArguments(
      [INFO] 	at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.addStandardDocletOptions(
      [INFO] 	at org.apache.maven.plugin.javadoc.AbstractJavadocMojo.executeReport(
      [INFO] 	at org.apache.maven.plugin.javadoc.JavadocJar.execute(
      [INFO] 	at org.apache.maven.plugin.DefaultPluginManager.executeMojo(
      [INFO] 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(
      [INFO] 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(
      [INFO] 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(
      [INFO] 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(
      [INFO] 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(
      [INFO] 	at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(
      [INFO] 	at org.apache.maven.DefaultMaven.doExecute(
      [INFO] 	at org.apache.maven.DefaultMaven.execute(
      [INFO] 	at org.apache.maven.cli.MavenCli.main(
      [INFO] 	at org.apache.maven.cli.compat.CompatibleMain.main(
      [INFO] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      [INFO] 	at sun.reflect.NativeMethodAccessorImpl.invoke(
      [INFO] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(
      [INFO] 	at java.lang.reflect.Method.invoke(
      [INFO] 	at org.codehaus.classworlds.Launcher.launchEnhanced(
      [INFO] 	at org.codehaus.classworlds.Launcher.launch(
      [INFO] 	at org.codehaus.classworlds.Launcher.mainWithExitCode(
      [INFO] 	at org.codehaus.classworlds.Launcher.main(

      I have attached a patch that catches the IllegalArgumentException that is thrown by httpclient and logs a suitable error message. I suspect that this is not the best way to fix the issue because it might mask other errors but it certainly gets me past my immediate issue.

      With the patch applied the fatal error becomes a single line as follows and the build continues.

      [ERROR] Malformed link: http:/// Ignored it.

      I have tested with both 2.7 and trunk and have confirmed that the problem exists in both and that the patch works on both.


        Hervé Boutemy added a comment -

        fixed with MJAVADOC-317: the link is not checked by the plugin but javadoc tool

        Hervé Boutemy added a comment - fixed with MJAVADOC-317 : the link is not checked by the plugin but javadoc tool


          • Assignee:
            Hervé Boutemy
            Richard Mortimer
          • Votes:
            0 Vote for this issue
            0 Start watching this issue


            • Created: