Closed asfimport closed 18 years ago
Sebb (migrated from Bugzilla): Looks like it thinks the results file is CSV, whereas it is actually XML.
This would account for it trying to parse <?xml version="1.0" encoding ="UTF-8"?> as a Long.
If the output format disagrees with the file format, then JMeter won't read the file properly.
Note that if one creates a results file using xml format, and then changes the output format to csv, JMeter will append the new results to the existing file, thus creating a file which is a mixture of XML and CSV formats, which will not load successfully using either format.
It would be worth checking the result format setting in jmeter.properties, and that the whole results file is one format or the other ...
Without seeing the files, my analysis could be wrong, so if the two formats do agree, please could you attach the failing results file and jmeter.properties?
Mike Hampton (migrated from Bugzilla): Created attachment nonguiTest2.zip: Example results with error.
Mike Hampton (migrated from Bugzilla): I tried to open the attached file with an aggregate listener and got the same reaction.
Mike Hampton (migrated from Bugzilla): Created attachment jmeter.properties: Jmeter config
Mike Hampton (migrated from Bugzilla): There seems to be some problem loading line 3235 (which has some strange stuff in it). As soon as I delete that line the file loads into the listener.
Sebb (migrated from Bugzilla): Well spotted!
I've had a look at the Result loading code, and the problem becomes clear - if the XML does not parse correctly, the code silently assumes that the file must be in CSV format, and passes it to the CSV parser.
This expects to find a numeric timestamp at the start of the line. Instead it gets the XML header.
In this case, the line contains some invalid XML, viz and and possibly others.
I will check in a fix to log some messages to show what is happening.
But how did the invalid XML find its way into the file? It is possibly significant that the responseCode = "-1", which is not a normal HTTP response code. What does the "Load Eligibility Request" sampler do?
Mike Hampton (migrated from Bugzilla): It actually does very little. I have noticed that there are several '-1' response codes in the file. The samplers that produce these invalid responses are often very straightforward 'get' requests. In some cases thay are just requests for images.
The 'responseMessage' attribute consistantly has strange garbage in it when this happens. I am wondering if this is caused by the server that the sampler is making requests against when placed under load, not sure.
Regardless, I am uncomfortable that the sampler is able to write invalid xml into the file.
Sebb (migrated from Bugzilla): I agree that the sampler should not write invalid XML into the file.
I've had a look at the code, and can't see anything obvious. This part of the code uses Avalon Config to create the XML. The response message itself is obtained directly from the HttpURLConnection object.
It might be interesting to run a test with CSV output instead of XML, as this appears to save the data as-is. Having obtained the raw data, it should be easier to find out why it is not being encoded correctly.
[BTW, the JavaTest sampler is quite useful for testing what happens to response codes and messages etc as you can supply your own text]
Are you able to supply a test case?
If not, perhaps there is some scope for a debug version of JMeter that detects when the response code is -1 and dumps the raw response message - if the CSV method does not produce useful results.
Sebb (migrated from Bugzilla): I've created a simple test script that uses a BeanShell Assertion to check the response code and conditionally write the ResponseMessage to a file.
[To use this, you need to add the BeanShell jar from www.beanshell.org to the lib directory.]
It's not ideal, but it might be enough to track down the problem.
BTW, I first tried using the BeanShell Assertion to set a JMeter Variable. This worked, but unfortunately the If Controller seems to resolve the condition just the once, so it did not detect changes in the value.
Mike Stover (migrated from Bugzilla): In HEAD, .jtl files are written using XStream instead of Avalon's Configuration. Hopefully this will fix this problem.
Sebb (migrated from Bugzilla): No point fixing this now we are using Xstream. Please re-open if it occurs with Xstream
Mark Sechrest (migrated from Bugzilla): Created attachment results_a.jtl: Small result file
Mark Sechrest (migrated from Bugzilla): I'm seeing similar behaviour trying to reload a results file created with the SimpleDataListener in 2.1.1.
2006/05/11 09:04:09 INFO - jmeter.reporters.ResultCollector: Assuming CSV format instead 2006/05/11 09:04:09 WARN - jmeter.save.OldSaveService: Error parsing number java.lang.NumberFormatException: For input string: "<?xml version="1.0" encoding="UTF-8"?>"
Looking at the results file, it seems to be incorrectly formatted after about 20 lines. I tried just getting the lines before the formatting changed to a separate file, and loading that, but it give the same error. I have attached the shorter file.
I can open some saved files. It appears to be longer runs (larger data files) that have this problem.
Sebb (migrated from Bugzilla): The "Small result file" JTL is incomplete - there is no trailing </testResults> tag.
However, when I added it, it still would not load, even though the XML was then syntactically OK. This is a different problem from the original - the XML in that case was incorrect.
I'll take a look at this later.
Mark Sechrest (migrated from Bugzilla): FWIW, I checked several other of my results files, and many of them did not have the closing </testResults> tag.
Sebb (migrated from Bugzilla): I found a bug in the code - if the Avalon XML reader does not like the input (as in this case), the log message uses the old XStream exception, which is rather confusing.
When I fixed this, it showed that the last sampleResult is also missing its closing tag. It looks as though some nested samples may have been missing.
Did the test fail to complete in some way? That could explain the missing output.
The original Avalon JTL files have the following second line: <testResults> and the samples look like <sampleResult timeStamp="1146770278785" ...
whereas later XStream JTL files have a version number: <testResults version="1.1"> and the samples look like <sample t="300" ... or <httpSample t="1002" ...
"Small result file" has a version number, but is otherwise an Avalon file. This means that the property file_format.testlog has been set to 2.0. Unless you particularly need this format, I suggest you revert to the default.
Sebb (migrated from Bugzilla): I think this is now fixed in the 2.1 branch
Please re-open if not.
Mark Sechrest (migrated from Bugzilla): (In reply to comment 16)
Did the test fail to complete in some way? No, the test ran fine.
This means that the property file_format.testlog has been set to 2.0. Unless you particularly need this format, I suggest you revert to the default.
file_format.testlog IS set to 2.0, but I didn't set it. It would seem that is the default for the version I installed. (jmeter.properties is v 1.124.2.2)
Mike Hampton (Bug 30779): I added a "View Results Tree" listener to my jmeter test, and specified a file in the filename textfield. I ran the test and verified that the file existed and had data. After closing and then opening jmeter, i tried to load the file into the listener, but nothing appeared in the gui.
I closed jmeter, and modified the "jmeter.properties" to have "log_level.jmeter=DEBUG".
I opened jmeter, added a new "View Results Tree" listener into an empty test plan and tried to open the file again. I saw a NumberFormatException in the jmeter.log.
The log snippet follows:
2004/08/20 13:21:49 INFO - jmeter.visualizers.gui.AbstractVisualizer: getting new collector 2004/08/20 13:21:49 DEBUG - jmeter.gui.AbstractJMeterGuiComponent: setting element to enabled: true 2004/08/20 13:21:49 DEBUG - jmeter.visualizers.ViewResultsFullVisualizer: Start : clear1 2004/08/20 13:21:49 DEBUG - jmeter.visualizers.ViewResultsFullVisualizer: clear1 : total child - 0 2004/08/20 13:21:49 DEBUG - jmeter.visualizers.ViewResultsFullVisualizer: End : clear1 2004/08/20 13:21:50 DEBUG - jmeter.visualizers.gui.AbstractVisualizer: Error occurred while loading file java.lang.NumberFormatException: <?xml version="1.0" encoding ="UTF-8"?> at java.lang.Long.parseLong(Long.java:305) at java.lang.Long.parseLong(Long.java:358) at org.apache.jmeter.save.SaveService.makeResultFromDelimitedString (SaveService.java:298) at org.apache.jmeter.reporters.ResultCollector.loadExistingFile (ResultCollector.java:186) at org.apache.jmeter.visualizers.gui.AbstractVisualizer.stateChanged (AbstractVisualizer.java:231) at org.apache.jmeter.gui.util.FilePanel.fireFileChanged (FilePanel.java:128) at org.apache.jmeter.gui.util.FilePanel.actionPerformed (FilePanel.java:141) at javax.swing.AbstractButton.fireActionPerformed (AbstractButton.java:1445) at javax.swing.AbstractButton$ForwardActionEvents.actionPerformed (AbstractButton.java:1499) at javax.swing.DefaultButtonModel.fireActionPerformed (DefaultButtonModel.java:373) at javax.swing.DefaultButtonModel.setPressed (DefaultButtonModel.java:245) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased (BasicButtonListener.java:211) at java.awt.Component.processMouseEvent(Component.java:3710) at java.awt.Component.processEvent(Component.java:3539) at java.awt.Container.processEvent(Container.java:1159) at java.awt.Component.dispatchEventImpl(Component.java:2588) at java.awt.Container.dispatchEventImpl(Container.java:1208) at java.awt.Component.dispatchEvent(Component.java:2492) at java.awt.LightweightDispatcher.retargetMouseEvent (Container.java:2451) at java.awt.LightweightDispatcher.processMouseEvent(Container.java:2216) at java.awt.LightweightDispatcher.dispatchEvent(Container.java:2125) at java.awt.Container.dispatchEventImpl(Container.java:1195) at java.awt.Window.dispatchEventImpl(Window.java:923) at java.awt.Component.dispatchEvent(Component.java:2492) at java.awt.EventQueue.dispatchEvent(EventQueue.java:334) at java.awt.EventDispatchThread.pumpOneEventForHierarchy (EventDispatchThread.java:126) at java.awt.EventDispatchThread.pumpEventsForHierarchy (EventDispatchThread.java:93) at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:88) at java.awt.EventDispatchThread.run(EventDispatchThread.java:80)
Severity: normal OS: All