Axis2 error after updating from Xerces 2.9.1 to 2.10.0 - websphere

When I upgrade from Xerces 2.9.1 to 2.10.0 I get the following Axis2 error:
[exec] [junit] org.apache.axiom.om.OMException: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'E' (code 69) in prolog; expected '<'
[exec] [junit] at [row,col {unknown-source}]: [1,1]
[exec] [junit] at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:296)
[exec] [junit] at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.getSOAPEnvelope(StAXSOAPModelBuilder.java:198)
[exec] [junit] at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:154)
[exec] [junit] at org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder.<init>(StAXSOAPModelBuilder.java:140)
[exec] [junit] at org.apache.axis2.builder.BuilderUtil.getSOAPBuilder(BuilderUtil.java:686)
[exec] [junit] at org.apache.axis2.transport.TransportUtils.createDocumentElement(TransportUtils.java:197)
[exec] [junit] at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:145)
[exec] [junit] at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:108)
[exec] [junit] at org.apache.axis2.transport.TransportUtils.createSOAPMessage(TransportUtils.java:67)
[exec] [junit] at org.apache.axis2.description.RobustOutOnlyAxisOperation$RobustOutOnlyOperationClient.handleResponse(RobustOutOnlyAxisOperation.java:81)
[exec] [junit] at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:421)
[exec] [junit] at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:229)
[exec] [junit] at org.apache.axis2.client.OperationClient.execute(OperationClient.java:165)
[exec] [junit] at wsconnector.Axis2DocWebServiceTestBPOStub.addStruct(Axis2DocWebServiceTestBPOStub.java:2997)
[exec] [junit] at tests.webservices.Axis2WSConnectorTest.testAxis2DOWS(Axis2WSConnectorTestClass.java:220)
[exec] [junit] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[exec] [junit] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:90)
[exec] [junit] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:55)
[exec] [junit] at java.lang.reflect.Method.invoke(Method.java:508)
[exec] [junit] at junit.framework.TestCase.runTest(TestCase.java:168)
[exec] [junit] at junit.framework.TestCase.runBare(TestCase.java:134)
[exec] [junit] at junit.framework.TestResult$1.protect(TestResult.java:110)
[exec] [junit] at junit.framework.TestResult.runProtected(TestResult.java:128)
[exec] [junit] at junit.framework.TestResult.run(TestResult.java:113)
[exec] [junit] at junit.framework.TestCase.run(TestCase.java:124)
[exec] [junit] at junit.framework.TestSuite.runTest(TestSuite.java:243)
[exec] [junit] at junit.framework.TestSuite.run(TestSuite.java:238)
[exec] [junit] at junit.framework.TestSuite.runTest(TestSuite.java:243)
[exec] [junit] at junit.framework.TestSuite.run(TestSuite.java:238)
[exec] [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.run(JUnitTestRunner.java:534)
[exec] [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.launch(JUnitTestRunner.java:1196)
[exec] [junit] at org.apache.tools.ant.taskdefs.optional.junit.JUnitTestRunner.main(JUnitTestRunner.java:1041)
[exec] [junit] Caused by: com.ctc.wstx.exc.WstxUnexpectedCharException: Unexpected character 'E' (code 69) in prolog; expected '<'
[exec] [junit] at [row,col {unknown-source}]: [1,1]
[exec] [junit] at com.ctc.wstx.sr.StreamScanner.throwUnexpectedChar(StreamScanner.java:648)
[exec] [junit] at com.ctc.wstx.sr.BasicStreamReader.nextFromProlog(BasicStreamReader.java:2047)
[exec] [junit] at com.ctc.wstx.sr.BasicStreamReader.next(BasicStreamReader.java:1069)
[exec] [junit] at org.apache.axiom.util.stax.wrapper.XMLStreamReaderWrapper.next(XMLStreamReaderWrapper.java:225)
[exec] [junit] at org.apache.axiom.om.impl.builder.StAXOMBuilder.parserNext(StAXOMBuilder.java:668)
[exec] [junit] at org.apache.axiom.om.impl.builder.StAXOMBuilder.next(StAXOMBuilder.java:214)
It's trying to call a web service in a unit test, looks like it calls but then there is an error parsing the response from the web server. Seems like the "E" may be the first letter of an Error 500 page that the server is sending. I'm trying to upgrade to Xerces 2.12.2 but this error occurs between Xerces 2.9.1 and 2.10.0 on WebSphere. I'm wondering if anyone might be able to shed some light on it. I've been looking into potentially modifying axis2.xml but I'd like to understand things better before attempting changes.
Cheers.

Related

SonarQube failed to analyze my solution

I'm trying to setup SonarQube for my open source project but I've difficulties to automatize the process with my CI (AppVeyor).
SonarQube analysis failed with no more details except that I have to look at the log. But I don't know where to look at to find them. I've tried to do remote on the AppVeyor VM but I haven't anything relevant. Logs in the .sonarqube folder contain no more information that the one printed on the AppVeyor output.
Since it's the first time I tried to add SonarQube to a project, I have no clue where to look at. I've searched the error on internet without success.
Here is a part of the error I get on AppVeyor output:
[exec] 14:14:38.867 INFO: Analysis report generated in 421ms, dir size=436 KB
[exec] 14:14:39.012 INFO: Analysis reports compressed in 143ms, zip size=230 KB
[exec] 14:14:39.012 INFO: Analysis report generated in C:\projects\markify\src\.sonarqube\out\.sonar\scanner-report
[exec] 14:14:39.012 DEBUG: Upload report
[exec] 14:14:39.225 DEBUG: POST 403 https://sonarcloud.io/api/ce/submit?projectKey=Markify&projectName=Markify | time=212ms
[exec] 14:14:39.234 INFO: ------------------------------------------------------------------------
[exec] 14:14:39.234 INFO: EXECUTION FAILURE
[exec] ##teamcity[buildProblem description='Analysis Failed: Check Build Log']]
[exec] 14:14:39.234 INFO: ------------------------------------------------------------------------
[exec] 14:14:39.234 INFO: Total time: 35.907s
[exec] 14:14:39.324 ERROR: Error during SonarQube Scanner execution
[exec] 14:14:39.324 ERROR: Insufficient privileges
[exec] 14:14:39.324 ERROR:
[exec] 14:14:39.324 ERROR: Re-run SonarQube Scanner using the -X switch to enable full debug logging.
[exec] 14:14:39.323 INFO: Final Memory: 69M/168M
[exec] 14:14:39.324 INFO: ------------------------------------------------------------------------
[exec] 14:14:39.324 DEBUG: Execution getVersion
[exec] 14:14:39.325 DEBUG: Execution stop
[exec] Process returned exit code 1
[exec] The SonarQube Scanner did not complete successfully
[exec] 14:14:39.535 Creating a summary markdown file...
[exec] 14:14:39.537 Post-processing failed. Exit code: 1
[exec] [EndPhase] : Failed. Check Log
[exec] ##teamcity[buildProblem description='sonar-scanner return non 0 error code']]
[exec] [CxxSonarQubeMsbuidRunner] Failed analyze project, check log
BUILD FAILED
And here a build where the analysis has failed : https://ci.appveyor.com/project/Takumii/markify/build/1.0.501
The project can be found here : https://github.com/Julien-Pires/Markify/tree/sonarqube
I'm using NAnt to execute the Sonarqube analysis. All parameters used for Sonarqube can be found here: https://github.com/Julien-Pires/Markify/blob/sonarqube/default.build
[exec] 14:14:39.324 ERROR: Error during SonarQube Scanner execution
[exec] 14:14:39.324 ERROR: Insufficient privileges
This suggest a permission issue, as I detailed before in this answer.
See "Authorization / Group" to check if you have the necessary permission to post a SonarQube analysis.
Please sure that, you have necessary access rights to the sonarqube server where u are trying to post your analysis report.

Building Hadoop on windows 7, can't copy files

Trying to install hadoop 2.7.1 on windows, it has been a nightmare but finally gotten to the part where the distribution part is failing to build. Can't seem to work out why it won't copy the files, the stack trace is below: (also is it a permissions error?)
main:
Property "#" has not been set
Property "#" has not been set
[exec] Current OS is Windows 7
[exec] Executing 'sh' with arguments:
[exec] './dist-layout-stitching.sh'
[exec]
[exec] The ' characters around the executable and arguments are
[exec] not part of the command.
Execute:Java13CommandLauncher: Executing 'sh' with arguments:
'./dist-layout-stitching.sh'
The ' characters around the executable and arguments are
not part of the command.
[exec]
[exec] Current directory /cygdrive/d/Hadoop/hadoop-2.7.1-src/hadoop-dist/target
[exec]
[exec] $ rm -rf hadoop-2.7.1
[exec] $ mkdir hadoop-2.7.1
[exec] $ cd hadoop-2.7.1
[exec] $ cp /cygdrive/d/Hadoop/hadoop-2.7.1-src/LICENSE.txt .
[exec] $ cp /cygdrive/d/Hadoop/hadoop-2.7.1-src/NOTICE.txt .
[exec] $ cp /cygdrive/d/Hadoop/hadoop-2.7.1-src/README.txt .
[exec] $ cp -r /cygdrive/d/Hadoop/hadoop-2.7.1-src/hadoop-common-project/hadoop-common/target/hadoop-common-2.7.1/bin /cygdrive/d/Hadoop/hadoop-2.7.1-src/hadoop-common-project/hadoop-common/target/hadoop-common-2.7.1/etc /cygdrive/d/Hadoop/hadoop-2.7.1-src/hadoop-common-project/hadoop-common/target/hadoop-common-2.7.1/libexec /cygdrive/d/Hadoop/hadoop-2.7.1-src/hadoop-common-project/hadoop-common/target/hadoop-common-2.7.1/sbin /cygdrive/d/Hadoop/hadoop-2.7.1-src/hadoop-common-project/hadoop-common/target/hadoop-common-2.7.1/share .
[exec] $ cp -r /cygdrive/d/Hadoop/hadoop-2.7.1-src/hadoop-common-project/hadoop-nfs/target/hadoop-nfs-2.7.1/share .
[exec] $ cp -r /cygdrive/d/Hadoop/hadoop-2.7.1-src/hadoop-hdfs-project/hadoop-hdfs/target/hadoop-hdfs-2.7.1/* .
[exec]
[exec] Failed!
[exec]
[exec] cp: cannot stat ‘/cygdrive/d/Hadoop/hadoop-2.7.1-src/hadoop-hdfs-project/hadoop-hdfs/target/hadoop-hdfs-2.7.1/*’: No such file or directory
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 9.247 s
[INFO] Finished at: 2015-08-09T12:39:00+00:00
[INFO] Final Memory: 35M/212M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (dist) on project hadoop-dist: An Ant BuildException has occured: exec returned: 1
[ERROR] around Ant part ...<exec dir="D:\Hadoop\hadoop-2.7.1-src\hadoop-dist\target" executable="sh" failonerror="true">... # 38:96 in D:\Hadoop\hadoop-2.7.1-src\hadoop-dist\target\antrun\build-main.xml
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-antrun-plugin:1.7:run (dist) on project hadoop-dist: An Ant BuildException has occured: exec returned: 1
around Ant part ...<exec dir="D:\Hadoop\hadoop-2.7.1-src\hadoop-dist\target" executable="sh" failonerror="true">... # 38:96 in D:\Hadoop\hadoop-2.7.1-src\hadoop-dist\target\antrun\build-main.xml
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:216)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:108)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:76)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:116)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:361)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:155)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:584)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:213)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:157)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.MojoExecutionException: An Ant BuildException has occured: exec returned: 1
around Ant part ...<exec dir="D:\Hadoop\hadoop-2.7.1-src\hadoop-dist\target" executable="sh" failonerror="true">... # 38:96 in D:\Hadoop\hadoop-2.7.1-src\hadoop-dist\target\antrun\build-main.xml
at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:355)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:133)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
... 19 more
Caused by: D:\Hadoop\hadoop-2.7.1-src\hadoop-dist\target\antrun\build-main.xml:38: exec returned: 1
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:646)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:672)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:498)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
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.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:327)
... 21 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Removed cygwin from the path temporarily, rebuilt. It worked

Propagating exit code from exec'd batch file back to ant

I need to call sbt from ant. I'm doing this with the "exec" task as follows:
<target name="publish-jar">
<exec executable="sbt.bat" failonerror="true">
<arg value="publish"/>
</exec>
</target>
I need the ant task to "fail" if the sbt task fails, which is why failonerror="true" is being used. However, this does not work. When the sbt task fails, ant does not report a failed build.
This looks like the problem discussed here: Ant exec resultproperty is not working. The suggested workaround is to remove "/B" from the sbt.bat. In other words, change:
exit /B %ERROR_CODE%
to
exit %ERROR_CODE%
However, as one commenter states:
The downside of this is that if you run the batch file directly for testing it will terminate your shell. you could use an if and an arg in the batch file to select \b when ant calls it and normal exit when not.
Question: Is there a fix which, when a failure happens: (1) does not terminate the caller's shell AND (2) propagates the exit code to ant?
Update
Here is the output of running my ant task. The actual error is not important here (I'm purposely not configuring a repository to publish to, to force an error):
C:\dev\la\sdf3\modules\test>ant publish-jar
Buildfile: C:\dev\la\sdf3\modules\test\build.xml
publish-jar:
[exec] [info] Loading global plugins from C:\Users\jn\.sbt\0.13\plugins
[exec] [info] Set current project to test (in build file:/C:/dev/la/sdf3/modules/test/)
[exec] :: loading settings :: file = C:\dev\la\sdf3\modules\ivysettings.xml
[exec] [info] :: delivering :: com.jn#test;SNAPSHOT ::
SNAPSHOT :: integration :: Fri Mar 14 08:45:58 HST 2014
[exec] [info] delivering ivy file to C:\dev\la\sdf3\modules\com.jn\target\scala-2.10\ivy-SNAPSHOT.xml
[exec] java.lang.RuntimeException: Repository for publishing is not specified.
[exec] at scala.sys.package$.error(package.scala:27)
[exec] at sbt.Classpaths$$anonfun$getPublishTo$1.apply(Defaults.scala:1203)
[exec] at sbt.Classpaths$$anonfun$getPublishTo$1.apply(Defaults.scala:1203)
[exec] at scala.Option.getOrElse(Option.scala:120)
[exec] at sbt.Classpaths$.getPublishTo(Defaults.scala:1203)
[exec] at sbt.Classpaths$$anonfun$57.apply(Defaults.scala:1037)
[exec] at sbt.Classpaths$$anonfun$57.apply(Defaults.scala:1037)
[exec] at scala.Function1$$anonfun$compose$1.apply(Function1.scala:47)
[exec] at sbt.$tilde$greater$$anonfun$$u2219$1.apply(TypeFunctions.scala:42)
[exec] at sbt.std.Transform$$anon$4.work(System.scala:64)
[exec] at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
[exec] at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:237)
[exec] at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:18)
[exec] at sbt.Execute.work(Execute.scala:244)
[exec] at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
[exec] at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:237)
[exec] at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:160)
[exec] at sbt.CompletionService$$anon$2.call(CompletionService.scala:30)
[exec] at java.util.concurrent.FutureTask.run(FutureTask.java:262)
[exec] at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
[exec] at java.util.concurrent.FutureTask.run(FutureTask.java:262)
[exec] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
[exec] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
[exec] at java.lang.Thread.run(Thread.java:744)
[exec] [error] (*:publishConfiguration) Repository for publishing is not specified.
[exec] [error] Total time: 0 s, completed Mar 14, 2014 8:45:59 AM
BUILD SUCCESSFUL
Total time: 4 seconds
I just did a simple batch:
#echo off
echo [batch]
exit /b 2
And your ant script from above, and exec returned with the error code from my batch. Everything worked fine.
exec returned: 2
This was tested on:
Apache Ant(TM) version 1.9.3 compiled on December 23 2013 on Windows 7 64-bit
You should paste your batch file and the actual result you get from running your ant. Either there is something wrong with the version of Ant you are using, or (most likely) something wrong with the batch file.
Do the following
Run the sbt.bat publish from the command line
Immediately after that run echo %ERRORLEVEL% and note the result
If you are getting 0, your batch is the problem.
Edit:
Alternatively, there is an article here that describes a workaround with a macrodef

Sonar analysis fails with SocketTimeoutException

I'm having sporadic failures due to a SocketTimeoutException when trying to run Sonar from ant.
Setup: I've got Sonar 4.0 running on a RHEL 6 box configured to run with Postgres 9.2. I do a nightly build of 175 projects using Jenkins 1.544. I've had Jenkins building the projects serially with a single executor on a slave machine but recently I've added a second slave via swarm so now I have two nodes (each with a single executor), building in parallel. I run sonar from ant using the sonar ant task and this largely works pretty well.
When I just had a single slave I would occasionally have a job fail with a SocketTimeoutException when trying to load the bootstrap properties. Now that I've added a second node this seems to be happening much more frequently. Interestingly I have also seen the same failure when I build a project on the command line using ant. This does not seem to be a server resource issue. I'm the sole user of the sonar server and I'm able to get this error without any real load on it.
Here's the stack trace I got when running from the command line this morning:
[exec] BUILD FAILED
[exec] /var/lib/jenkins/sonar.buildfile:113: org.sonar.runner.impl.RunnerException: Unable to execute Sonar
[exec] at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:79)
[exec] at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:63)
[exec] at java.security.AccessController.doPrivileged(Native Method)
[exec] at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:57)
[exec] at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
[exec] at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:71)
[exec] at org.sonar.runner.api.Runner.execute(Runner.java:89)
[exec] at org.sonar.ant.SonarTask.launchAnalysis(SonarTask.java:53)
[exec] at org.sonar.ant.SonarTask.execute(SonarTask.java:48)
[exec] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
[exec] at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
[exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[exec] at java.lang.reflect.Method.invoke(Method.java:601)
[exec] at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
[exec] at org.apache.tools.ant.Task.perform(Task.java:348)
[exec] at org.apache.tools.ant.Target.execute(Target.java:392)
[exec] at org.apache.tools.ant.Target.performTasks(Target.java:413)
[exec] at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
[exec] at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
[exec] at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
[exec] at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
[exec] at org.apache.tools.ant.Main.runBuild(Main.java:811)
[exec] at org.apache.tools.ant.Main.startAnt(Main.java:217)
[exec] at org.apache.tools.ant.launch.Launcher.run(Launcher.java:280)
[exec] at org.apache.tools.ant.launch.Launcher.main(Launcher.java:109)
[exec] Caused by: org.sonar.api.utils.SonarException: Unable to request: /batch_bootstrap/properties?dryRun=false
[exec] at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:92)
[exec] at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:82)
[exec] at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:78)
[exec] at org.sonar.batch.bootstrap.BatchSettings.downloadSettings(BatchSettings.java:97)
[exec] at org.sonar.batch.bootstrap.BatchSettings.init(BatchSettings.java:72)
[exec] at org.sonar.batch.bootstrap.BatchSettings.<init>(BatchSettings.java:55)
[exec] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[exec] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[exec] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[exec] at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
[exec] at org.picocontainer.injectors.AbstractInjector.newInstance(AbstractInjector.java:145)
[exec] at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:342)
[exec] at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
[exec] at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
[exec] at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
[exec] at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
[exec] at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
[exec] at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:698)
[exec] at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
[exec] at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:631)
[exec] at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
[exec] at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
[exec] at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
[exec] at org.picocontainer.injectors.SingleMemberInjector.getMemberArguments(SingleMemberInjector.java:61)
[exec] at org.picocontainer.injectors.MethodInjector.getMemberArguments(MethodInjector.java:100)
[exec] at org.picocontainer.injectors.MethodInjector$2.run(MethodInjector.java:112)
[exec] at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
[exec] at org.picocontainer.injectors.MethodInjector.decorateComponentInstance(MethodInjector.java:120)
[exec] at org.picocontainer.injectors.CompositeInjector.decorateComponentInstance(CompositeInjector.java:58)
[exec] at org.picocontainer.injectors.Reinjector.reinject(Reinjector.java:142)
[exec] at org.picocontainer.injectors.ProviderAdapter.getComponentInstance(ProviderAdapter.java:96)
[exec] at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:698)
[exec] at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
[exec] at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:631)
[exec] at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
[exec] at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
[exec] at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
[exec] at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
[exec] at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
[exec] at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
[exec] at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
[exec] at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
[exec] at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
[exec] at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
[exec] at org.picocontainer.DefaultPicoContainer.getInstance(DefaultPicoContainer.java:698)
[exec] at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:646)
[exec] at org.picocontainer.DefaultPicoContainer.getComponent(DefaultPicoContainer.java:631)
[exec] at org.picocontainer.parameters.BasicComponentParameter$1.resolveInstance(BasicComponentParameter.java:118)
[exec] at org.picocontainer.parameters.ComponentParameter$1.resolveInstance(ComponentParameter.java:136)
[exec] at org.picocontainer.injectors.SingleMemberInjector.getParameter(SingleMemberInjector.java:78)
[exec] at org.picocontainer.injectors.ConstructorInjector$CtorAndAdapters.getParameterArguments(ConstructorInjector.java:309)
[exec] at org.picocontainer.injectors.ConstructorInjector$1.run(ConstructorInjector.java:335)
[exec] at org.picocontainer.injectors.AbstractInjector$ThreadLocalCyclicDependencyGuard.observe(AbstractInjector.java:270)
[exec] at org.picocontainer.injectors.ConstructorInjector.getComponentInstance(ConstructorInjector.java:364)
[exec] at org.picocontainer.injectors.AbstractInjectionFactory$LifecycleAdapter.getComponentInstance(AbstractInjectionFactory.java:56)
[exec] at org.picocontainer.behaviors.AbstractBehavior.getComponentInstance(AbstractBehavior.java:64)
[exec] at org.picocontainer.behaviors.Stored.getComponentInstance(Stored.java:91)
[exec] at org.picocontainer.DefaultPicoContainer.instantiateComponentAsIsStartable(DefaultPicoContainer.java:1033)
[exec] at org.picocontainer.DefaultPicoContainer.addAdapterIfStartable(DefaultPicoContainer.java:1025)
[exec] at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:1002)
[exec] at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:766)
[exec] at org.sonar.api.platform.ComponentContainer.startComponents(ComponentContainer.java:91)
[exec] at org.sonar.api.platform.ComponentContainer.execute(ComponentContainer.java:77)
[exec] at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:92)
[exec] at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:74)
[exec] at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45)
[exec] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
[exec] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
[exec] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
[exec] at java.lang.reflect.Method.invoke(Method.java:601)
[exec] at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:75)
[exec] ... 24 more
[exec] Caused by: java.net.SocketTimeoutException: Read timed out
[exec] at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
[exec] at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
[exec] at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
[exec] at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
[exec] at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1674)
[exec] at sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1672)
[exec] at java.security.AccessController.doPrivileged(Native Method)
[exec] at sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1670)
[exec] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1243)
[exec] at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
[exec] at org.sonar.api.utils.HttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(HttpDownloader.java:274)
[exec] at org.sonar.api.utils.HttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(HttpDownloader.java:235)
[exec] at org.sonar.batch.bootstrap.ServerClient.request(ServerClient.java:88)
[exec] ... 94 more
[exec] Caused by: java.net.SocketTimeoutException: Read timed out
[exec] at java.net.SocketInputStream.socketRead0(Native Method)
[exec] at java.net.SocketInputStream.read(SocketInputStream.java:150)
[exec] at java.net.SocketInputStream.read(SocketInputStream.java:121)
[exec] at java.io.BufferedInputStream.fill(BufferedInputStream.java:235)
[exec] at java.io.BufferedInputStream.read1(BufferedInputStream.java:275)
[exec] at java.io.BufferedInputStream.read(BufferedInputStream.java:334)
[exec] at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:633)
[exec] at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:579)
[exec] at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1322)
[exec] at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(HttpURLConnection.java:2677)
[exec] at java.net.URLConnection.getContentEncoding(URLConnection.java:533)
[exec] at org.sonar.api.utils.HttpDownloader$BaseHttpDownloader$HttpInputSupplier.getInput(HttpDownloader.java:272)
[exec] ... 96 more
[exec]
[exec] Total time: 23 seconds
I looked in the sonar access.log and can see the initial connection and redirect from the failure listed above:
172.20.2.172 - - [01/01/2014:09:45:25 -0500] "GET /api/server/version HTTP/1.1" 200 3 "-" "Ant/2.1"
172.20.2.172 - - [01/01/2014:09:45:26 -0500] "GET /batch_bootstrap/index HTTP/1.1" 302 125 "-" "Ant/2.1"
172.20.2.172 - - [01/01/2014:09:45:26 -0500] "GET /deploy/bootstrap/index.txt HTTP/1.1" 200 3899 "-" "Ant/2.1"
Interestingly I took a look at the log a bit later and it seems to show the failed connection 30 minutes after I had initiated the build:
172.20.2.172 - - [01/01/2014:09:45:25 -0500] "GET /api/server/version HTTP/1.1" 200 3 "-" "Ant/2.1"
172.20.2.172 - - [01/01/2014:09:45:26 -0500] "GET /batch_bootstrap/index HTTP/1.1" 302 125 "-" "Ant/2.1"
172.20.2.172 - - [01/01/2014:09:45:26 -0500] "GET /deploy/bootstrap/index.txt HTTP/1.1" 200 3899 "-" "Ant/2.1"
172.20.2.172 - - [01/01/2014:10:16:20 -0500] "GET /batch_bootstrap/properties?dryRun=false HTTP/1.1" 401 41 "-" "Sonar
null/null"
Now I am using the LDAP plugin to authenticate sonar users against active directory and I've read that that could cause some slowness, possibly resulting in a timeout. I added ncsd but haven't noticed any improvement. I also upgraded to use sonar-ant-task-2.1.jar but didn't see a change. I'm able to access /batch_bootstrap/properties?dryRun=false from my browser, although sometimes it takes longer then others. If I rerun a failed job it almost always succeeds on the second attempt.
I'm not sure what to try next. I'd like to scale up the number of swarm nodes but I'm afraid that will just result in more failures. I don't like having to tell developers to ignore build failure emails. Due to the number of jobs, I'm able to run into this issue with regularity. If anyone has logging or configuration changes that they think would help avoid or isolate the issue I'm open to trying them.
Thanks - Sam
Update: I created a short script to fetch /batch_bootstrap/properties?dryRun=false and send the result to /dev/null using curl. I set a the curl --max-time to 2 seconds and put it on a cron to run every 2 minutes. Almost every request completes before the 2 second timeout (only 26 failures over 48 hours, all from 00:30 - 01:00 when I have some maintenance tasks running). Since I started pinging the server this way I haven't had any more builds fail due to a SocketTimeoutException. I don't really like this as a solution but it seems to be working for now. I'm still interested in alternatives if anyone has one to try.
Update: I was able to back off the frequency of the cron to instead only run every 5 minutes without seeing the problem. When I tried only running it ever 10 minutes I saw the SocketTimeoutException failure again. I also ran a general yum update for good measure but that apparently hasn't improved things.
Thanks - Sam
Update: this got progressively worse with Sonar 4.5 when elasticsearch was broken out as a separate process. In the sonar log file I had several of these failures:
2014.12.24 03:42:28 ERROR web[o.s.s.s.SearchClient] could not execute request: org.elasticsearch.action.get.GetRequestBuilder#48c9ec56
org.elasticsearch.client.transport.NoNodeAvailableException: No node available
I recorded the load over time and found that it was getting higher than I had expected during the nightly build cycle. Still I didn't see any other weird behavior other than the sonar failures. Some new hardware recently became available so I moved sonar onto a new box all by itself. Since doing that all I haven't seen any more build failures related to timeouts.
So if anyone sees similar, errors of this type would seem to indicate that you need to dedicate more resources.
Thanks - Sam

Building Spring 3.0.1 - Failing Tests

I'm trying to build a patched version of Spring 3.0.1 but i'm facing test case failures. On analyzing further, i saw that the failing tests are the ones that have been marked as #Ignore, but still they seem to be executed.
What could be the problem?
Here's the steps that i've followed to build spring 3.0.1
git clone git://github.com/SpringSource/spring-framework.git
git checkout v3.0.1.RELEASE
Checked out https://src.springframework.org/svn/spring-build/trunk/project-build to a folder under the spring-framework folder using svn. Switched to the build-spring-framework directory. Created some directories with mkdir from the steps mentioned here.
set JAVA_HOME=E:\Syndev\JAVA6U24\JDK
set ANT_OPTS=-XX:MaxPermSize=256m -Xmx1024m
ant
Another thing I tried was to simply remove the failing tests/delete the test case files, but that led to the following exception further down the build.
[junit] Caused by: java.lang.ClassNotFoundException: org.springframework.beans.factory.aspectj.AnnotationBeanConfigurerAspect
[junit] at java.lang.ClassLoader.findClass(ClassLoader.java:359)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
[junit] at org.springframework.core.OverridingClassLoader.loadClass(OverridingClassLoader.java:70)
[junit] at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
[junit] at org.springframework.context.support.ContextTypeMatchClassLoader.loadClass(ContextTypeMatchClassLoader.java:63)
[junit] at org.springframework.util.ClassUtils.forName(ClassUtils.java:258)
[junit] at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1226)
[junit] at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1200)
[junit]
[junit]
[subant] Leaving directory: E:\Projects\github\spring-framework\org.springframework.orm
The issue seems to be documented here,
https://jira.springsource.org/browse/SPR-8089
https://jira.springsource.org/browse/SPR-8587
So the above exception from HibernateEntityManagerFactoryIntegrationTests.java and other exceptions in classes such as NotificationListenerTests.java, Log4jWebConfigurerTests.java should be fixed by simply deleting the tests from there.

Resources