Bug 42057 - NullPointerException in Access Log sampler if the first line is corrupted
NullPointerException in Access Log sampler if the first line is corrupted
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.2
PC Linux
: P3 minor (vote)
: ---
Assigned To: JMeter issues mailing list
:
: 43467 (view as bug list)
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2007-04-05 06:25 UTC by Ivan Rancati
Modified: 2007-09-24 14:55 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ivan Rancati 2007-04-05 06:25:41 UTC
I have been using the Access Log sampler with a simple test plan structure as
follows

Thread Group
  Loop Controller
  Access Log Sampler
  HTTP Request Defaults
  HTTP Cookie Manager

The log file is produced by Apache and it parses well (I guess the format is
like Tomcat) 
One of the log files I tried started like this because the server ran out of
disk space


Error writing to log file.       9555 messages lost.
- 80 ext 10.55.99.9 - - "GET
/?gps_history=1337300;5251640;20;30;$&destination=1342157;5238465;&cmd=navigate&counter=3
HTTP/1.1" 200 - "-" "Java/1.5.0_08" [05/Apr/2007:12:42:13 +0200]
6600D3A691C74E688CA9EA0B6E6F8DCB 80 ext 10.55.99.9 - - "GET
/?cmd=packet&packet_idx=1&version=5&compressed=true&counter=4 HTTP/1.1" 200 177
"-" "Java/1.5.0_08" [05/Apr/2007:12:42:23 +0200]

Once I removed the first two lines the JMeter plan worked, but with the file as
copied from the Apache server I got this error in jmeter.log

2007/04/05 14:46:01 INFO  - jmeter.threads.JMeterThread: Thread Thread Group 1-1
started
2007/04/05 14:46:01 INFO  - jmeter.services.FileServer: Stored:
/tmp/chromium-eu-ta-2.0-access.log.2007-04-04-10_50_22
2007/04/05 14:46:01 WARN  - jmeter.protocol.http.sampler.AccessLogSampler:
Sampling failure java.lang.NullPointerException
        at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.getUrl(HTTPSamplerBase.java:527)
        at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:658)
        at
org.apache.jmeter.protocol.http.sampler.AccessLogSampler.sampleWithParser(AccessLogSampler.java:161)
        at
org.apache.jmeter.protocol.http.sampler.AccessLogSampler.sample(AccessLogSampler.java:178)
        at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:247)
        at java.lang.Thread.run(Thread.java:595)

Maybe you could add error checking and display an error about the unparsable log
line.
Comment 1 Sebb 2007-04-15 12:42:55 UTC
Thanks, fixed the NPE in HTTPSampler.
Comment 2 Sebb 2007-09-24 14:55:41 UTC
*** Bug 43467 has been marked as a duplicate of this bug. ***