Missing WWW-Authenticate header

Lalit Kumar Garg <[email protected]> Mon, 13 Oct 2014 16:20:51 -0400
Newsgroups gmane.comp.java.grinder.user
Message-ID <CAN3ha8MSY_j=ZPMP6ih7_jaq6aJNVsFJiM5WCTjbWOdjVXvhMQ@mail.gmail.com>
Hi Philip,

I am newbie to nGrinder. I was trying to do the Http calls by GET, PUT
operations.
When I run the script multiple times, I am getting
"java.net.ProtocolException: Missing WWW-Authenticate header" error,
and this seems to be due to HTTP response code 401.

I was doubting this because of Connection status being "Keep-Alive". I
tried closing the connection by changing
the grinder.properties file and also by modifying the script. Both does not
work.

I have attached the script, error log and the grinder.properties file
reference. Any help to get rid of the "Missing WWW-Authenticate header"
would be of a great help.

Thanks much in advance,
Lalit

------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho

_______________________________________________
grinder-use mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/grinder-use
error log.txt (text/plain, 1.5 KB)
2014-10-10 17:56:19,495 INFO  *** GET AUTH REQ=<Undefined URL>
x-auth-token: AUTH_tkc932930ff4c9423497b8f369ecac9550

,RESP=HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Connection: Keep-Alive
Date: Fri, 10 Oct 2014 17:56:18 GMT
X-Auth-Token: AUTH_tkc932930ff4c9423497b8f369ecac9550
X-Storage-Url: <myUrl>
Content-Length: 137
Server: Cisco/Object Store/0.2

2014-10-10 17:56:19,496 ERROR Aborted run: Java exception calling TestRunner
net.grinder.scriptengine.jython.JythonScriptExecutionException: Java exception calling TestRunner
	fetchFileResult = authReq.GET(str(putUrl) +"/%s" %(str(putFile)))
	File "/home/tester/.ngrinder_agent/file-store/admin/current/TestLoop.py", line 112, in __call__
java.net.ProtocolException: Missing WWW-Authenticate header
	at HTTPClient.AuthorizationModule.handle_auth_challenge(AuthorizationModule.java:484) ~[grinder-httpclient-3.9.1.jar:na]
	at HTTPClient.AuthorizationModule.responsePhase2Handler(AuthorizationModule.java:363) ~[grinder-httpclient-3.9.1.jar:na]
	at HTTPClient.HTTPResponse.handleResponse(HTTPResponse.java:757) ~[grinder-httpclient-3.9.1.jar:na]
	at HTTPClient.HTTPResponse.getData(HTTPResponse.java:510) ~[grinder-httpclient-3.9.1.jar:na]
	at net.grinder.plugin.http.HTTPRequest$AbstractRequest.getHTTPResponse(HTTPRequest.java:1290) ~[grinder-http-3.9.1.jar:na]
	at net.grinder.plugin.http.HTTPRequest.GET(HTTPRequest.java:499) ~[grinder-http-3.9.1.jar:na]
	at net.grinder.plugin.http.HTTPRequest.GET(HTTPRequest.java:445) ~[grinder-http-3.9.1.jar:na]
grinder-properties file.txt (text/plain, 421 B)
grinder.runs=0
grinder.jvm=java
grinder.numberOfOldLogs=1
grinder.useConsole=true
grinder.reportToConsole.interval=500
grinder.sleepTimeFactor=1
grinder.sleepTimeVariation=0.2
grinder.logProcessStreams=true
grinder.reportTimesToConsole=true
grinder.debug.singleprocess=false
grinder.dcrinstrumentation=true
grinder.disablePersistentConnections=true
grinder.plugin.parameter.disablePersistentConnections=true
script.txt (text/plain, 1.1 KB)
# -*- coding:utf-8 -*-

# A simple example using the HTTP plugin that shows the retrieval of a
# single page via HTTP. 
#
# This script is automatically generated by ngrinder.
#
# @author admin
from HTTPClient import NVPair
from HTTPClient import HTTPConnection
from net.grinder.script.Grinder import grinder
from net.grinder.script import Test
from net.grinder.plugin.http import HTTPRequest
from net.grinder.plugin.http import HTTPPluginControl

HOST_NAME="<myUrl>"
URL="<myUrl>"

class TestRunner:
	def __call__(self):
		control = HTTPPluginControl.getConnectionDefaults()
		control.setDefaultHeaders(( NVPair('Accept','text/html'),NVPair('Host',HOST_NAME),))
		t=Test(1000,"www.google.com with no additional headers")
		authReq = HTTPRequest()
		t.wrap(authReq)
		headerParameters = (NVPair("x-auth-user","lab-account:lab-user"),NVPair("x-auth-key","value"),)
		authReq.setHeaders(headerParameters)
		control.close()
		HTTPPluginControl.getThreadConnection(URL).close()
		resp = authReq.GET(URL)
		HTTPPluginControl.getThreadConnection(URL).close()
		control.close()
		grinder.logger.info("Req =%s\n Res=%s" %(authReq, resp))