Bug 57682 - Windows 8.1 - java.net.SocketException: Permission denied: connect
Summary: Windows 8.1 - java.net.SocketException: Permission denied: connect
Status: RESOLVED WORKSFORME
Alias: None
Product: JMeter - Now in Github
Classification: Unclassified
Component: HTTP (show other bugs)
Version: 2.12
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: JMeter issues mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-03-10 09:37 UTC by Sorin
Modified: 2015-03-22 14:39 UTC (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sorin 2015-03-10 09:37:27 UTC
Test environment:
- OS: Windows 8.1 Pro
- Jmeter version: 2.12 r1636949
- Java version: Java(TM) SE Runtime Environment (build 1.7.0_71-b14)

Jmeter test setup:
- Threads: 50
- Ramp-Up period: 1
- Loop: 3

Steps to reproduce:
- I created a Jmeter script for a web application I want to test (can't go into much details about the app)
- I executed the test first using the following setup: Threads (50), Ramp-Up (1) and Loop (1) and the test is successfully executed.
- I executed the test using the same setup, except 3 loops instead of 1 and the test fails with the following error:
java.net.SocketException: Permission denied: connect
	at java.net.TwoStacksPlainSocketImpl.socketConnect(Native Method)
	at java.net.AbstractPlainSocketImpl.doConnect(Unknown Source)
	at java.net.AbstractPlainSocketImpl.connectToAddress(Unknown Source)
	at java.net.AbstractPlainSocketImpl.connect(Unknown Source)
	at java.net.PlainSocketImpl.connect(Unknown Source)
	at java.net.SocksSocketImpl.connect(Unknown Source)
	at java.net.Socket.connect(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.connect(Unknown Source)
	at sun.security.ssl.SSLSocketImpl.<init>(Unknown Source)
	at sun.security.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
	at org.apache.jmeter.util.HttpSSLProtocolSocketFactory.createSocket(HttpSSLProtocolSocketFactory.java:151)
	at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
	at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:387)
	at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
	at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
	at org.apache.jmeter.protocol.http.sampler.HTTPHC3Impl.sample(HTTPHC3Impl.java:265)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1141)
	at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1130)
	at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:431)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:258)
	at java.lang.Thread.run(Unknown Source)

- I also tested the same test on a Linux machine and it worked fine even with 200 threads and 5 loops.
- I also tested the same test on a Windows 7 machine and it worked fine for 50 threads and 3 loops. The thing is that it didn't worked with default settings, I had to add to jmeter.bat the following line: "set JVM_ARGS=-Djava.net.preferIPv4Stack=true"
- On Windows 8.1 machine, I also added the following line to jmeter.bat "set JVM_ARGS=-Djava.net.preferIPv4Stack=true" but the same error occurred.
- I also tested the same test on a different Windows 8.1 machine, but the same error occurred.

I believe this is a bug of Jmeter, happening only on Windows 8, or at least the workaround that worked on Windows 7, does not work on Windows 8.

Please advice!

Thank you!

Best regards,
Sorin
Comment 2 Sorin 2015-03-13 06:57:59 UTC
As it was mentioned in the original description:
Java version: Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Do you need something else regarding Java version?

Here is the full java -version result (don't know if it makes any difference though):
java version "1.7.0_71"
Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)
Comment 3 Philippe Mouawad 2015-03-13 20:55:33 UTC
(In reply to Sorin from comment #2)
> As it was mentioned in the original description:
> Java version: Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
> Do you need something else regarding Java version?
> 
Indeed sorry I missed this information.

> Here is the full java -version result (don't know if it makes any difference
> though):
> java version "1.7.0_71"
> Java(TM) SE Runtime Environment (build 1.7.0_71-b14)
> Java HotSpot(TM) 64-Bit Server VM (build 24.71-b01, mixed mode)


Could you try what is in stackoverflow answer please and say if it worked ?
Thanks
Comment 4 Sorin 2015-03-14 07:18:23 UTC
Again... as I mentioned in the initial description I tried also -Djava.net.preferIPv4Stack=true option... and didn't worked...
It worked only on Windows 7.
Comment 5 Philippe Mouawad 2015-03-14 07:58:17 UTC
If you read the full answers and comment there is one that mentions using java6.
Did you try this one ?
As a bug in java7 is mentionned.
Comment 6 Sorin 2015-03-14 08:09:59 UTC
I used also Java 6 & Java 8, with -Djava.net.preferIPv4Stack=true but same result.
Comment 7 Philippe Mouawad 2015-03-14 08:36:20 UTC
Are you admin on this system ?
Can't it be a rights issue ?
Comment 8 Sorin 2015-03-17 06:57:12 UTC
I am admin, therefore no issue because of access rights.
Comment 9 Philippe Mouawad 2015-03-22 14:39:13 UTC
Hi,
I tried it with :
Windows 8.1 PRO
Java 1.8_40
Same Test plan


It works for me.
I suggest you check for firewall or some antivirus doing this or a proxy you are passing through.

Also try hitting another server.

For now closing as WORKSFORME , feel free to reopen with more details.
Comment 10 The ASF infrastructure team 2022-09-24 20:37:59 UTC
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/3556