Bug 53511 - access log sampler SessionFilter throws NullPointerException - cookie manager not initialized properly
access log sampler SessionFilter throws NullPointerException - cookie manager...
Status: RESOLVED FIXED
Product: JMeter
Classification: Unclassified
Component: HTTP
2.7
PC All
: P2 normal (vote)
: ---
Assigned To: JMeter issues mailing list
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-07-05 09:24 UTC by Ladislav Gazo
Modified: 2012-07-18 21:23 UTC (History)
1 user (show)



Attachments
Test plan reproducing issue (4.17 KB, application/xml)
2012-07-18 21:21 UTC, Philippe Mouawad
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ladislav Gazo 2012-07-05 09:24:14 UTC
when I use SessionFilter I receive NullPointerException in the result. After a bit of debugging I found out it is the problem that the CookieManager's cookie handler is not initialized.

Currently I fixed it by adding "testStarted" call after creating new CookieManager at line 176:

            if(cm == null)
            {
                cm = new CookieManager();
                cm.testStarted();
                cookieManagers.put(ipAddr,cm);
            }

I am not certain whether it is the most appropriate solution but it seems to be working...
Comment 1 Philippe Mouawad 2012-07-07 13:44:00 UTC
Hello,
Calling testStarted this way is not the right fix.
Can you attach your failing JMX plan and the file jmeter.log which contains the stacktrace ?
ANd also if possible the access.log file used to run this test.

Thank you
Regards
Philippe M.
Comment 2 Philippe Mouawad 2012-07-18 21:21:29 UTC
Created attachment 29076 [details]
Test plan reproducing issue
Comment 3 Philippe Mouawad 2012-07-18 21:23:24 UTC
Issue was introduced by partial fix to 51512.
CookieHandler is not initialized as testStarted is not called in SessionFilter#getCookieManager since CookieManager is built outside of TestElement lifecycle.



Date: Wed Jul 18 21:20:53 2012
New Revision: 1363120

URL: http://svn.apache.org/viewvc?rev=1363120&view=rev
Log:
Bug 53511 - access log sampler SessionFilter throws NullPointerException - cookie manager not initialized properly
Bugzilla Id: 53511

Modified:
    jmeter/trunk/src/protocol/http/org/apache/jmeter/protocol/http/util/accesslog/SessionFilter.java
    jmeter/trunk/xdocs/changes.xml