While working on a new project, I ran into an issue when running a Maven plugin connecting to a local web service. The dreaded Service unavailable error message appeared over and over again.

As this project had a complicated setup and running the the curl version of this maven plugin was successful I turned on the debug mode of Maven. Only thing you need to do is add the -Xswitch to your maven command.

# note the -X at the end
mvn content-package:install -P autoInstallPackage -X

It generated lots of output until I noticed this:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
[DEBUG] >> "POST http://localhost:4502/crx/packmgr/service.jsp HTTP/1.1[\r][\n]"
[DEBUG] Adding Host request header
[DEBUG] >> "referer: about:blank[\r][\n]"
[DEBUG] >> "Proxy-Authorization: Basic Rzg1Njk5OkJlZ3pfMDI1MjQ=[\r][\n]"
[DEBUG] >> "Authorization: Basic YWRtaW46YWRtaW4=[\r][\n]"
[DEBUG] >> "User-Agent: Jakarta Commons-HttpClient/3.1[\r][\n]"
[DEBUG] >> "Host: localhost:4502[\r][\n]"
[DEBUG] >> "Proxy-Connection: Keep-Alive[\r][\n]"
[DEBUG] >> "Expect: 100-continue[\r][\n]"
[DEBUG] >> "Content-Length: 138347[\r][\n]"
[DEBUG] >> "Content-Type: multipart/form-data; boundary=GEIXKZv7_qHCpGLDmc4DARFJgP3kHJDDu[\r][\n]"
[DEBUG] >> "[\r][\n]"
[DEBUG] << "HTTP/1.1 503 Service Unavailable[\r][\n]"

I was surprised by line 4 - the proxy authorization header. I didn’t use this header in the curl, so this was probably the issue. Turning off the proxy for this Maven plugin did fix the issue: the Service unavailable error message was gone!