You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by chris <cm...@zonnet.nl> on 2007/01/10 15:52:18 UTC

while loop generates java.lang.StackOverflowError

I have also tried the while loop conditioned to CSV dataset,
but I get the following error:

In the while loop I use as a condition:

"${type}" == "<EOF>"

Where type is a variable from my CSV Data Set Config

2007/01/10 15:45:36 ERROR - jmeter.threads.JMeterThread: Test failed!
java.lang.StackOverflowError
	at java.lang.String.indexOf(Unknown Source)
	at java.lang.ClassLoader.checkName(Unknown Source)
	at java.lang.ClassLoader.findLoadedClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
	at java.lang.ClassLoader.loadClass(Unknown Source)
       


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


Re: while loop generates java.lang.StackOverflowError

Posted by Alexander Wallace <aw...@rwmotloc.com>.
excellent tips... thanks a lot!

On Jan 10, 2007, at 10:45 AM, sebb wrote:

> ${__BeanShell(!"<EOF>".equals("${type}"))}


Re: while loop generates java.lang.StackOverflowError

Posted by sebb <se...@gmail.com>.
vars.get("type")

could be replaced by:

"${type}"

Indeed one could put:

${__BeanShell(!"<EOF>".equals("${type}"))}

as BeanShell will convert the boolean to its text equivalent.

Or similarly using Javascript:

${__javaScript("<EOF>" != "${type}")}

On 10/01/07, Alexander Wallace <aw...@rwmotloc.com> wrote:
> this is how i did it:
>
> ${__BeanShell(return (vars.get("type").equals("<EOF>") ? "false" :
> "true") ;)}
>
>
> On Jan 10, 2007, at 8:52 AM, chris wrote:
>
> > I have also tried the while loop conditioned to CSV dataset,
> > but I get the following error:
> >
> > In the while loop I use as a condition:
> >
> > "${type}" == "<EOF>"
> >
> > Where type is a variable from my CSV Data Set Config
> >
> > 2007/01/10 15:45:36 ERROR - jmeter.threads.JMeterThread: Test failed!
> > java.lang.StackOverflowError
> >       at java.lang.String.indexOf(Unknown Source)
> >       at java.lang.ClassLoader.checkName(Unknown Source)
> >       at java.lang.ClassLoader.findLoadedClass(Unknown Source)
> >       at java.lang.ClassLoader.loadClass(Unknown Source)
> >       at java.lang.ClassLoader.loadClass(Unknown Source)
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


Re: threads and loops, WAS: while loop generates java.lang.StackOverflowError

Posted by Alexander Wallace <aw...@rwmotloc.com>.
Excellent... that sounds like a good option to me (the multiple data  
files) .... Perhaps once i get to know the tool better i will delve  
into making CSV Dataset have an option to be per thread....

The whole thing starts to make more and more sense...

Thanks!

On Jan 10, 2007, at 12:46 PM, sebb wrote:

> The CSV Dataset (and CSVRead/StringFromFile functions) are designed to
> share the data between threads.
>
> So for example you can set up a file with many thousand different
> account ids and have multiple threads process a single account id
> each, perhaps performing a lot of different operations on each.
>
> Perhaps there is also a need to allow the CSV Dataset to be per-thread
> rather than shared. Probably not difficult to do...
>
> As a work-round, if you don't have a lot of threads, you could create
> multiple copies of the data-file, and use the __threadNum() function
> as part of the file name, e.g.
>
> datafile_${__threadNum}.csv
>
> Obviously this is not ideal for large numbers of threads.
>
> But at least on some OSes you can save on disk space by using links.
>
> S///
> On 10/01/07, Alexander Wallace <aw...@rwmotloc.com> wrote:
>> that must be why a loop forever thing doesn't work....
>>
>> Does this apply also to a for loop if i used the line count in the  
>> file?
>>
>> my queries file has all the queries a user excecutes in a a usecase
>> of a web app... My idea was that if i made 1 thread excecute all
>> queries, then added more threads, this would simulate  multiple users
>> doing the same usecase in the web app, it seems that's not the case
>> if i read the queries from a file as opposed to having many samplers
>> in the test... Does this sound accurate?
>>
>> On Jan 10, 2007, at 11:52 AM, sebb wrote:
>>
>> > See my reply to chris.
>> >
>> > Try 10 queries in the file with 2 threads - each thread should do 5
>> > queries before detecting EOF.
>> >
>> > Or you may find they do 4 + 6, if one thread completes faster than
>> > the other.
>> >
>> > On 10/01/07, Alexander Wallace <aw...@rwmotloc.com> wrote:
>> >> It's no bother at all! I'm sad to report that in my case, the same
>> >> happens... I have 10 queries in my csv file and regardless of  
>> the #
>> >> of threads, only 10 queries run... the total of samples in the
>> >> reports remain the total of iterations in the loop, regardless  
>> of the
>> >> threads ...
>> >>
>> >> Hopefully we can figure it out or someone else on the list can
>> >> help...
>> >>
>> >> Thanks!
>> >>
>> >> On Jan 10, 2007, at 11:28 AM, chris wrote:
>> >>
>> >> > Alexander, sorry for bothering again but if you run multiple
>> >> > threads do you also
>> >> > indeed see the number of request you expect? I always see it  
>> does
>> >> > requests for
>> >> > only one thread. I see this also in my Results Tree
>> >> >
>> >> >
>> >> >
>> >> >
>> >> >
>> >>  
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: jmeter-user- 
>> unsubscribe@jakarta.apache.org
>> >> > For additional commands, e-mail: jmeter-user-
>> >> help@jakarta.apache.org
>> >> >
>> >> >
>> >>
>> >>
>> >>  
>> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> >> For additional commands, e-mail: jmeter-user- 
>> help@jakarta.apache.org
>> >>
>> >>
>> >
>> >  
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail: jmeter-user- 
>> help@jakarta.apache.org
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


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


Re: threads and loops, WAS: while loop generates java.lang.StackOverflowError

Posted by sebb <se...@gmail.com>.
The CSV Dataset (and CSVRead/StringFromFile functions) are designed to
share the data between threads.

So for example you can set up a file with many thousand different
account ids and have multiple threads process a single account id
each, perhaps performing a lot of different operations on each.

Perhaps there is also a need to allow the CSV Dataset to be per-thread
rather than shared. Probably not difficult to do...

As a work-round, if you don't have a lot of threads, you could create
multiple copies of the data-file, and use the __threadNum() function
as part of the file name, e.g.

datafile_${__threadNum}.csv

Obviously this is not ideal for large numbers of threads.

But at least on some OSes you can save on disk space by using links.

S///
On 10/01/07, Alexander Wallace <aw...@rwmotloc.com> wrote:
> that must be why a loop forever thing doesn't work....
>
> Does this apply also to a for loop if i used the line count in the file?
>
> my queries file has all the queries a user excecutes in a a usecase
> of a web app... My idea was that if i made 1 thread excecute all
> queries, then added more threads, this would simulate  multiple users
> doing the same usecase in the web app, it seems that's not the case
> if i read the queries from a file as opposed to having many samplers
> in the test... Does this sound accurate?
>
> On Jan 10, 2007, at 11:52 AM, sebb wrote:
>
> > See my reply to chris.
> >
> > Try 10 queries in the file with 2 threads - each thread should do 5
> > queries before detecting EOF.
> >
> > Or you may find they do 4 + 6, if one thread completes faster than
> > the other.
> >
> > On 10/01/07, Alexander Wallace <aw...@rwmotloc.com> wrote:
> >> It's no bother at all! I'm sad to report that in my case, the same
> >> happens... I have 10 queries in my csv file and regardless of the #
> >> of threads, only 10 queries run... the total of samples in the
> >> reports remain the total of iterations in the loop, regardless of the
> >> threads ...
> >>
> >> Hopefully we can figure it out or someone else on the list can
> >> help...
> >>
> >> Thanks!
> >>
> >> On Jan 10, 2007, at 11:28 AM, chris wrote:
> >>
> >> > Alexander, sorry for bothering again but if you run multiple
> >> > threads do you also
> >> > indeed see the number of request you expect? I always see it does
> >> > requests for
> >> > only one thread. I see this also in my Results Tree
> >> >
> >> >
> >> >
> >> >
> >> >
> >> ---------------------------------------------------------------------
> >> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >> > For additional commands, e-mail: jmeter-user-
> >> help@jakarta.apache.org
> >> >
> >> >
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >>
> >>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


Re: threads and loops, WAS: while loop generates java.lang.StackOverflowError

Posted by Alexander Wallace <aw...@rwmotloc.com>.
that must be why a loop forever thing doesn't work....

Does this apply also to a for loop if i used the line count in the file?

my queries file has all the queries a user excecutes in a a usecase  
of a web app... My idea was that if i made 1 thread excecute all  
queries, then added more threads, this would simulate  multiple users  
doing the same usecase in the web app, it seems that's not the case  
if i read the queries from a file as opposed to having many samplers  
in the test... Does this sound accurate?

On Jan 10, 2007, at 11:52 AM, sebb wrote:

> See my reply to chris.
>
> Try 10 queries in the file with 2 threads - each thread should do 5
> queries before detecting EOF.
>
> Or you may find they do 4 + 6, if one thread completes faster than  
> the other.
>
> On 10/01/07, Alexander Wallace <aw...@rwmotloc.com> wrote:
>> It's no bother at all! I'm sad to report that in my case, the same
>> happens... I have 10 queries in my csv file and regardless of the #
>> of threads, only 10 queries run... the total of samples in the
>> reports remain the total of iterations in the loop, regardless of the
>> threads ...
>>
>> Hopefully we can figure it out or someone else on the list can  
>> help...
>>
>> Thanks!
>>
>> On Jan 10, 2007, at 11:28 AM, chris wrote:
>>
>> > Alexander, sorry for bothering again but if you run multiple
>> > threads do you also
>> > indeed see the number of request you expect? I always see it does
>> > requests for
>> > only one thread. I see this also in my Results Tree
>> >
>> >
>> >
>> >
>> >  
>> ---------------------------------------------------------------------
>> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> > For additional commands, e-mail: jmeter-user- 
>> help@jakarta.apache.org
>> >
>> >
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


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


Re: while loop generates java.lang.StackOverflowError

Posted by sebb <se...@gmail.com>.
See my reply to chris.

Try 10 queries in the file with 2 threads - each thread should do 5
queries before detecting EOF.

Or you may find they do 4 + 6, if one thread completes faster than the other.

On 10/01/07, Alexander Wallace <aw...@rwmotloc.com> wrote:
> It's no bother at all! I'm sad to report that in my case, the same
> happens... I have 10 queries in my csv file and regardless of the #
> of threads, only 10 queries run... the total of samples in the
> reports remain the total of iterations in the loop, regardless of the
> threads ...
>
> Hopefully we can figure it out or someone else on the list can help...
>
> Thanks!
>
> On Jan 10, 2007, at 11:28 AM, chris wrote:
>
> > Alexander, sorry for bothering again but if you run multiple
> > threads do you also
> > indeed see the number of request you expect? I always see it does
> > requests for
> > only one thread. I see this also in my Results Tree
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


Re: while loop generates java.lang.StackOverflowError

Posted by Alexander Wallace <aw...@rwmotloc.com>.
It's no bother at all! I'm sad to report that in my case, the same  
happens... I have 10 queries in my csv file and regardless of the #  
of threads, only 10 queries run... the total of samples in the  
reports remain the total of iterations in the loop, regardless of the  
threads ...

Hopefully we can figure it out or someone else on the list can help...

Thanks!

On Jan 10, 2007, at 11:28 AM, chris wrote:

> Alexander, sorry for bothering again but if you run multiple  
> threads do you also
> indeed see the number of request you expect? I always see it does  
> requests for
> only one thread. I see this also in my Results Tree
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


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


Re: while loop generates java.lang.StackOverflowError

Posted by chris <cm...@zonnet.nl>.
Alexander, sorry for bothering again but if you run multiple threads do you also
indeed see the number of request you expect? I always see it does requests for
only one thread. I see this also in my Results Tree




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


Re: while loop generates java.lang.StackOverflowError

Posted by Alexander Wallace <aw...@rwmotloc.com>.
this is how i did it:

${__BeanShell(return (vars.get("type").equals("<EOF>") ? "false" :  
"true") ;)}


On Jan 10, 2007, at 8:52 AM, chris wrote:

> I have also tried the while loop conditioned to CSV dataset,
> but I get the following error:
>
> In the while loop I use as a condition:
>
> "${type}" == "<EOF>"
>
> Where type is a variable from my CSV Data Set Config
>
> 2007/01/10 15:45:36 ERROR - jmeter.threads.JMeterThread: Test failed!
> java.lang.StackOverflowError
> 	at java.lang.String.indexOf(Unknown Source)
> 	at java.lang.ClassLoader.checkName(Unknown Source)
> 	at java.lang.ClassLoader.findLoadedClass(Unknown Source)
> 	at java.lang.ClassLoader.loadClass(Unknown Source)
> 	at java.lang.ClassLoader.loadClass(Unknown Source)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>


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


Re: while loop generates java.lang.StackOverflowError

Posted by sebb <se...@gmail.com>.
If you are using the While Controller checking for EOF, then that is
how it is supposed to work...

You need at least as many entries as the number of threads times the
number of loops in each thread

On 10/01/07, chris <cm...@zonnet.nl> wrote:
> I fixed the condition, now it works fine. But if I use more than one thread it
> sill uses only one. In other words. I have defined three URL's in the CSV file.
> I use 5 threads but see only 3 requests are done, while Jmeter says it uses 5
> threads. I see in the Results Tree also only 3 requests.
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


Re: while loop generates java.lang.StackOverflowError

Posted by chris <cm...@zonnet.nl>.
I fixed the condition, now it works fine. But if I use more than one thread it
sill uses only one. In other words. I have defined three URL's in the CSV file.
I use 5 threads but see only 3 requests are done, while Jmeter says it uses 5
threads. I see in the Results Tree also only 3 requests.





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


Re: while loop generates java.lang.StackOverflowError

Posted by sebb <se...@gmail.com>.
Does the error occur if you remove the nested If controllers?

Try removing elements until the error goes away...

Also it might perhaps be worth trying the nightly build.

S.
On 10/01/07, chris <cm...@zonnet.nl> wrote:
> I have now put the condition for the While loop to ${type}
> As a child of the while loop I have the CSV Data Set Config with Recycle On EOF
> set to false. However I still have the same error.
>
> Also as child of the while loop I have three If Controllers.
>
> Any thoughts on this?
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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


Re: while loop generates java.lang.StackOverflowError

Posted by chris <cm...@zonnet.nl>.
I have now put the condition for the While loop to ${type}
As a child of the while loop I have the CSV Data Set Config with Recycle On EOF
set to false. However I still have the same error. 

Also as child of the while loop I have three If Controllers.

Any thoughts on this?




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


Re: while loop generates java.lang.StackOverflowError

Posted by sebb <se...@gmail.com>.
That is not a valid While condition:

http://jakarta.apache.org/jmeter/usermanual/component_reference.html#While_Controller

An alternative would be to set

csvdataset.eofstring=false

You could then use the condition:

${type}

S.
On 10/01/07, chris <cm...@zonnet.nl> wrote:
> I have also tried the while loop conditioned to CSV dataset,
> but I get the following error:
>
> In the while loop I use as a condition:
>
> "${type}" == "<EOF>"
>
> Where type is a variable from my CSV Data Set Config
>
> 2007/01/10 15:45:36 ERROR - jmeter.threads.JMeterThread: Test failed!
> java.lang.StackOverflowError
>        at java.lang.String.indexOf(Unknown Source)
>        at java.lang.ClassLoader.checkName(Unknown Source)
>        at java.lang.ClassLoader.findLoadedClass(Unknown Source)
>        at java.lang.ClassLoader.loadClass(Unknown Source)
>        at java.lang.ClassLoader.loadClass(Unknown Source)
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

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