You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jmeter-dev@jakarta.apache.org by bu...@apache.org on 2007/09/24 23:37:08 UTC

DO NOT REPLY [Bug 43467] New: - HTTPSampler may produce NullpointerException

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43467>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43467

           Summary: HTTPSampler may produce NullpointerException
           Product: JMeter
           Version: 2.2
          Platform: All
        OS/Version: other
            Status: NEW
          Severity: trivial
          Priority: P2
         Component: HTTP
        AssignedTo: jmeter-dev@jakarta.apache.org
        ReportedBy: ronny.karallus@web.de


Hi,

i am currently writing some Samplers for JMeter and realized that the source
code in HTTPSampler may throw a NullpointerException in one special case,
because there is a logical programming error:

Look at the method sample(URL, String, boolean, int) in HTTPSampler:
On (my) line 404 you can find the following statement:
con = setupConnection(url, method, res);

The method used (setupConnection) may throw an IOException. This statement is
the first one in the surrounding try block to initialize the HttpURLConnection 
conn (which is initially set to null). If the setupConnection(...) method now
throws the IOException on the first execution, the conn object would still have
the null state. Now go to the catch block handling the IOException. There you
can see the following code:

res.sampleEnd();
conn.disconnect(); <= this is where a NullpointerException may be thrown

Naturally its a programming error of mine that the IOException is thrown here,
but it is not very useful if the debugging message is supressed, because the
NullpointerException is thrown here and no output is generated from the
IOException ... That is why I set it to trivial.

Would be nice if anyone of you guys could handle it.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org


DO NOT REPLY [Bug 43467] - HTTPSampler may produce NullpointerException

Posted by bu...@apache.org.
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG�
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=43467>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND�
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=43467


sebb@apache.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE




------- Additional Comments From sebb@apache.org  2007-09-24 14:55 -------
Thanks, but this was fixed in 2.3RC3

*** This bug has been marked as a duplicate of 42057 ***

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-dev-help@jakarta.apache.org