This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 236768 - Deploy to Sonar is not finishing the console as expected
Summary: Deploy to Sonar is not finishing the console as expected
Status: VERIFIED FIXED
Alias: None
Product: projects
Classification: Unclassified
Component: Maven (show other bugs)
Version: 7.4
Hardware: PC Linux
: P3 normal (vote)
Assignee: Milos Kleint
URL:
Keywords:
: 236781 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-10-04 14:08 UTC by Michel Graciano
Modified: 2013-11-22 13:08 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Debuging UI (144.03 KB, image/png)
2013-10-04 20:14 UTC, Michel Graciano
Details
Super simple patch (1.16 KB, patch)
2013-10-04 20:16 UTC, Michel Graciano
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michel Graciano 2013-10-04 14:08:34 UTC
[ BUILD # : RC2 ]
[ JDK VERSION : 1.7.0_40 ]

When I deploy our project to Sonar, the console is stopped without any notice
but the process is finished with success as expected. I have seen that a NPE is
thrown in the IDE log as follow. I haven't yet time to create a simple test
case but I wish to file it asap. As soon as I can, I will gather a sample
project to make your work easier.

SEVERE [org.openide.util.RequestProcessor]: Error in RequestProcessor
org.netbeans.modules.maven.execute.CommandLineOutputHandler$Output
java.lang.NullPointerException
	at
org.netbeans.modules.maven.execute.CommandLineOutputHandler.trimTree(CommandLine
OutputHandler.java:523)
	at
org.netbeans.modules.maven.execute.CommandLineOutputHandler.processExecEvent(Com
mandLineOutputHandler.java:431)
	at
org.netbeans.modules.maven.execute.CommandLineOutputHandler.access$300(CommandLi
neOutputHandler.java:90)
	at
org.netbeans.modules.maven.execute.CommandLineOutputHandler$Output.run(CommandLi
neOutputHandler.java:275)
	at org.openide.util.RequestProcessor$Task.run(RequestProcessor.java:1432)
Comment 1 Michel Graciano 2013-10-04 14:13:52 UTC
BTW, it works for 7.3.1.
Comment 2 Michel Graciano 2013-10-04 14:18:13 UTC
MVN command:
mvn -Psonar,arquillian-wildfly-remote clean verify sonar:sonar

The last lines in the console are:
...
[11:14:29.965] Sensor JaCoCoSensor done: 1 ms
[11:14:30.088] Execute decorators...
[11:14:30.174] Persist graphs of components
[11:14:30.461] ANALYSIS SUCCESSFUL, you can browse http://localhost:9000
[11:14:30.462] Executing post-job class org.sonar.plugins.jmeter.JMeterPostJob
[11:14:30.462] No JTL files found in target/jmeter-reportsnull
[11:14:30.462] Executing post-job class org.sonar.plugins.core.batch.IndexProjectPostJob
[11:14:31.057] Executing post-job class org.sonar.plugins.dbcleaner.ProjectPurgePostJob
[11:14:31.064] -> Keep one snapshot per day between 2013-09-06 and 2013-10-03
[11:14:31.065] -> Keep one snapshot per week between 2012-10-05 and 2013-09-06
[11:14:31.065] -> Keep one snapshot per month between 2008-10-10 and 2012-10-05
[11:14:31.065] -> Delete data prior to: 2008-10-10
[11:14:31.068] -> Clean Fly Contabilidade [id=1351]
[11:14:31.071] -> Clean Fly Planejamento [id=1352]

where the two final are gray. If I run in bash I have all the output printed as follow:
...
[INFO] [11:18:38.173] Sensor JaCoCoSensor done: 0 ms
[INFO] [11:18:38.283] Execute decorators...
[INFO] [11:18:38.356] Persist graphs of components
[INFO] [11:18:38.634] ANALYSIS SUCCESSFUL, you can browse http://localhost:9000
[INFO] [11:18:38.635] Executing post-job class org.sonar.plugins.jmeter.JMeterPostJob
[INFO] [11:18:38.636] No JTL files found in target/jmeter-reportsnull
[INFO] [11:18:38.636] Executing post-job class org.sonar.plugins.core.batch.IndexProjectPostJob
[INFO] [11:18:38.701] Executing post-job class org.sonar.plugins.dbcleaner.ProjectPurgePostJob
[INFO] [11:18:38.708] -> Keep one snapshot per day between 2013-09-06 and 2013-10-03
[INFO] [11:18:38.709] -> Keep one snapshot per week between 2012-10-05 and 2013-09-06
[INFO] [11:18:38.709] -> Keep one snapshot per month between 2008-10-10 and 2012-10-05
[INFO] [11:18:38.710] -> Delete data prior to: 2008-10-10
[INFO] [11:18:38.715] -> Clean Fly Contabilidade [id=1351]
[INFO] [11:18:38.718] <- Clean snapshot 17923
[INFO] [11:18:39.686] -> Clean Fly Planejamento [id=1352]
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO] 
[INFO] XYZ project ................................. SUCCESS [41.899s]
[INFO] ABC project .................................. SUCCESS [10.385s]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:01.192s
[INFO] Finished at: Fri Oct 04 11:18:39 BRT 2013
[INFO] Final Memory: 64M/722M
[INFO] ------------------------------------------------------------------------
Comment 3 Milos Kleint 2013-10-04 14:32:39 UTC
not a regression, the feature throwing exception was not implemented in 7.3
Comment 4 Michel Graciano 2013-10-04 19:05:33 UTC
*** Bug 236781 has been marked as a duplicate of this bug. ***
Comment 5 Michel Graciano 2013-10-04 19:24:55 UTC
Issue #236781 was generated using daily builds.
Comment 6 Michel Graciano 2013-10-04 20:14:07 UTC
Created attachment 140824 [details]
Debuging UI

I have debugged the process and found out that currentTreeNode.getStartEvent() returns null. i will attach a super simple patch soon.
Comment 7 Michel Graciano 2013-10-04 20:16:59 UTC
Created attachment 140825 [details]
Super simple patch

I have tried to fix the issue with this super simple patch. I have seen that sonar goal is marked as failed at my 'Show Build Overview'. I was not able to reproduce this issue for other projects yet, that is why I tried to debug it.
Comment 8 Michel Graciano 2013-10-04 20:22:53 UTC
Just to be clear, the Build Overview shows this goal as failed even if the NPE happens or not, in other words, the patch works only to avoid the NPE, but looks like it isn't enough. I will try to investigate it more later.
Comment 9 Milos Kleint 2013-10-07 08:16:28 UTC
which version of the sonar plugin is being used? is the failing project publicly available?
Comment 10 Milos Kleint 2013-10-07 09:16:01 UTC
also please state what version of maven you are using, the bundled one?
Comment 11 Michel Graciano 2013-10-07 11:40:52 UTC
Here comes some information:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>sonar-maven-plugin</artifactId>
    <version>2.0</version>
</plugin>

Maven: 3.0.5 bundled with NB (I used it in the terminal too with success)

The project is not publicly available. I am still trying to reproduce it, but for now I wasn't able to reproduce the problem.
Comment 12 Milos Kleint 2013-10-07 13:25:56 UTC
http://hg.netbeans.org/core-main/rev/f5f77f2d3cbe

the sonar mojo executes a new build internally, wrapping a build inside a build and confusing our IDE message system, fixed by ignoring the inner build.

a candidate for a patch update release
Comment 13 Tomas Danek 2013-11-04 14:53:56 UTC
in 7.4, I get NPE (from duplicate #236781)...In recent Dev, no NPE is thrown and log is complete while executing goals 'clean verify sonar:sonar' from IDE.

Product Version: NetBeans IDE Dev (Build 201311040001)
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.9 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/dev
Cache directory: /Users/tomas/Library/Caches/NetBeans/dev

+ Sonar 3.7.3, sonar plugin 3.7.2
Comment 14 Milos Kleint 2013-11-13 10:30:26 UTC
http://hg.netbeans.org/releases/rev/b5551194af13
Comment 15 Quality Engineering 2013-11-14 14:30:27 UTC
Integrated into 'releases/release74', will be available in build *201311141216* or newer. Wait for official and publicly available build.

Changeset: http://hg.netbeans.org/releases/rev/b5551194af13
User: Milos Kleint <mkleint@netbeans.org>
Log: #236768 guard against the mojo code executing new mvn build in-JVM, as is sonar doing. The inner build will not generate events.
Comment 16 Tomas Danek 2013-11-22 13:08:03 UTC
verified in 

Product Version: NetBeans IDE 7.4 (Build 201310111528)
Updates: NetBeans IDE is updated to version NetBeans 7.4 Patch 1
Java: 1.7.0_45; Java HotSpot(TM) 64-Bit Server VM 24.45-b08
Runtime: Java(TM) SE Runtime Environment 1.7.0_45-b18
System: Mac OS X version 10.9 running on x86_64; UTF-8; en_US (nb)
User directory: /Users/tomas/Library/Application Support/NetBeans/7.4
Cache directory: /Users/tomas/Library/Caches/NetBeans/7.4