I looked into this a bit further, and it appears that the problem also goes
away if there are no cookies stored in the Cookie Manager.

To get rid of the cookies, and keep the manager, remove the <testelement>
and nested <property> nodes from the <collection> - see below for details of
what to snip.

There is still a bug, as it should be possible to store cookies. I'll raise
a bug.


-----Original Message-----
From: Theisen, Brent M [mailto:[EMAIL PROTECTED]
Sent: 14 August 2003 18:04
To: JMeter Users List
Subject: RE: Saved JMeter Test Plans not reloading


Yeah, I've seen this too.  This bug will prevent you from loading a JMX file
that has one or more HTTP Cookie Manager elements in it.  When you get this
error on a particular JMX file you will not be able to load it until you
remove the HTTP Cookie Manager element from the JMX file manually or you
make a code change to the JMeter source.

To remove the HTTP Cookie Manager from the JMX file open the JMX file in a
text editor, find any sections in the file that look something like the
below snippit and remove those sections from the file.

<!-- JMX file snippit -->
<node>
<testelement class="org.apache.jmeter.protocol.http.control.CookieManager">
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.StringProperty"
name="TestElement.gui_class">org.apache.jmeter.protocol.http.gui.CookiePanel
</property>
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.StringProperty"
name="TestElement.test_class">org.apache.jmeter.protocol.http.control.Cookie
Manager</property>
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.StringProperty"
name="TestElement.name">HTTP Cookie Manager</property>
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.BooleanProperty"
name="CookieManager.clearEachIteration">false</property>
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.BooleanProperty"
name="TestElement.enabled">true</property>
<collection class="java.util.ArrayList"
propType="org.apache.jmeter.testelement.property.CollectionProperty"
name="CookieManager.cookies">
---- snip here ----
<testelement class="org.apache.jmeter.protocol.http.control.Cookie"
name="sessionid">
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.StringProperty"
name="Cookie.path"/>
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.StringProperty"
name="TestElement.name">sessionid</property>
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.BooleanProperty"
name="Cookie.secure">false</property>
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.StringProperty"
name="Cookie.domain"/>
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.StringProperty"
name="Cookie.value"/>
<property xml:space="preserve"
propType="org.apache.jmeter.testelement.property.LongProperty"
name="Cookie.expires">0</property>
</testelement>
---- end of snip ---
</collection>
</testelement>
</node>
<!-- JMX file snippit -->

If you really need to use the HTTP Cookie Manager you can comment out the
line below in CookieManager.java and rebuild.  I've been using this as a
workaround and it works reliably.

JMeterContextService.getContext().getVariables().put(c.getName(),c.getValue(
));

The NullPointerException is caused by the call to getVariables() returning a
null.  I don't know the JMeter code base enough to submit a patch for this
but if someone who knows the JMeter code base has some time you should be
able to reproduce this issue using CVS HEAD if you add a HTTP Cookie Manager
to a test plan, save the test plan and then try to load it.

Brent


-----Original Message-----
From: Duncan Frostick [mailto:[EMAIL PROTECTED]
Sent: Thursday, August 14, 2003 10:35 AM
To: JMeter Users List
Subject: Saved JMeter Test Plans not reloading


Hi,

This is problem I've only had with the new version, but whenever I save a
test plan I've been playing with, come back to it later and then try to re
open it JMeter can't do it citing an 'Unexpected error'. Namely a
NullPointerException. It's getting very annoying because when I've perfected
a test plan to do what I want it to, save it then go to show it to my boss
later in the day, it doesn't work.

Any ideas what I can do to stop this, bearing in mind I need a cookie
manager?

Heres the stack trace from the log:

08/14/2003 4:28:07 PM INFO  - jmeter.JMeter: Version 1.9
08/14/2003 4:28:21 PM INFO  - jmeter.gui.action.Load: Loading file:
C:\windows\Desktop\JMeterStuff\Badboy Test Plan.jmx
08/14/2003 4:28:22 PM WARN  - jmeter.gui.action.Load: Unexpected error
java.lang.NullPointerException
 at
org.apache.jmeter.protocol.http.control.CookieManager.add(CookieManager.java
:234)
 at
org.apache.jmeter.protocol.http.gui.CookiePanel.modifyTestElement(CookiePane
l.java:294)
 at
org.apache.jmeter.gui.tree.JMeterTreeModel.addComponent(JMeterTreeModel.java
:175)
 at
org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:1
53)
 at
org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:1
53)
 at
org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:1
40)
 at org.apache.jmeter.gui.GuiPackage.addSubTree(GuiPackage.java:405)
 at org.apache.jmeter.gui.action.Load.insertLoadedTree(Load.java:166)
 at org.apache.jmeter.gui.action.Load.doAction(Load.java:126)
 at
org.apache.jmeter.gui.action.ActionRouter.performAction(ActionRouter.java:11
8)
 at
org.apache.jmeter.gui.action.ActionRouter.access$000(ActionRouter.java:80)
 at org.apache.jmeter.gui.action.ActionRouter$1.run(ActionRouter.java:99)
 at java.awt.event.InvocationEvent.dispatch(Unknown Source)
 at java.awt.EventQueue.dispatchEvent(Unknown Source)
 at java.awt.EventDispatchThread.pumpOneEventForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
 at java.awt.EventDispatchThread.run(Unknown Source)

Any hints appreciated, cheers,

Duncan Frostick


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to