Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-316

JavaDoc link causes http-500 error when no javadoc was built

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Component/s: core
    • Labels:
      None
    • Environment:
      Platform: All, OS: All
    • Similar Issues:

      Description

      If I configure a hudson project to publish javadoc at the end of a build, Hudson
      then provides a view javadoc link. If I never generated javadoc clicking on the
      javadoc link will cause a stack trace. IMO the software should do one of the
      following:

      1. Declare the build a failure if the publish javadoc step can't find javadoc.
      2. Supress the view javadoc link if none was published.
      3. Replace the stack trace with a simple message that no javadoc was found.

        Attachments

          Activity

          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          (1) does happen today. I also fixed (2) in 1.83.

          Also, I tried to reproduce the problem but all I got was 404, which is a
          perfectly valid status code for this "no javadoc" situation, I think.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - (1) does happen today. I also fixed (2) in 1.83. Also, I tried to reproduce the problem but all I got was 404, which is a perfectly valid status code for this "no javadoc" situation, I think.
          Hide
          pmendelson pmendelson added a comment -

          Thanks for addressing the issue. Just to let you know about the problem, I was
          running build #78. The root cause of the error 500 seemed to be

          javax.servlet.ServletException: ...myproject/javadoc/index.html (No such file or
          directory)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:233)
          org.kohsuke.stapler.MetaClass$15.dispatch(MetaClass.java:300)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:224)
          org.kohsuke.stapler.MetaClass$9.doDispatch(MetaClass.java:207)
          org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:224)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:169)
          org.kohsuke.stapler.Stapler.service(Stapler.java:68)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

          root cause

          java.io.FileNotFoundException: ...myproject/javadoc/index.html (No such file or
          directory)
          java.io.FileInputStream.open(Native Method)
          java.io.FileInputStream.<init>(FileInputStream.java:106)
          hudson.FilePath.read(FilePath.java:445)
          hudson.model.DirectoryBrowserSupport.serveFile(DirectoryBrowserSupport.java:112)
          hudson.tasks.JavadocArchiver$JavadocAction.doDynamic(JavadocArchiver.java:104)
          sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          java.lang.reflect.Method.invoke(Method.java:585)
          org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:50)
          org.kohsuke.stapler.MetaClass$14.dispatch(MetaClass.java:287)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:224)
          org.kohsuke.stapler.MetaClass$15.dispatch(MetaClass.java:300)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:224)
          org.kohsuke.stapler.MetaClass$9.doDispatch(MetaClass.java:207)
          org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:224)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:169)
          org.kohsuke.stapler.Stapler.service(Stapler.java:68)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

          Show
          pmendelson pmendelson added a comment - Thanks for addressing the issue. Just to let you know about the problem, I was running build #78. The root cause of the error 500 seemed to be javax.servlet.ServletException: ...myproject/javadoc/index.html (No such file or directory) org.kohsuke.stapler.Stapler.invoke(Stapler.java:233) org.kohsuke.stapler.MetaClass$15.dispatch(MetaClass.java:300) org.kohsuke.stapler.Stapler.invoke(Stapler.java:224) org.kohsuke.stapler.MetaClass$9.doDispatch(MetaClass.java:207) org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) org.kohsuke.stapler.Stapler.invoke(Stapler.java:224) org.kohsuke.stapler.Stapler.invoke(Stapler.java:169) org.kohsuke.stapler.Stapler.service(Stapler.java:68) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.io.FileNotFoundException: ...myproject/javadoc/index.html (No such file or directory) java.io.FileInputStream.open(Native Method) java.io.FileInputStream.<init>(FileInputStream.java:106) hudson.FilePath.read(FilePath.java:445) hudson.model.DirectoryBrowserSupport.serveFile(DirectoryBrowserSupport.java:112) hudson.tasks.JavadocArchiver$JavadocAction.doDynamic(JavadocArchiver.java:104) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:50) org.kohsuke.stapler.MetaClass$14.dispatch(MetaClass.java:287) org.kohsuke.stapler.Stapler.invoke(Stapler.java:224) org.kohsuke.stapler.MetaClass$15.dispatch(MetaClass.java:300) org.kohsuke.stapler.Stapler.invoke(Stapler.java:224) org.kohsuke.stapler.MetaClass$9.doDispatch(MetaClass.java:207) org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) org.kohsuke.stapler.Stapler.invoke(Stapler.java:224) org.kohsuke.stapler.Stapler.invoke(Stapler.java:169) org.kohsuke.stapler.Stapler.service(Stapler.java:68) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
          Hide
          pmendelson pmendelson added a comment -

          Just installed 1.83 and problem seems same with slightly different line numbers.
          javax.servlet.ServletException: /.../myproj/index.html (No such file or directory)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:269)
          org.kohsuke.stapler.MetaClass$15.dispatch(MetaClass.java:361)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:260)
          org.kohsuke.stapler.MetaClass$9.doDispatch(MetaClass.java:240)
          org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:260)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:198)
          org.kohsuke.stapler.Stapler.service(Stapler.java:72)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

          root cause

          java.io.FileNotFoundException: /.../myproj/javadoc/index.html (No such file or
          directory)
          java.io.FileInputStream.open(Native Method)
          java.io.FileInputStream.<init>(FileInputStream.java:106)
          hudson.FilePath.read(FilePath.java:445)
          hudson.model.DirectoryBrowserSupport.serveFile(DirectoryBrowserSupport.java:112)
          hudson.tasks.JavadocArchiver$JavadocAction.doDynamic(JavadocArchiver.java:109)
          sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          java.lang.reflect.Method.invoke(Method.java:585)
          org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:50)
          org.kohsuke.stapler.MetaClass$14.dispatch(MetaClass.java:344)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:260)
          org.kohsuke.stapler.MetaClass$15.dispatch(MetaClass.java:361)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:260)
          org.kohsuke.stapler.MetaClass$9.doDispatch(MetaClass.java:240)
          org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:260)
          org.kohsuke.stapler.Stapler.invoke(Stapler.java:198)
          org.kohsuke.stapler.Stapler.service(Stapler.java:72)
          javax.servlet.http.HttpServlet.service(HttpServlet.java:802)

          Show
          pmendelson pmendelson added a comment - Just installed 1.83 and problem seems same with slightly different line numbers. javax.servlet.ServletException: /.../myproj/index.html (No such file or directory) org.kohsuke.stapler.Stapler.invoke(Stapler.java:269) org.kohsuke.stapler.MetaClass$15.dispatch(MetaClass.java:361) org.kohsuke.stapler.Stapler.invoke(Stapler.java:260) org.kohsuke.stapler.MetaClass$9.doDispatch(MetaClass.java:240) org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) org.kohsuke.stapler.Stapler.invoke(Stapler.java:260) org.kohsuke.stapler.Stapler.invoke(Stapler.java:198) org.kohsuke.stapler.Stapler.service(Stapler.java:72) javax.servlet.http.HttpServlet.service(HttpServlet.java:802) root cause java.io.FileNotFoundException: /.../myproj/javadoc/index.html (No such file or directory) java.io.FileInputStream.open(Native Method) java.io.FileInputStream.<init>(FileInputStream.java:106) hudson.FilePath.read(FilePath.java:445) hudson.model.DirectoryBrowserSupport.serveFile(DirectoryBrowserSupport.java:112) hudson.tasks.JavadocArchiver$JavadocAction.doDynamic(JavadocArchiver.java:109) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:585) org.kohsuke.stapler.Function$InstanceFunction.invoke(Function.java:50) org.kohsuke.stapler.MetaClass$14.dispatch(MetaClass.java:344) org.kohsuke.stapler.Stapler.invoke(Stapler.java:260) org.kohsuke.stapler.MetaClass$15.dispatch(MetaClass.java:361) org.kohsuke.stapler.Stapler.invoke(Stapler.java:260) org.kohsuke.stapler.MetaClass$9.doDispatch(MetaClass.java:240) org.kohsuke.stapler.NameBasedDispatcher.dispatch(NameBasedDispatcher.java:30) org.kohsuke.stapler.Stapler.invoke(Stapler.java:260) org.kohsuke.stapler.Stapler.invoke(Stapler.java:198) org.kohsuke.stapler.Stapler.service(Stapler.java:72) javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
          Hide
          kohsuke Kohsuke Kawaguchi added a comment -

          OK, not-exist check and directory index.html handling was in the reverse order.
          That's fixed in 1.84.

          Show
          kohsuke Kohsuke Kawaguchi added a comment - OK, not-exist check and directory index.html handling was in the reverse order. That's fixed in 1.84.

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            pmendelson pmendelson
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: