sexta-feira, 25 de maio de 2012

Hudson on Tomcat: Subversion Plugin Fails to Connect Behind Proxy

I bumped into an annoying problem working with Hudson 2.2.0 on Tomcat 7.0: Subversion plugin could not connect to SVN server because proxy server required authentication. See below a short version of the error message displayed by Hudson:

FAILED: org.tmatesoft.svn.core.SVNErrorMessage: svn: OPTIONS /svn/system/trunk/app failed
org.tmatesoft.svn.core.SVNException: svn: OPTIONS /svn/system/trunk/app failed
 at org.tmatesoft.svn.core.internal.io.dav.http.HTTPConnection.request(HTTPConnection.java:294)
... 

Hudson offers a way to enter proxy settings but they have no effect on Subversion plugin. Anyway, I didn't want Subversion plugin to use proxy because my SVN server was on the same local network. So, where to change proxy setting for Subversion plugin on Hudson?

After days trying to make it work, I came up to a workaround to that problem. Though it's the weirdest solution ever, it solved my problem. On Tomcat, I also had Nexus 2.0.4 running. Using the trial and error method, I realised that right after entering proxy settings on Nexus (yes, I mean right on Nexus), Subversion plugin on Hudson failed to connect to the SVN server. Although proxy settings on Nexus were all right, I hadn't  included the SVN server as a non proxy host (of course not ... why should I have to on Nexus?). After entering the SVN server address as a non proxy host on Nexus, the Subversion plugin on Hubson worked right away.

Somebody might say that it had to do with JVM proxy settings, but it seemed to be set properly though.

Later, I had to install the same softwares, including same versions, on another machine. And guess what? Everything worked fine the way it should be. So I had the opportunity to compare Tomcat, JVM, Nexus, Hudson and OS settings but all proxy settings were the same.

I am still clueless.