why getting socket closed error after running script by jmeter? - java

I am getting "Non HTTP response code: java.net.SocketException
Response message: Non HTTP response message: Connection reset" this type of error after running jmeter script

I bet that you're experiencing the problem described in Connection Reset since JMeter 2.10 ? wiki page
So I would recommend to take the next steps:
Switch "Implementation" of all your HTTP Request Samplers to "HttpClient4". The best way to do this is using HTTP Request Defaults so you will have to change the value in just one place.
As per the wiki page add the next 2 lines to user.properties file (lives under /bin folder of your JMeter installation)
httpclient4.retrycount=1
hc.parameters.file=hc.parameters
Add the next line to hc.parameters file (same location, /lib folder)
http.connection.stalecheck$Boolean=true
Remember to restart JMeter after making these changes, properties change is not dynamic, they're being picked up upon JMeter startup.
Hope this helps.

Related

JMeter Load testing Errors: org.apache.http.conn.HttpHost ConnectException java.net.SocketTimeoutException ConnectTimeoutException errors

I am using apache JMeter version 5.5.
I am trying to run the sample test with more than 500 users. The test runs up to 200 users without any error after that start throwing list of below errors
Non HTTP response code: org.apache.http.conn.HttpHostConnectException Non HTTP response code: org.apache.http.conn.ConnectTimeoutException Non HTTP response code: java.net.SocketTimeoutException
please refer the image for the error details
errors are like this:
case 1:Time out error
case 2: Read Time out error
I have tried the below solutions:
1 enable and check of keep-alive button
2 setting the time outs up to 100000 milliseconds
how to overcome this errors?
Is errors from JMeter script or Server side ?
The errors are from the server side. By default JMeter waits for response forever, however there could be timeouts which are set on JVM or OS level.
You can try specifying explicit larger timeouts under "Advanced" tab of the HTTP Request sampler. If you have > 1 HTTP Request samplers and want to apply the timeouts to all of them - go for HTTP Request Defaults

jmeter: Cookies coming as null when hitting the specific server

I'm using apache jmeter for testing my java application. When I hit the GTM(global traffic manager: this routes the traffic to specific server depending on the load) url https:// on port 443 everything works fine.
When I try to hit the specific server on which the the application is deployed using the url http:// on port 8080, I get 401 unauthorized error because cookies are coming as null in the request.
How can I fix this?
It's hard to guess what is the problem when you don't provide any code/configuration.
Probably you are running into issue because of same origin policy (browser and tools are sending only cookies which belongs to the origin to which you are sending request).
I guess that you are retrieving cookies from https://someApp.com:443 and try to reuse them with http://someapp.com:8080. The problem is, that they are not same origins (port number is treated as part of origin URL).
Check out this links:
JMeter Issue with SSO and Cookies
https://bz.apache.org/bugzilla/show_bug.cgi?id=56358
You could try disabling JMeter cookies checking:
Temporarily (once only), via -J command-line argument like:
jmeter -JCookieManager.check.cookies=false -n -t test.jmx -l result.jtl
Permanent, by adding the next line to user.properties file (located in "bin" folder of your JMeter installation)
CookieManager.check.cookies=false
JMeter restart will be required to pick the property up.
References:
Configuring JMeter
Apache JMeter Properties Customization Guide
HTTP Cookie Manager documentation
Notice that you have only 1 Cookie Manager.
If there is more than one Cookie Manager in the scope of a Sampler,
there is currently no way to specify which one is to be used. Also, a
cookie stored in one cookie manager is not available to any other
manager, so use multiple Cookie Managers with care

Large messages failing in SoapUI - "Error getting response; java.net.SocketException: Connection reset"

I'm using Soap UI 4.6.0 to hit a WCF web service, and when I have really large message payloads, I'm seeing the following error:
Error getting response; java.net.SocketException: Connection reset
The WCF service has around 10 methods, each with progressively larger inputs (eg, 10 int properties, 50 int properties, 100 int properties, etc). This works with the smaller messages, but as they get around 2000-3000 int properties, the error occurs.
The call appears to succeed on the server side, and with this coming from java, I'm assuming I'm butting up against some size limitation/configuration in the client. Is this something I can tweak within Soap UI, the java runtime, or elsewhere?
For me the trick that worked was adding below entry in SoapUI-5.2.0.vmoptions file (it can be found in the bin directory of installa
-Dsoapui.https.protocols=SSLv3,TLSv1.2
Normally a connection reset means that one of the underlying servers timed out waiting for data from another server/application and it reset the connection.
You should try out the suggestions #kroonwijk gave it'll tell you which server is causing the reset and what is causing the server to reset the connection.
Also see What's causing my java.net.SocketException: Connection reset?
If above solutions won't work for you then try this:
Close SoapUI
Go to SoapUi directory for example: C:\Program Files\SmartBear\SoapUI-5.3.0\
Rename directory "jre" to "jre.ignore"
Done. Open SoapUi and it should work now.

Firefox has detected that the server is redirecting the request for this address in a way that will never complete

I'm following Scott Davis' tutorials on developing grails apps, but whenever i try to run my app (or indeed his source code) i get "Firefox has detected that the server is redirecting the request for this address in a way that will never complete." Safari gives a similar error message as does Opera.
As i've tested the original authors source code which gives the same error i'm fairly confident it's nothing to do with the code.
Is this a problem with the web server on my machine? I use Mac OS Snow Leopard so i'm assuming it's apache that's generating this error.
Edit: Seems Grails as standard uses Jetty, so probably not Apache that is causing the problem. However also tested the app on Glassfish and i get the same error.
Anyone know what i can do to fix this?
Cheers
It depends on the code and Apache configuration you are using. I assume that the web server sends cyclic HTTP redirections, eg. from /root/ to /root (without the slash) and vice versa. This causes a redirection infinite loop.
Check your configuration on conditions that cause a HTTP redirect. For example, Apache automatically adds slashes to directory URLs in standard configuration (like the /root/ example above). I don't know Grails, so I cannot give you a hint on how URLs are processed within the app.
You can also use manual HTTP requests for debugging to see whats going on behind the scenes, using telnet on a terminal:
$ telnet localhost 80
GET / HTTP/1.0
I guess the response will be something like that:
HTTP/1.0 302 Found
Location: XXX
...
Now do a second request on the URL passed in the Location header and so on.
I was getting the same error a little while ago, heres how I fixed:
Try the same page on a different internet setup (it could be your ISP)
Open up Safari, Firefox or whatever your using and empty the cache and delete ALL your cookies
Reboot your computer and try again
It may work now, but if it doesn't:
open up Firefox and type 'about:config' (without the quotes) into the URL bar
You will get some little warning, just press OK
Type 'redirect' into the Filter box
You should see a listing for 'network.http.redirection-limit'
Double click the listing and type a large number (anything above 50 and lower than 200)
Press OK, quit and re-open FireFox
Basically all that does is make FireFox's tolerance for redirect loops higher which should fix your problem - but usually, just borrowing someone else's internet connection fixes it
Hope that all helps =)
Just carefully check your URLMappings configuration:
YOUR_APP/grails-app/conf/UrlMappings.groovy
Common case:
You configured request to be handled like this:
"/anything" (controller:"someController")
So without action, request will be handled by default one, "index". "index" action usually redirects to "list", and "list", in some cases redirect back to "index"
There is your loop.
Good luck

Internal Server Error

I am getting an unusual error while running my application, just wondering if anyone has come across this before. I am using google protocol buffers, my servlet takes a request and tries to process it, I have the following code:
InputStream s = request.getInputStream();
AdRequest adRequest = AdRequest.parseFrom(s);
After executing the second line I get the error below in Myeclipse debugger:
Source not found for ApplicationFilterChain.internalDoFilter(ServletRequest, ServletResponse) line: 310
I am using Jboss app server. I get a HTTP Status-Code 500: Internal Server Error.
Does anyone have any suggestions/thoughts?
I have sorted out the problem. The protobuffers.jar file was not being included in my projects .war file, even though I had added the jar to my project MyEclipse was not including it. Upon following the path to the Jboss server and looking inside the .war I found out the jar was not there. After copying it over to Jboss/.../default/server/deploy/myproject.war/WEB-INF/lib directory the error has gone away and I am able to send a request to the servlet.
Thanks.
Regards.
I'd check your jboss logs server//log/server.log (assuming you've not configured it to be somewhere else), and you'll get a better description of the problem.
The internal server error simply means that an unhandled exception is getting passed up the filter chain.

Categories

Resources