Hi mindless,
If I use this code:
public static void main(String[] args) throws ParserConfigurationException,
SAXException, IOException
{
String uri =
"http://crafnanta:8081/hudson/view/Buttermere-Dev/job/MSXI%20Dev%20-%20Webstart%20Upload%20Scanner/build?token=build_me";
URLConnection connection = new URL(uri).openConnection();
connection.connect();
InputStream is = connection.getInputStream();
}
to trigger the page.
I will get this exception:
Exception in thread "main" java.io.FileNotFoundException:
http://crafnanta:8081/hudson/view/Buttermere-Dev/job/MSXI%20Dev%20-%20Webstart%20Upload%20Scanner/.
at
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1288)
at HttpTrigger.main(HttpTrigger.java:20)
And in Wireshark I can capture this:
GET
/hudson/view/Buttermere-Dev/job/MSXI%20Dev%20-%20Webstart%20Upload%20Scanner/.
HTTP/1.1
User-Agent: Java/1.6.0_10
Host: crafnanta:8081
Accept: text/html, image/gif, image/jpeg, ; q=.2, */; q=.2
Connection: keep-alive
HTTP/1.1 404 Not Found
X-Powered-By: Servlet/2.5
Server: Sun Java System Application Server 9.1_02
Set-Cookie: JSESSIONID=3d5060d18300086ba5f8a9a71fe6; Path=/hudson
Content-Type: text/html
Content-Language:
Content-Length: 1028
Date: Wed, 11 Nov 2009 15:20:38 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html><head><title>Sun Java
System Application Server 9.1_02 - Error report</title><style
type="text/css"><!--H1
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:22px;}
H2
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:16px;}
H3
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;font-size:14px;}
BODY
{font-family:Tahoma,Arial,sans-serif;color:black;background-color:white;}
B
{font-family:Tahoma,Arial,sans-serif;color:white;background-color:#525D76;}
P
{font-family:Tahoma,Arial,sans-serif;background:white;color:black;font-size:12px;}
A
{color : black;}
HR
{color : #525D76;}
--></style> </head><body><h1>HTTP Status
404 - </h1><hr/><p><b>type</b> Status
report</p><p><b>message</b></p><p><b>description</b>The requested resource () is
not available.</p><hr/><h3>Sun Java System Application Server
9.1_02</h3></body></html>
Hope this helps.
Thanks
After the build is triggered it sends a redirect back to the build page, so the
404 must be in following the redirect since you do see the build start. The
build page is html, not xml, so not sure a DocumentBuilder can parse it.