You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Ronan Klyne <ro...@groupbc.com> on 2008/07/02 10:39:03 UTC

TestCompiler throws NPE - how to debug?

Hi all,

I have a test plan created in JMeter 2.3RC4, now being used in JMeter 
2.3.2. When I try to run my tests, I get the following error appearing 
in jmeter.log:

<snip>
2008/07/02 09:31:05 ERROR - jmeter.threads.JMeterThread: 
java.lang.NullPointerException
	at 
org.apache.jmeter.threads.TestCompiler.configureSampler(TestCompiler.java:85)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:278)
	at java.lang.Thread.run(Unknown Source)

</snip>

I get several of these, but I can't work out what is actually wrong. I 
don't see any mention of which test element it is compiling when this 
happens.

I don't know where I should be looking to find this problem - any 
suggestions would be greatly appreciated...

Thanks,

	Ronan


-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@groupbc.com
www.groupbc.com

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


Re: TestCompiler throws NPE - how to debug?

Posted by Ronan Klyne <ro...@groupbc.com>.
sebb wrote:
> I've checked in a fix which seems to work - if you want to try it, it
> will be in nightly builds r674210 and later.

Many thanks...


-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@groupbc.com
www.groupbc.com

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


Re: TestCompiler throws NPE - how to debug?

Posted by sebb <se...@gmail.com>.
On 02/07/2008, sebb <se...@gmail.com> wrote:
> On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
>  > sebb wrote:
>  >
>  > > On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
>  > >
>  > > > Ronan Klyne wrote:
>  > > >
>  > > >
>  > > > > sebb wrote:
>  > > > >
>  > > > >
>  > > > > > On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
>  > > > > >
>  > > > > >
>  > > > > > > Ivan Rodriguez wrote:
>  > > > > > >
>  > > > > > >
>  > > > > > >
>  > > > > > > > You could try to disable one element at the time and run the
>  > script.
>  > > > > > > > When the Exception disappear then you will know witch element is
>  > > > > > > >
>  > > > > > >
>  > > > > >
>  > > > >
>  > > > causing
>  > > >
>  > > > >
>  > > > > >
>  > > > > > > it.
>  > > > > > >
>  > > > > > >
>  > > > > > > > You can of course do it the other way around, disable all and
>  > enable
>  > > > > > > >
>  > > > > > >
>  > > > > >
>  > > > >
>  > > > one
>  > > >
>  > > > >
>  > > > > >
>  > > > > > > element at the time.
>  > > > > > >  The problem with this method is that I have a large test plan
>  > > > > > >
>  > > > > >
>  > > > >
>  > > > (hundreds of
>  > > >
>  > > > >
>  > > > > >
>  > > > > > > elements), and it takes about 60 seconds per element.
>  > > > > > >  I'd rather JMeter would just tell me which element wasn't
>  > right...
>  > > > > > >
>  > > > > > >
>  > > > > > >
>  > > > > > The problem is that the NPE is caused by a bug - it's not expected
>  > to
>  > > > > > happen, so the method that fails does not do anything about it. The
>  > > > > > NPE is eventually caught by the top-level code, but by then the
>  > > > > > details of what the low level method was doing are lost.
>  > > > > >
>  > > > > >
>  > > > > >
>  > > > > > >
>  > > > > > > > I take it you are not using any Beanshell script right?
>  > > > > > > >
>  > > > > > > >
>  > > > > > > >
>  > > > > > >  I am using BeanShell, but I'm fairly sure this error is not
>  > related
>  > > > > > >
>  > > > > >
>  > > > >
>  > > > to that
>  > > >
>  > > > >
>  > > > > >
>  > > > > > > - BeanShell errors have always mentioned 'BeanShell' somewhere in
>  > the
>  > > > > > > message...
>  > > > > > >
>  > > > > > >
>  > > > > > Agreed. The offending code is:
>  > > > > >
>  > > > > >       SamplePackage pack = (SamplePackage)
>  > > > > >
>  > > > >
>  > > > samplerConfigMap.get(sampler);
>  > > >
>  > > > >
>  > > > > >       pack.setSampler(sampler); // NPE occurs here
>  > > > > >
>  > > > > > For some reason, the pack cannot be found in the map.
>  > > > > >
>  > > > > > It looks like this might perhaps be a thread synchronisation issue,
>  > in
>  > > > > > which case the contents of the test plan may not be relevant.
>  > > > > >
>  > > > > >
>  > > > > > But if the test plan is relevant:
>  > > > > >
>  > > > > > How about checking which test elements are missing from the loaded
>  > test
>  > > > > >
>  > > > >
>  > > > plan?
>  > > >
>  > > > >
>  > > > > > If it's not obvious visually, try saving the partial test plan and
>  > > > > > comparing against the original.
>  > > > > >
>  > > > > >
>  > > > > There's no difference. The newly saved plan, if reloaded, exhibits the
>  > > > >
>  > > > same problem.
>  > > >
>  > > > > I have found (by disabling large chunks of test (using XSL - much
>  > faster
>  > > > >
>  > > > :D)) that one particular BeanShell preprocessor is causing the problem -
>  > at
>  > > > least, disabling it makes the problem go away.
>  > > >
>  > > > > This is inside a pair of transaction controllers, the outer of which
>  > is
>  > > > >
>  > > > set to generate a parent sample. This is all then wrapped is a simple
>  > > > controller.
>  > > >
>  > > > > Elsewhere, I have a loop which uses a module controller to pull in
>  > this
>  > > > >
>  > > > simple controller.
>  > > >
>  > > > > It's not a simple set up, but I'm now looking at where in my BeanShell
>  > the
>  > > > >
>  > > > problem might be. I'll keep you posted...
>  > > >  That was a red herring. The problem is with nested transaction
>  > controllers
>  > > > where more than one of them is set to generate a parent sample.
>  > > >  (I got mislead because this code path was being controlled by my
>  > Beanshell)
>  > > >
>  > > >
>  > >
>  > > AFAICS, the parent sample option was not present in 2.3RC4, so this
>  > > presumably explains why the test plan worked previously.
>  > >
>  >
>  >  I'm fairly sure I've seen that option since at least 2.3RC3...
>
>
> You're right - I looked only at the screen shot, which did not show it ;-)
>
>
>  >  I'm also fairly sure that it never liked nesting such elements, but this
>  > situation only used to result in some duplicate samples - one of the parent
>  > samples was generated in _addition_ to the child samples, rather than only
>  > generating the parent sample.
>  >
>
>
> OK, so maybe that fix caused the problem.
>

I've checked in a fix which seems to work - if you want to try it, it
will be in nightly builds r674210 and later.

>
>  >
>  > > It also seems to make sense that the TestCompiler might have problems
>  > > finding the sample.
>  > >
>  > > Obviously this is a bug which needs fixing, so thanks for reporting it.
>  > >
>  >
>  >  It's the least I can do....
>  >
>  >
>  >
>  >  --
>  >  Ronan Klyne
>  >  Business Collaborator Developer
>  >  Tel: +44 01189 028518
>  >  ronan.klyne@groupbc.com
>  >  www.groupbc.com
>  >
>  > ---------------------------------------------------------------------
>  >  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: TestCompiler throws NPE - how to debug?

Posted by sebb <se...@gmail.com>.
On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
> sebb wrote:
>
> > On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
> >
> > > Ronan Klyne wrote:
> > >
> > >
> > > > sebb wrote:
> > > >
> > > >
> > > > > On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
> > > > >
> > > > >
> > > > > > Ivan Rodriguez wrote:
> > > > > >
> > > > > >
> > > > > >
> > > > > > > You could try to disable one element at the time and run the
> script.
> > > > > > > When the Exception disappear then you will know witch element is
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > causing
> > >
> > > >
> > > > >
> > > > > > it.
> > > > > >
> > > > > >
> > > > > > > You can of course do it the other way around, disable all and
> enable
> > > > > > >
> > > > > >
> > > > >
> > > >
> > > one
> > >
> > > >
> > > > >
> > > > > > element at the time.
> > > > > >  The problem with this method is that I have a large test plan
> > > > > >
> > > > >
> > > >
> > > (hundreds of
> > >
> > > >
> > > > >
> > > > > > elements), and it takes about 60 seconds per element.
> > > > > >  I'd rather JMeter would just tell me which element wasn't
> right...
> > > > > >
> > > > > >
> > > > > >
> > > > > The problem is that the NPE is caused by a bug - it's not expected
> to
> > > > > happen, so the method that fails does not do anything about it. The
> > > > > NPE is eventually caught by the top-level code, but by then the
> > > > > details of what the low level method was doing are lost.
> > > > >
> > > > >
> > > > >
> > > > > >
> > > > > > > I take it you are not using any Beanshell script right?
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > >  I am using BeanShell, but I'm fairly sure this error is not
> related
> > > > > >
> > > > >
> > > >
> > > to that
> > >
> > > >
> > > > >
> > > > > > - BeanShell errors have always mentioned 'BeanShell' somewhere in
> the
> > > > > > message...
> > > > > >
> > > > > >
> > > > > Agreed. The offending code is:
> > > > >
> > > > >       SamplePackage pack = (SamplePackage)
> > > > >
> > > >
> > > samplerConfigMap.get(sampler);
> > >
> > > >
> > > > >       pack.setSampler(sampler); // NPE occurs here
> > > > >
> > > > > For some reason, the pack cannot be found in the map.
> > > > >
> > > > > It looks like this might perhaps be a thread synchronisation issue,
> in
> > > > > which case the contents of the test plan may not be relevant.
> > > > >
> > > > >
> > > > > But if the test plan is relevant:
> > > > >
> > > > > How about checking which test elements are missing from the loaded
> test
> > > > >
> > > >
> > > plan?
> > >
> > > >
> > > > > If it's not obvious visually, try saving the partial test plan and
> > > > > comparing against the original.
> > > > >
> > > > >
> > > > There's no difference. The newly saved plan, if reloaded, exhibits the
> > > >
> > > same problem.
> > >
> > > > I have found (by disabling large chunks of test (using XSL - much
> faster
> > > >
> > > :D)) that one particular BeanShell preprocessor is causing the problem -
> at
> > > least, disabling it makes the problem go away.
> > >
> > > > This is inside a pair of transaction controllers, the outer of which
> is
> > > >
> > > set to generate a parent sample. This is all then wrapped is a simple
> > > controller.
> > >
> > > > Elsewhere, I have a loop which uses a module controller to pull in
> this
> > > >
> > > simple controller.
> > >
> > > > It's not a simple set up, but I'm now looking at where in my BeanShell
> the
> > > >
> > > problem might be. I'll keep you posted...
> > >  That was a red herring. The problem is with nested transaction
> controllers
> > > where more than one of them is set to generate a parent sample.
> > >  (I got mislead because this code path was being controlled by my
> Beanshell)
> > >
> > >
> >
> > AFAICS, the parent sample option was not present in 2.3RC4, so this
> > presumably explains why the test plan worked previously.
> >
>
>  I'm fairly sure I've seen that option since at least 2.3RC3...

You're right - I looked only at the screen shot, which did not show it ;-)

>  I'm also fairly sure that it never liked nesting such elements, but this
> situation only used to result in some duplicate samples - one of the parent
> samples was generated in _addition_ to the child samples, rather than only
> generating the parent sample.
>

OK, so maybe that fix caused the problem.

>
> > It also seems to make sense that the TestCompiler might have problems
> > finding the sample.
> >
> > Obviously this is a bug which needs fixing, so thanks for reporting it.
> >
>
>  It's the least I can do....
>
>
>
>  --
>  Ronan Klyne
>  Business Collaborator Developer
>  Tel: +44 01189 028518
>  ronan.klyne@groupbc.com
>  www.groupbc.com
>
> ---------------------------------------------------------------------
>  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: TestCompiler throws NPE - how to debug?

Posted by Ronan Klyne <ro...@groupbc.com>.
sebb wrote:
> On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
>> Ronan Klyne wrote:
>>
>>> sebb wrote:
>>>
>>>> On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
>>>>
>>>>> Ivan Rodriguez wrote:
>>>>>
>>>>>
>>>>>> You could try to disable one element at the time and run the script.
>>>>>> When the Exception disappear then you will know witch element is
>> causing
>>>>> it.
>>>>>
>>>>>> You can of course do it the other way around, disable all and enable
>> one
>>>>> element at the time.
>>>>>  The problem with this method is that I have a large test plan
>> (hundreds of
>>>>> elements), and it takes about 60 seconds per element.
>>>>>  I'd rather JMeter would just tell me which element wasn't right...
>>>>>
>>>>>
>>>> The problem is that the NPE is caused by a bug - it's not expected to
>>>> happen, so the method that fails does not do anything about it. The
>>>> NPE is eventually caught by the top-level code, but by then the
>>>> details of what the low level method was doing are lost.
>>>>
>>>>
>>>>>> I take it you are not using any Beanshell script right?
>>>>>>
>>>>>>
>>>>>  I am using BeanShell, but I'm fairly sure this error is not related
>> to that
>>>>> - BeanShell errors have always mentioned 'BeanShell' somewhere in the
>>>>> message...
>>>>>
>>>> Agreed. The offending code is:
>>>>
>>>>        SamplePackage pack = (SamplePackage)
>> samplerConfigMap.get(sampler);
>>>>        pack.setSampler(sampler); // NPE occurs here
>>>>
>>>> For some reason, the pack cannot be found in the map.
>>>>
>>>> It looks like this might perhaps be a thread synchronisation issue, in
>>>> which case the contents of the test plan may not be relevant.
>>>>
>>>>
>>>> But if the test plan is relevant:
>>>>
>>>> How about checking which test elements are missing from the loaded test
>> plan?
>>>> If it's not obvious visually, try saving the partial test plan and
>>>> comparing against the original.
>>>>
>>> There's no difference. The newly saved plan, if reloaded, exhibits the
>> same problem.
>>> I have found (by disabling large chunks of test (using XSL - much faster
>> :D)) that one particular BeanShell preprocessor is causing the problem - at
>> least, disabling it makes the problem go away.
>>> This is inside a pair of transaction controllers, the outer of which is
>> set to generate a parent sample. This is all then wrapped is a simple
>> controller.
>>> Elsewhere, I have a loop which uses a module controller to pull in this
>> simple controller.
>>> It's not a simple set up, but I'm now looking at where in my BeanShell the
>> problem might be. I'll keep you posted...
>>  That was a red herring. The problem is with nested transaction controllers
>> where more than one of them is set to generate a parent sample.
>>  (I got mislead because this code path was being controlled by my Beanshell)
>>
> 
> AFAICS, the parent sample option was not present in 2.3RC4, so this
> presumably explains why the test plan worked previously.

I'm fairly sure I've seen that option since at least 2.3RC3...
I'm also fairly sure that it never liked nesting such elements, but this 
situation only used to result in some duplicate samples - one of the 
parent samples was generated in _addition_ to the child samples, rather 
than only generating the parent sample.

> It also seems to make sense that the TestCompiler might have problems
> finding the sample.
> 
> Obviously this is a bug which needs fixing, so thanks for reporting it.

It's the least I can do....



-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@groupbc.com
www.groupbc.com

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


Re: TestCompiler throws NPE - how to debug?

Posted by sebb <se...@gmail.com>.
On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
> Ronan Klyne wrote:
>
> > sebb wrote:
> >
> > > On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
> > >
> > > > Ivan Rodriguez wrote:
> > > >
> > > >
> > > > > You could try to disable one element at the time and run the script.
> > > > > When the Exception disappear then you will know witch element is
> causing
> > > > >
> > > > it.
> > > >
> > > > >
> > > > > You can of course do it the other way around, disable all and enable
> one
> > > > >
> > > > element at the time.
> > > >  The problem with this method is that I have a large test plan
> (hundreds of
> > > > elements), and it takes about 60 seconds per element.
> > > >  I'd rather JMeter would just tell me which element wasn't right...
> > > >
> > > >
> > >
> > > The problem is that the NPE is caused by a bug - it's not expected to
> > > happen, so the method that fails does not do anything about it. The
> > > NPE is eventually caught by the top-level code, but by then the
> > > details of what the low level method was doing are lost.
> > >
> > >
> > > >
> > > > > I take it you are not using any Beanshell script right?
> > > > >
> > > > >
> > > >  I am using BeanShell, but I'm fairly sure this error is not related
> to that
> > > > - BeanShell errors have always mentioned 'BeanShell' somewhere in the
> > > > message...
> > > >
> > >
> > > Agreed. The offending code is:
> > >
> > >        SamplePackage pack = (SamplePackage)
> samplerConfigMap.get(sampler);
> > >        pack.setSampler(sampler); // NPE occurs here
> > >
> > > For some reason, the pack cannot be found in the map.
> > >
> > > It looks like this might perhaps be a thread synchronisation issue, in
> > > which case the contents of the test plan may not be relevant.
> > >
> > >
> > > But if the test plan is relevant:
> > >
> > > How about checking which test elements are missing from the loaded test
> plan?
> > >
> > > If it's not obvious visually, try saving the partial test plan and
> > > comparing against the original.
> > >
> >
> > There's no difference. The newly saved plan, if reloaded, exhibits the
> same problem.
> >
> > I have found (by disabling large chunks of test (using XSL - much faster
> :D)) that one particular BeanShell preprocessor is causing the problem - at
> least, disabling it makes the problem go away.
> > This is inside a pair of transaction controllers, the outer of which is
> set to generate a parent sample. This is all then wrapped is a simple
> controller.
> > Elsewhere, I have a loop which uses a module controller to pull in this
> simple controller.
> >
> > It's not a simple set up, but I'm now looking at where in my BeanShell the
> problem might be. I'll keep you posted...
> >
>
>  That was a red herring. The problem is with nested transaction controllers
> where more than one of them is set to generate a parent sample.
>  (I got mislead because this code path was being controlled by my Beanshell)
>

AFAICS, the parent sample option was not present in 2.3RC4, so this
presumably explains why the test plan worked previously.

It also seems to make sense that the TestCompiler might have problems
finding the sample.

Obviously this is a bug which needs fixing, so thanks for reporting it.

>
>         # r
>
>
>  --
>  Ronan Klyne
>  Business Collaborator Developer
>  Tel: +44 01189 028518
>  ronan.klyne@groupbc.com
>  www.groupbc.com
>
> ---------------------------------------------------------------------
>  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: TestCompiler throws NPE - how to debug?

Posted by Ronan Klyne <ro...@groupbc.com>.
Ronan Klyne wrote:
> sebb wrote:
>> On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
>>> Ivan Rodriguez wrote:
>>>
>>>> You could try to disable one element at the time and run the script.
>>>> When the Exception disappear then you will know witch element is 
>>>> causing
>>> it.
>>>>
>>>> You can of course do it the other way around, disable all and enable 
>>>> one
>>> element at the time.
>>>  The problem with this method is that I have a large test plan 
>>> (hundreds of
>>> elements), and it takes about 60 seconds per element.
>>>  I'd rather JMeter would just tell me which element wasn't right...
>>>
>>
>> The problem is that the NPE is caused by a bug - it's not expected to
>> happen, so the method that fails does not do anything about it. The
>> NPE is eventually caught by the top-level code, but by then the
>> details of what the low level method was doing are lost.
>>
>>>> I take it you are not using any Beanshell script right?
>>>>
>>>  I am using BeanShell, but I'm fairly sure this error is not related 
>>> to that
>>> - BeanShell errors have always mentioned 'BeanShell' somewhere in the
>>> message...
>>
>> Agreed. The offending code is:
>>
>>         SamplePackage pack = (SamplePackage) 
>> samplerConfigMap.get(sampler);
>>         pack.setSampler(sampler); // NPE occurs here
>>
>> For some reason, the pack cannot be found in the map.
>>
>> It looks like this might perhaps be a thread synchronisation issue, in
>> which case the contents of the test plan may not be relevant.
>>
>>
>> But if the test plan is relevant:
>>
>> How about checking which test elements are missing from the loaded 
>> test plan?
>>
>> If it's not obvious visually, try saving the partial test plan and
>> comparing against the original.
> 
> There's no difference. The newly saved plan, if reloaded, exhibits the 
> same problem.
> 
> I have found (by disabling large chunks of test (using XSL - much faster 
> :D)) that one particular BeanShell preprocessor is causing the problem - 
> at least, disabling it makes the problem go away.
> This is inside a pair of transaction controllers, the outer of which is 
> set to generate a parent sample. This is all then wrapped is a simple 
> controller.
> Elsewhere, I have a loop which uses a module controller to pull in this 
> simple controller.
> 
> It's not a simple set up, but I'm now looking at where in my BeanShell 
> the problem might be. I'll keep you posted...

That was a red herring. The problem is with nested transaction 
controllers where more than one of them is set to generate a parent sample.
(I got mislead because this code path was being controlled by my Beanshell)

	# r


-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@groupbc.com
www.groupbc.com

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


Re: TestCompiler throws NPE - how to debug?

Posted by Ronan Klyne <ro...@groupbc.com>.
sebb wrote:
> On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
>> Ivan Rodriguez wrote:
>>
>>> You could try to disable one element at the time and run the script.
>>> When the Exception disappear then you will know witch element is causing
>> it.
>>>
>>> You can of course do it the other way around, disable all and enable one
>> element at the time.
>>  The problem with this method is that I have a large test plan (hundreds of
>> elements), and it takes about 60 seconds per element.
>>  I'd rather JMeter would just tell me which element wasn't right...
>>
> 
> The problem is that the NPE is caused by a bug - it's not expected to
> happen, so the method that fails does not do anything about it. The
> NPE is eventually caught by the top-level code, but by then the
> details of what the low level method was doing are lost.
> 
>>> I take it you are not using any Beanshell script right?
>>>
>>  I am using BeanShell, but I'm fairly sure this error is not related to that
>> - BeanShell errors have always mentioned 'BeanShell' somewhere in the
>> message...
> 
> Agreed. The offending code is:
> 
> 		SamplePackage pack = (SamplePackage) samplerConfigMap.get(sampler);
> 		pack.setSampler(sampler); // NPE occurs here
> 
> For some reason, the pack cannot be found in the map.
> 
> It looks like this might perhaps be a thread synchronisation issue, in
> which case the contents of the test plan may not be relevant.
> 
> 
> But if the test plan is relevant:
> 
> How about checking which test elements are missing from the loaded test plan?
> 
> If it's not obvious visually, try saving the partial test plan and
> comparing against the original.

There's no difference. The newly saved plan, if reloaded, exhibits the 
same problem.

I have found (by disabling large chunks of test (using XSL - much faster 
:D)) that one particular BeanShell preprocessor is causing the problem - 
at least, disabling it makes the problem go away.
This is inside a pair of transaction controllers, the outer of which is 
set to generate a parent sample. This is all then wrapped is a simple 
controller.
Elsewhere, I have a loop which uses a module controller to pull in this 
simple controller.

It's not a simple set up, but I'm now looking at where in my BeanShell 
the problem might be. I'll keep you posted...

	# r

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@groupbc.com
www.groupbc.com

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


Re: TestCompiler throws NPE - how to debug?

Posted by sebb <se...@gmail.com>.
On 02/07/2008, Ronan Klyne <ro...@groupbc.com> wrote:
> Ivan Rodriguez wrote:
>
> > You could try to disable one element at the time and run the script.
> > When the Exception disappear then you will know witch element is causing
> it.
> >
> >
> > You can of course do it the other way around, disable all and enable one
> element at the time.
> >
>
>  The problem with this method is that I have a large test plan (hundreds of
> elements), and it takes about 60 seconds per element.
>  I'd rather JMeter would just tell me which element wasn't right...
>

The problem is that the NPE is caused by a bug - it's not expected to
happen, so the method that fails does not do anything about it. The
NPE is eventually caught by the top-level code, but by then the
details of what the low level method was doing are lost.

>
> > I take it you are not using any Beanshell script right?
> >
>  I am using BeanShell, but I'm fairly sure this error is not related to that
> - BeanShell errors have always mentioned 'BeanShell' somewhere in the
> message...

Agreed. The offending code is:

		SamplePackage pack = (SamplePackage) samplerConfigMap.get(sampler);
		pack.setSampler(sampler); // NPE occurs here

For some reason, the pack cannot be found in the map.

It looks like this might perhaps be a thread synchronisation issue, in
which case the contents of the test plan may not be relevant.

>

But if the test plan is relevant:

How about checking which test elements are missing from the loaded test plan?

If it's not obvious visually, try saving the partial test plan and
comparing against the original.

If that does not work, let me know and I could send you an updated jar
with some debug added.


>         # r
>
>
>
>
> >
> > -----Original Message-----
> > From: Ronan Klyne [mailto:ronan.klyne@groupbc.com]
> > Sent: den 2 juli 2008 11:34
> > To: JMeter Users List
> > Subject: Re: TestCompiler throws NPE - how to debug?
> >
> >
> > Which would be fine, if I was writing Java and had the Java code...
> > This is somehow caused by something in my test plan, but I don't know
> > how to find out what...
> >
> >        # r
> >
> > Ivan Rodriguez wrote:
> >
> > > java.lang.NullPointerException is the same as "Whatever you are trying
> to use doesn't exist".
> > >
> > > Hard to tell without the script at hand.
> > > -----Original Message-----
> > > From: Ronan Klyne [mailto:ronan.klyne@groupbc.com]
> > > Sent: den 2 juli 2008 10:39
> > > To: JMeter Users List
> > > Subject: TestCompiler throws NPE - how to debug?
> > >
> > > Hi all,
> > >
> > > I have a test plan created in JMeter 2.3RC4, now being used in JMeter
> > > 2.3.2. When I try to run my tests, I get the following error appearing
> > > in jmeter.log:
> > >
> > > <snip>
> > > 2008/07/02 09:31:05 ERROR - jmeter.threads.JMeterThread:
> > > java.lang.NullPointerException
> > >        at
> > >
> org.apache.jmeter.threads.TestCompiler.configureSampler(TestCompiler.java:85)
> > >        at
> org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:278)
> > >        at java.lang.Thread.run(Unknown Source)
> > >
> > > </snip>
> > >
> > > I get several of these, but I can't work out what is actually wrong. I
> > > don't see any mention of which test element it is compiling when this
> > > happens.
> > >
> > > I don't know where I should be looking to find this problem - any
> > > suggestions would be greatly appreciated...
> > >
> > > Thanks,
> > >
> > >        Ronan
> > >
> >
> > --
> > Ronan Klyne
> > Business Collaborator Developer
> > Tel: +44 01189 028518
> > ronan.klyne@groupbc.com
> > www.groupbc.com
> >
> >
> ---------------------------------------------------------------------
> > 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
> >
> >
> >
>
>
>  --
>  Ronan Klyne
>  Business Collaborator Developer
>  Tel: +44 01189 028518
>  ronan.klyne@groupbc.com
>  www.groupbc.com
>
> ---------------------------------------------------------------------
>  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: TestCompiler throws NPE - how to debug?

Posted by Ivan Rodriguez <iv...@cybercomgroup.com>.
Are you using a result tree listener?
If don't try that it could help.

Otherwise, do a divide and conquer approach:
        Disable half of the elements at a time.
        Then disable half of the half where the exception is
And so on.

-----Original Message-----
From: Ronan Klyne [mailto:ronan.klyne@groupbc.com]
Sent: den 2 juli 2008 12:13
To: JMeter Users List
Subject: Re: TestCompiler throws NPE - how to debug?

Ivan Rodriguez wrote:
> You could try to disable one element at the time and run the script.
> When the Exception disappear then you will know witch element is causing it.
>
>
> You can of course do it the other way around, disable all and enable one element at the time.

The problem with this method is that I have a large test plan (hundreds
of elements), and it takes about 60 seconds per element.
I'd rather JMeter would just tell me which element wasn't right...

> I take it you are not using any Beanshell script right?
I am using BeanShell, but I'm fairly sure this error is not related to
that - BeanShell errors have always mentioned 'BeanShell' somewhere in
the message...

        # r


>
> -----Original Message-----
> From: Ronan Klyne [mailto:ronan.klyne@groupbc.com]
> Sent: den 2 juli 2008 11:34
> To: JMeter Users List
> Subject: Re: TestCompiler throws NPE - how to debug?
>
>
> Which would be fine, if I was writing Java and had the Java code...
> This is somehow caused by something in my test plan, but I don't know
> how to find out what...
>
>         # r
>
> Ivan Rodriguez wrote:
>> java.lang.NullPointerException is the same as "Whatever you are trying to use doesn't exist".
>>
>> Hard to tell without the script at hand.
>> -----Original Message-----
>> From: Ronan Klyne [mailto:ronan.klyne@groupbc.com]
>> Sent: den 2 juli 2008 10:39
>> To: JMeter Users List
>> Subject: TestCompiler throws NPE - how to debug?
>>
>> Hi all,
>>
>> I have a test plan created in JMeter 2.3RC4, now being used in JMeter
>> 2.3.2. When I try to run my tests, I get the following error appearing
>> in jmeter.log:
>>
>> <snip>
>> 2008/07/02 09:31:05 ERROR - jmeter.threads.JMeterThread:
>> java.lang.NullPointerException
>>         at
>> org.apache.jmeter.threads.TestCompiler.configureSampler(TestCompiler.java:85)
>>         at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:278)
>>         at java.lang.Thread.run(Unknown Source)
>>
>> </snip>
>>
>> I get several of these, but I can't work out what is actually wrong. I
>> don't see any mention of which test element it is compiling when this
>> happens.
>>
>> I don't know where I should be looking to find this problem - any
>> suggestions would be greatly appreciated...
>>
>> Thanks,
>>
>>         Ronan
>
> --
> Ronan Klyne
> Business Collaborator Developer
> Tel: +44 01189 028518
> ronan.klyne@groupbc.com
> www.groupbc.com
>
> ---------------------------------------------------------------------
> 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
>
>


--
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@groupbc.com
www.groupbc.com

---------------------------------------------------------------------
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: TestCompiler throws NPE - how to debug?

Posted by Ronan Klyne <ro...@groupbc.com>.
Ivan Rodriguez wrote:
> You could try to disable one element at the time and run the script.
> When the Exception disappear then you will know witch element is causing it.
> 
> 
> You can of course do it the other way around, disable all and enable one element at the time.

The problem with this method is that I have a large test plan (hundreds 
of elements), and it takes about 60 seconds per element.
I'd rather JMeter would just tell me which element wasn't right...

> I take it you are not using any Beanshell script right?
I am using BeanShell, but I'm fairly sure this error is not related to 
that - BeanShell errors have always mentioned 'BeanShell' somewhere in 
the message...

	# r


> 
> -----Original Message-----
> From: Ronan Klyne [mailto:ronan.klyne@groupbc.com]
> Sent: den 2 juli 2008 11:34
> To: JMeter Users List
> Subject: Re: TestCompiler throws NPE - how to debug?
> 
> 
> Which would be fine, if I was writing Java and had the Java code...
> This is somehow caused by something in my test plan, but I don't know
> how to find out what...
> 
>         # r
> 
> Ivan Rodriguez wrote:
>> java.lang.NullPointerException is the same as "Whatever you are trying to use doesn't exist".
>>
>> Hard to tell without the script at hand.
>> -----Original Message-----
>> From: Ronan Klyne [mailto:ronan.klyne@groupbc.com]
>> Sent: den 2 juli 2008 10:39
>> To: JMeter Users List
>> Subject: TestCompiler throws NPE - how to debug?
>>
>> Hi all,
>>
>> I have a test plan created in JMeter 2.3RC4, now being used in JMeter
>> 2.3.2. When I try to run my tests, I get the following error appearing
>> in jmeter.log:
>>
>> <snip>
>> 2008/07/02 09:31:05 ERROR - jmeter.threads.JMeterThread:
>> java.lang.NullPointerException
>>         at
>> org.apache.jmeter.threads.TestCompiler.configureSampler(TestCompiler.java:85)
>>         at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:278)
>>         at java.lang.Thread.run(Unknown Source)
>>
>> </snip>
>>
>> I get several of these, but I can't work out what is actually wrong. I
>> don't see any mention of which test element it is compiling when this
>> happens.
>>
>> I don't know where I should be looking to find this problem - any
>> suggestions would be greatly appreciated...
>>
>> Thanks,
>>
>>         Ronan
> 
> --
> Ronan Klyne
> Business Collaborator Developer
> Tel: +44 01189 028518
> ronan.klyne@groupbc.com
> www.groupbc.com
> 
> ---------------------------------------------------------------------
> 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
> 
> 


-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@groupbc.com
www.groupbc.com

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


RE: TestCompiler throws NPE - how to debug?

Posted by Ivan Rodriguez <iv...@cybercomgroup.com>.
You could try to disable one element at the time and run the script.
When the Exception disappear then you will know witch element is causing it.


You can of course do it the other way around, disable all and enable one element at the time.

I take it you are not using any Beanshell script right?

Ivan

-----Original Message-----
From: Ronan Klyne [mailto:ronan.klyne@groupbc.com]
Sent: den 2 juli 2008 11:34
To: JMeter Users List
Subject: Re: TestCompiler throws NPE - how to debug?


Which would be fine, if I was writing Java and had the Java code...
This is somehow caused by something in my test plan, but I don't know
how to find out what...

        # r

Ivan Rodriguez wrote:
> java.lang.NullPointerException is the same as "Whatever you are trying to use doesn't exist".
>
> Hard to tell without the script at hand.
> -----Original Message-----
> From: Ronan Klyne [mailto:ronan.klyne@groupbc.com]
> Sent: den 2 juli 2008 10:39
> To: JMeter Users List
> Subject: TestCompiler throws NPE - how to debug?
>
> Hi all,
>
> I have a test plan created in JMeter 2.3RC4, now being used in JMeter
> 2.3.2. When I try to run my tests, I get the following error appearing
> in jmeter.log:
>
> <snip>
> 2008/07/02 09:31:05 ERROR - jmeter.threads.JMeterThread:
> java.lang.NullPointerException
>         at
> org.apache.jmeter.threads.TestCompiler.configureSampler(TestCompiler.java:85)
>         at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:278)
>         at java.lang.Thread.run(Unknown Source)
>
> </snip>
>
> I get several of these, but I can't work out what is actually wrong. I
> don't see any mention of which test element it is compiling when this
> happens.
>
> I don't know where I should be looking to find this problem - any
> suggestions would be greatly appreciated...
>
> Thanks,
>
>         Ronan

--
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@groupbc.com
www.groupbc.com

---------------------------------------------------------------------
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: TestCompiler throws NPE - how to debug?

Posted by Ronan Klyne <ro...@groupbc.com>.
Which would be fine, if I was writing Java and had the Java code...
This is somehow caused by something in my test plan, but I don't know 
how to find out what...

	# r

Ivan Rodriguez wrote:
> java.lang.NullPointerException is the same as "Whatever you are trying to use doesn't exist".
> 
> Hard to tell without the script at hand.
> -----Original Message-----
> From: Ronan Klyne [mailto:ronan.klyne@groupbc.com]
> Sent: den 2 juli 2008 10:39
> To: JMeter Users List
> Subject: TestCompiler throws NPE - how to debug?
> 
> Hi all,
> 
> I have a test plan created in JMeter 2.3RC4, now being used in JMeter
> 2.3.2. When I try to run my tests, I get the following error appearing
> in jmeter.log:
> 
> <snip>
> 2008/07/02 09:31:05 ERROR - jmeter.threads.JMeterThread:
> java.lang.NullPointerException
>         at
> org.apache.jmeter.threads.TestCompiler.configureSampler(TestCompiler.java:85)
>         at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:278)
>         at java.lang.Thread.run(Unknown Source)
> 
> </snip>
> 
> I get several of these, but I can't work out what is actually wrong. I
> don't see any mention of which test element it is compiling when this
> happens.
> 
> I don't know where I should be looking to find this problem - any
> suggestions would be greatly appreciated...
> 
> Thanks,
> 
>         Ronan

-- 
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@groupbc.com
www.groupbc.com

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


RE: TestCompiler throws NPE - how to debug?

Posted by Ivan Rodriguez <iv...@cybercomgroup.com>.
java.lang.NullPointerException is the same as "Whatever you are trying to use doesn't exist".

Hard to tell without the script at hand.
-----Original Message-----
From: Ronan Klyne [mailto:ronan.klyne@groupbc.com]
Sent: den 2 juli 2008 10:39
To: JMeter Users List
Subject: TestCompiler throws NPE - how to debug?

Hi all,

I have a test plan created in JMeter 2.3RC4, now being used in JMeter
2.3.2. When I try to run my tests, I get the following error appearing
in jmeter.log:

<snip>
2008/07/02 09:31:05 ERROR - jmeter.threads.JMeterThread:
java.lang.NullPointerException
        at
org.apache.jmeter.threads.TestCompiler.configureSampler(TestCompiler.java:85)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:278)
        at java.lang.Thread.run(Unknown Source)

</snip>

I get several of these, but I can't work out what is actually wrong. I
don't see any mention of which test element it is compiling when this
happens.

I don't know where I should be looking to find this problem - any
suggestions would be greatly appreciated...

Thanks,

        Ronan


--
Ronan Klyne
Business Collaborator Developer
Tel: +44 01189 028518
ronan.klyne@groupbc.com
www.groupbc.com

---------------------------------------------------------------------
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