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

not able to display java source, if sourcePath is not root

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Minor
    • Resolution: Fixed
    • Component/s: findbugs-plugin
    • Labels:
      None
    • Environment:
      Solaris, Tomcat6, Java6
    • Similar Issues:

      Description

      i have created a one-in-all ant target, which executes findbugs, checkstyle & pmd for the given $srcDir, $classesDir.
      Works as expected, and the Hudson Plugins do their job.

      Unfortunately, i just wanted to analyze a specific directory, so i set my $srcDir to $srcDir/com/mycompany/myapp/beans.
      ($classesDir respectively to $classesDir/com/mycompany/myapp/beans)
      Ant targets run as expected, analyzing only this folder, XML output looks fine
      Checkstyle & PMD Plugins work as expected, can click till the java sources
      Only the findbugs plugin complains about not finding the source file for displaying....

      Copying the source file 'com/mycompany/myapp/beans/pitches/PitchDataBean.java' from the workspace to the build folder '/export/home/tomcat/.hudson/jobs/myapp_trunk/builds/2010-08-11_15-14-43/workspace-files/fda28c.tmp' on the Hudson master failed.
      Seems that the path is relative, however an absolute path is required when copying the sources.
      Is the file 'PitchDataBean.java' contained more than once in your workspace?
      Is the file 'com/mycompany/myapp/beans/pitches/PitchDataBean.java' a valid filename?
      If you are building on a slave: please check if the file is accessible under '$HUDSON_HOME/[job-name]/com/mycompany/myapp/beans/pitches/PitchDataBean.java'
      If you are building on the master: please check if the file is accessible under '$HUDSON_HOME/[job-name]/workspace/com/mycompany/myapp/beans/pitches/PitchDataBean.java'
      hudson.util.IOException2: remote file operation failed: com/mycompany/myapp/beans/pitches/PitchDataBean.java at hudson.remoting.LocalChannel@15bbe8
      at hudson.FilePath.act(FilePath.java:749)
      at hudson.FilePath.act(FilePath.java:735)
      at hudson.FilePath.copyTo(FilePath.java:1360)
      at hudson.plugins.analysis.core.HealthAwarePublisher.copyFilesWithAnnotationsToBuildFolder(HealthAwarePublisher.java:264)
      at hudson.plugins.analysis.core.HealthAwarePublisher.perform(HealthAwarePublisher.java:226)
      at hudson.tasks.BuildStepMonitor$2.perform(BuildStepMonitor.java:27)
      at hudson.model.AbstractBuild$AbstractRunner.perform(AbstractBuild.java:601)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:580)
      at hudson.model.AbstractBuild$AbstractRunner.performAllBuildSteps(AbstractBuild.java:558)
      at hudson.model.Build$RunnerImpl.post2(Build.java:158)
      at hudson.model.AbstractBuild$AbstractRunner.post(AbstractBuild.java:528)
      at hudson.model.Run.run(Run.java:1280)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:46)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:127)
      Caused by: java.io.FileNotFoundException: com/mycompany/myapp/beans/pitches/PitchDataBean.java (No such file or directory)
      at java.io.FileInputStream.open(Native Method)
      at java.io.FileInputStream.<init>(FileInputStream.java:106)
      at hudson.FilePath$30.invoke(FilePath.java:1364)
      at hudson.FilePath$30.invoke(FilePath.java:1360)
      at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1899)
      at hudson.remoting.LocalChannel.call(LocalChannel.java:45)
      at hudson.FilePath.act(FilePath.java:742)
      ... 14 more

        Attachments

          Activity

          Hide
          myron0815 Myron0815 added a comment -

          well, yes. i tried that already.
          It might work for one project.
          But since my ant target is called by more projects, i cant use a fixed exclusion. (at least, i didn't know how to make this generic yet )
          And i need the "uncommon" srcDir anyway for checkstyle & PMD...

          I see, that's not a problem of the plugin...
          So this is a findbugs bug, to have always a correct sourcepath relative to the SrcDir?!
          (probably should better ask at SF tracker)

          otherwise... i could try to fix the SrcDir after generation;
          Thanks for your fast response

          Show
          myron0815 Myron0815 added a comment - well, yes. i tried that already. It might work for one project. But since my ant target is called by more projects, i cant use a fixed exclusion. (at least, i didn't know how to make this generic yet ) And i need the "uncommon" srcDir anyway for checkstyle & PMD... I see, that's not a problem of the plugin... So this is a findbugs bug, to have always a correct sourcepath relative to the SrcDir?! (probably should better ask at SF tracker) otherwise... i could try to fix the SrcDir after generation; Thanks for your fast response
          Hide
          drulli Ulli Hafner added a comment -

          Ok. What I'm still wondering is why the fallback algorithm is not invoked. Are there log messages in the console log of the form:

          Building cache of all workspace files to obtain absolute filenames for all warnings.

          Can you please also add the findbugs-warnings.xml file in order to see the actual results?

          Show
          drulli Ulli Hafner added a comment - Ok. What I'm still wondering is why the fallback algorithm is not invoked. Are there log messages in the console log of the form: Building cache of all workspace files to obtain absolute filenames for all warnings. Can you please also add the findbugs-warnings.xml file in order to see the actual results?
          Hide
          myron0815 Myron0815 added a comment -

          we have a fallback algorithm?! nice ^^

          you are correct, there are a bunch of warnings

          Aug 12, 2010 4:12:39 PM hudson.plugins.findbugs.parser.FindBugsParser parse
          WARNING: Can't resolve absolute file name for file PitchDataBean.java, dir list = [/export/home/tomcat/.hudson/jobs/myapp_trunk/workspace/trunk/src/com/mycompany/myapp, /export/home/tomcat/.hudson/jobs/myapp_trunk/workspace/trunk/findbugs.xml/src/main/java, /export/home/tomcat/.hudson/jobs/myapp_trunk/workspace/trunk/findbugs.xml/src/test/java, /export/home/tomcat/.hudson/jobs/myapp_trunk/workspace/trunk/findbugs.xml/src]
          Aug 12, 2010 4:12:39 PM hudson.plugins.analysis.core.ParserResult populateFileNameCache
          INFO: Building cache of all workspace files to obtain absolute filenames for all warnings.
          Aug 12, 2010 4:12:39 PM hudson.plugins.analysis.core.ParserResult populateFileNameCache
          INFO: Relative filenames [asm-3.1.jar, build.properties, db.properties, jaxen-1.1.1.jar, log4j.properties, package.html, pitch.properties, pitchDelivery.properties, pitchExpiryWarning.vm, pitchPrepareError.vm, pitchRequest.properties, spring-config.xml, web.xml, ?] found more than once; absolute filename resolution disabled for these files.

          seems you fallback algorithm doesn't cover my weird setup either...
          maybe we need some "while fileNotFound strip off first directory from fileName and try again"?!

          Show
          myron0815 Myron0815 added a comment - we have a fallback algorithm?! nice ^^ you are correct, there are a bunch of warnings Aug 12, 2010 4:12:39 PM hudson.plugins.findbugs.parser.FindBugsParser parse WARNING: Can't resolve absolute file name for file PitchDataBean.java, dir list = [/export/home/tomcat/.hudson/jobs/myapp_trunk/workspace/trunk/src/com/mycompany/myapp, /export/home/tomcat/.hudson/jobs/myapp_trunk/workspace/trunk/findbugs.xml/src/main/java, /export/home/tomcat/.hudson/jobs/myapp_trunk/workspace/trunk/findbugs.xml/src/test/java, /export/home/tomcat/.hudson/jobs/myapp_trunk/workspace/trunk/findbugs.xml/src] Aug 12, 2010 4:12:39 PM hudson.plugins.analysis.core.ParserResult populateFileNameCache INFO: Building cache of all workspace files to obtain absolute filenames for all warnings. Aug 12, 2010 4:12:39 PM hudson.plugins.analysis.core.ParserResult populateFileNameCache INFO: Relative filenames [asm-3.1.jar, build.properties, db.properties, jaxen-1.1.1.jar, log4j.properties, package.html, pitch.properties, pitchDelivery.properties, pitchExpiryWarning.vm, pitchPrepareError.vm, pitchRequest.properties, spring-config.xml, web.xml, ?] found more than once; absolute filename resolution disabled for these files. seems you fallback algorithm doesn't cover my weird setup either... maybe we need some "while fileNotFound strip off first directory from fileName and try again"?!
          Hide
          drulli Ulli Hafner added a comment -

          I fixed JENKINS-3488 today. Hopefully, this fixes your issue, too.

          Show
          drulli Ulli Hafner added a comment - I fixed JENKINS-3488 today. Hopefully, this fixes your issue, too.
          Hide
          myron0815 Myron0815 added a comment -

          Yes, indeed.
          It's working now.
          Thanks!

          Show
          myron0815 Myron0815 added a comment - Yes, indeed. It's working now. Thanks!

            People

            • Assignee:
              drulli Ulli Hafner
              Reporter:
              myron0815 Myron0815
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: