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.CookieManager</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">
<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>
</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(CookiePanel.java:294)
 at org.apache.jmeter.gui.tree.JMeterTreeModel.addComponent(JMeterTreeModel.java:175)
 at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:153)
 at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:153)
 at org.apache.jmeter.gui.tree.JMeterTreeModel.addSubTree(JMeterTreeModel.java:140)
 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:118)
 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]

Reply via email to