You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by SanderW <sa...@performancearchitecten.nl> on 2011/08/26 11:42:29 UTC

While loop keeps getting StringIndexOutOfBoundsException's

Hi All,

I have the following script;

Thread Group
-While variable <> <EOF>
--CSV Data Set Config
--IF variable <> <EOF>
---Debug Sampler
---HTTP Request with variable as Path

The csv-file contains a lot of url's that are used in the HTTP Sampler.
One of the url's apparantly is causing a problem and in the JMeter.log I see
the following error occur:

/2011/08/26 11:06:13 WARN  - jmeter.protocol.http.sampler.HTTPSamplerBase:
Existing CookieManager HTTP Cookie Manager superseded by HTTP Cookie Manager 
2011/08/26 11:06:13 WARN  - jmeter.protocol.http.sampler.HTTPSamplerBase:
Existing CacheManager HTTP Cache Manager superseded by HTTP Cache Manager 
2011/08/26 11:06:13 WARN  - jmeter.protocol.http.sampler.HTTPSamplerBase:
Existing HeaderManager 'HTTP Header Manager:HTTP Header Manager' merged with
'HTTP Header Manager' 
2011/08/26 11:06:13 ERROR - jmeter.threads.JMeterThread: Error while
processing sampler
'/someUrl/RedirectPage.aspx?page=TagFeaturePages%2FForms%2FAllTagsIndexPage%2Easpx&filename=AllTagsIndexPage%2Easpx&pagetitle=Tags%20Index&parameters=weburl%3D%5Bsite%20collection%5D%26listname%3DTags%20Collection%26Source%3Dhttp%3A%2'
: java.lang.StringIndexOutOfBoundsException: String index out of range: 206
	at java.lang.String.charAt(Unknown Source)
	at sun.net.www.ParseUtil.isEscaped(Unknown Source)
	at sun.net.www.ParseUtil.quote(Unknown Source)
	at sun.net.www.ParseUtil.appendSchemeSpecificPart(Unknown Source)
	at sun.net.www.ParseUtil.toString(Unknown Source)
	at sun.net.www.ParseUtil.createURI(Unknown Source)
	at sun.net.www.ParseUtil.toURI(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.connect(Unknown Source)
	at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown
Source)
	at sun.net.www.protocol.http.HttpURLConnection.getHeaderField(Unknown
Source)
	at
org.apache.jmeter.protocol.http.sampler.HTTPSampler.disconnect(HTTPSampler.java:605)
	at
org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:599)
	at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:965)
	at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:951)
	at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:348)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:243)
	at java.lang.Thread.run(Unknown Source)/

After some investigation I found out the last characters %2 is causing the
problem. The url can be opened in a browser, but JMeter seems to have a
problem.

The real problem I'm facing is that each other url is failing also with the
same error. In the debug sampler I can see that the variable is updated with
the next row, but still the HTTP Sampler is getting the same error as given
above.

Does anyone have an idea how to fix this?

Kind Regards,

Sander

--
View this message in context: http://jmeter.512774.n5.nabble.com/While-loop-keeps-getting-StringIndexOutOfBoundsException-s-tp4737566p4737566.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: While loop keeps getting StringIndexOutOfBoundsException's

Posted by SanderW <sa...@performancearchitecten.nl>.
No, send parameters with request are not present.
The path contains the url with the parameters, since they were captured from
the source with a spider script.

But you did send me in the right direction. 

*First attempt*
I just tried to record the url with the HTTP Proxy Server and the first time
I saw got a 'Server broke' message in IE. This was when I entered the url
'/someUrl/_layouts/KWizCom_TaggingFeature/RedirectPage.aspx?page=TagFeaturePages%2FForms%2FAllTagsIndexPage%2Easpx&filename=AllTagsIndexPage%2Easpx&pagetitle=Tags%20Index¶meters=weburl%3D%5Bsite%20collection%5D%26listname%3DTags%20Collection%26Source%3Dhttp%3A%2'
directly in IE. 

JMeter recorded the following HTTP Request:
/Path: /someurl/TagFeaturePages/Forms/AllTagsIndexPage.aspx
Parameters with request:
weburl = [site%20collection] *Encode not ticked*
listname = Tags%20Collection *Encode not ticked*
Source = http%3A%2 *Encode not ticked*/

Replaying the recorded script failed, but when I ticked the Encode option
for parameter Source the request was successful.

*Second attempt*
I tried recording a different way. Now I started recording the page which
contains a link to the failing page. In the source of the page I see that
the url is exactly the same as the one I tried in the first attempt.
When I click the link I get a 501 Not Implemented/505 Version Not Supported
in IE.

JMeter recorded the following HTTP request:
/Path: /someUrl/_layouts/KWizCom_TaggingFeature/RedirectPage.aspx
Parameters with request:
page = TagFeaturePages/Forms/AllTagsIndexPage.aspx *Encode ticked*
filename = AllTagsIndexPage.aspx *Encode not ticked*
pagetitle = Tags Index *Encode ticked*
parameters = weburl=[site collection]&listname=Tags
Collection&Source=http%3A%2 *Encode ticked*/

Replaying the script fails, but unticking the last parameter 'parameters'
lets the script pass.

*Conclusion:*
Since the csv data config contains the url (including the parameters) I will
probably have to encode the variable used in the path


--
View this message in context: http://jmeter.512774.n5.nabble.com/While-loop-keeps-getting-StringIndexOutOfBoundsException-s-tp4737566p4738220.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: While loop keeps getting StringIndexOutOfBoundsException's

Posted by evanphelan <ev...@gmail.com>.
In /Send Parameters with Request/, do you have the /Encode /checkbox ticked?

--
View this message in context: http://jmeter.512774.n5.nabble.com/While-loop-keeps-getting-StringIndexOutOfBoundsException-s-tp4737566p4738104.html
Sent from the JMeter - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org