Sonar

NPE in newUnitTestClassFromAbsolutePath durring sonar collect phase

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Critical Critical
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9.1
  • Component/s: None
  • Labels:
    None
  • Environment:
    Windows XP/2003, Maven 2.1.0, jdk 1.6.0.13
  • Number of attachments :
    4

Description

While testing sonar 1.9, most of our projects failed on sonar:sonar, or had fewer java sources collected.

On a closer look, projects with no unit tests had fewer java sources imported. As seen in attached sonar_warn_has_no_tests.log, "CPD - File not found" is thrown, in the section marked as "[class org.sonar.plugins.cpd.CpdMavenCollector] executing".

Projects that have unit tests, failed with a npe, as shown in attacheed sonar_NPE_error_has_tests.log.

Both logs are complete maven build log (with some company names edited), taken with "-e", on a clean default sonar 1.9.

Local mvn repository has been previously deleted and rebuilt for these tests.

Projects were build with "mvn clean compile sonar:sonar". I have attached one of the poms (edited).

As a result, we were unable to upgrade to sonar 1.9, so we reverted to sonar 1.8.

Detailed environment:

c:\workspaces\inbox>java -version
java version "1.6.0_13"
Java(TM) SE Runtime Environment (build 1.6.0_13-b03)
Java HotSpot(TM) Client VM (build 11.3-b02, mixed mode, sharing)

c:\workspaces\inbox>mvn -version
Apache Maven 2.1.0 (r755702; 2009-03-18 21:10:27+0200)
Java version: 1.6.0_13
Java home: c:\java\jdk\jdk1.6.0_13\jre
Default locale: en_US, platform encoding: Cp1252
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

  1. pom.xml
    28/May/09 4:36 AM
    4 kB
    Mercer Traieste
  2. sonar_NPE_error_has_tests.log
    28/May/09 4:36 AM
    16 kB
    Mercer Traieste
  3. sonar_warn_has_no_tests.log
    28/May/09 4:36 AM
    48 kB
    Mercer Traieste

Issue Links

Activity

Hide
Simon Brandhof added a comment -

Is it possible to attach a project sample to reproduce the issue ?

Show
Simon Brandhof added a comment - Is it possible to attach a project sample to reproduce the issue ?
Hide
Antje added a comment -

i build a 'hello-world' project and get the same error with these project.

Show
Antje added a comment - i build a 'hello-world' project and get the same error with these project.
Hide
Simon Brandhof added a comment - - edited

The 2 java files are not compiled because they are not located in src/main/java and src/test/java. Is it the desired test ?

Show
Simon Brandhof added a comment - - edited The 2 java files are not compiled because they are not located in src/main/java and src/test/java. Is it the desired test ?
Hide
Jose Rodriguez added a comment -

Hi,

We have nineteen nightly builds. We decided to migrate from 1.8 to 1.9.

So far I tested only 4 of them and 2 fails because of this bugs.

Is there any work around?

Thanks.
J.

Show
Jose Rodriguez added a comment - Hi, We have nineteen nightly builds. We decided to migrate from 1.8 to 1.9. So far I tested only 4 of them and 2 fails because of this bugs. Is there any work around? Thanks. J.
Hide
Antje added a comment -

sorry for the wrong files. Here are the rigth ones

Show
Antje added a comment - sorry for the wrong files. Here are the rigth ones
Hide
Simon Brandhof added a comment -

Thank you Antje but I can't reproduce the issue with your samples. Are there any specific settings ? I'm using Sonar 1.9 on Windows + maven 2.1.0.

Show
Simon Brandhof added a comment - Thank you Antje but I can't reproduce the issue with your samples. Are there any specific settings ? I'm using Sonar 1.9 on Windows + maven 2.1.0.
Hide
Jose Rodriguez added a comment -

Hi,

We use maven 2.0.9 with Hudson (1.303) under Ubuntu 9.04.

Regards,
J.

Show
Jose Rodriguez added a comment - Hi, We use maven 2.0.9 with Hudson (1.303) under Ubuntu 9.04. Regards, J.
Hide
Simon Brandhof added a comment -

Jose, do you reproduce the problem with the attached sample ?

Show
Simon Brandhof added a comment - Jose, do you reproduce the problem with the attached sample ?
Hide
Jose Rodriguez added a comment -

Yes, I reproduce this problem with the attached sample with maven 2.0.9 and jdk 1.5.0_15 on windows.

Regards,
J.

Show
Jose Rodriguez added a comment - Yes, I reproduce this problem with the attached sample with maven 2.0.9 and jdk 1.5.0_15 on windows. Regards, J.
Hide
Jose Rodriguez added a comment -

oups... it was maven 2.0.10...

Show
Jose Rodriguez added a comment - oups... it was maven 2.0.10...

People

Vote (1)
Watch (4)

Dates

  • Created:
    Updated:
    Resolved: