0

I am running sonar ant task within the project's build XML file. The project building is done from the Hudson job. But occurred with below exception:

[sonar:sonar] 17:57:00.994 WARN  - [JOURNAL_FLUSHER] WARNING Journal flush operation took 3,655ms last 8 cycles average is 457ms
[sonar:sonar] 17:58:40.972 WARN  - [JOURNAL_FLUSHER] WARNING Journal flush operation took 3,680ms last 8 cycles average is 461ms
[sonar:sonar] 18:00:47.808 WARN  - [JOURNAL_FLUSHER] WARNING Journal flush operation took 17,739ms last 8 cycles average is 2,217ms
[sonar:sonar] 18:01:12.556 WARN  - [JOURNAL_FLUSHER] WARNING Journal flush operation took 19,645ms last 8 cycles average is 4,673ms
[sonar:sonar] 18:09:46.711 WARN  - [JOURNAL_FLUSHER] WARNING Journal flush operation took 22,400ms last 8 cycles average is 2,800ms

BUILD FAILED
    java.lang.NoSuchMethodError: java.lang.reflect.InvocationTargetException.targetLjava/lang/Throwable;
    at java.lang.reflect.InvocationTargetException.<init>(InvocationTargetException.java:54)
    at sun.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
    at org.apache.tools.ant.Task.perform(Task.java:348)
    at org.apache.tools.ant.Target.execute(Target.java:390)
    at org.apache.tools.ant.Target.performTasks(Target.java:411)
    at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
    at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
    at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
    at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
    at org.apache.tools.ant.Main.runBuild(Main.java:809)
    at org.apache.tools.ant.Main.startAnt(Main.java:217)
    at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
    at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
Zubair Ahmed
  • 147
  • 4
  • 13
  • Stacktrace looks incomplete. Perhaps run ANT in debug mode and see if more information can be displayed which might assist Sonarqube to troubleshoot the problem. – Mark O'Connor Nov 20 '13 at 21:31

1 Answers1

0

What versions of Sonar and Ant are you using? It seems that those versions are not right. Check what Ant version Sonar expects.

user987339
  • 10,519
  • 8
  • 40
  • 45
  • Thanks for prompt response. I am using `sonar ant task version 2.1` and as per the documentation it requires `Ant 1.7.1 or higher` where as my ant version is 1.8.2 – Zubair Ahmed Nov 20 '13 at 13:54
  • I won’t use Ant if I have a choice of choosing my build tool to support Sonar analysis. Ant is very outdated when it comes to build. Can you use Maven or Gradle? – user987339 Nov 20 '13 at 14:06
  • @user987339 Try and convert a non-trivial ANT build to Maven (or Gradle) some time and you'll understand why it's rarely an option :-( – Mark O'Connor Nov 20 '13 at 21:19
  • @Mark O'Connor I've converted few projects already, and I know how painful it is :-( This was just suggestion, and I am glad that we agree on complexity of the conversion. – user987339 Nov 20 '13 at 21:36
  • @user987339 I cannot change this process. Our business is running on this environment since eras. We have a build box on which Hudson is configured with nightly jobs to build the active releases from svn trunk. And after successful building of each module in every single release it builds the whole EAR for the product and then deploy to the appropriate stagging environments. So practically the suggestion won't help. Can any one let me know where exactly is this issue occurring from...? – Zubair Ahmed Nov 21 '13 at 07:39