Getting jmeter error: java.net.UnknownHostException: This is usually a temporary error during hostname resolution - jmeter-4.0

I am a beginner to jmeter. I am trying to perform a simple load test using jmeter 4.0. I created a HTTP sampler and added a view results tree listener.
HTTP Sampler
But getting the below error under Response data in results tree.
"java.net.UnknownHostException: This is usually a temporary error during hostname resolution and means that the local server did not
receive a response from an authoritative server at
java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at
java.net.InetAddress$2.lookupAllHostAddr(Unknown Source) at
java.net.InetAddress.getAddressesFromNameService(Unknown Source) at
java.net.InetAddress.getAllByName0(Unknown Source) at
java.net.InetAddress.getAllByName(Unknown Source) at
java.net.InetAddress.getAllByName(Unknown Source) at
org.apache.http.impl.conn.SystemDefaultDnsResolver.resolve(SystemDefaultDnsResolver.java:45)
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.resolveHostname(DefaultClientConnectionOperator.java:263)
at
org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:162)
at
org.apache.jmeter.protocol.http.sampler.hc.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:318)
at
org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.open(MeasuringConnectionManager.java:114)
at
org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:610)
at
org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:445)
at
org.apache.http.impl.client.AbstractHttpClient.doExecute(AbstractHttpClient.java:835)
at
org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:697)
at
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:455)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1189)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1178)
at
org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:490)
at
org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:416)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:250)
at java.lang.Thread.run(Unknown Source)"
All requests are getting failed. There is no problem in internet connectivity. Please resolve my issue.

I just faced same issue. Found solution using below steps:
1.
Protocol:http/https
server name/IP:google.com
port & path:blank(as no params)
add proxy details if required

Related

Error when setting 'maxThreadsActive' on anypoint MQ

I am trying to set "maxThreadsActive" to 1 , to make sure there is only one thread pulling messages form queue , but for some reason i am getting sax parse exception in compile time .
Following is the Configuration :
<anypoint-mq:config name="Anypoint_MQ_Configuration"
provider-ref="anypointMQ_Provider_Settings" doc:name="Anypoint MQ Configuration" >
<http:worker-threading-profile maxThreadsActive="1"/>
</anypoint-mq:config>
error :
ERROR 2017-10-04 12:35:00,849 [main] org.mule.module.launcher.application.DefaultMuleApplication: null
org.xml.sax.SAXParseException: cvc-complex-type.2.4.a: Invalid content was found starting with element 'http:worker-threading-profile'. One of '{"http://www.mulesoft.org/schema/mule/core":annotations, "http://www.mulesoft.org/schema/mule/tls":context, "http://www.mulesoft.org/schema/mule/http":proxy, "http://www.mulesoft.org/schema/mule/anypoint-mq":provider, "http://www.mulesoft.org/schema/mule/anypoint-mq":prefetch, "http://www.mulesoft.org/schema/mule/anypoint-mq":worker-threading-profile}' is expected.
at org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(Unknown Source) ~[?:?]
at org.apache.xerces.util.ErrorHandlerWrapper.error(Unknown Source) ~[?:?]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[?:?]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[?:?]
at org.apache.xerces.impl.XMLErrorReporter.reportError(Unknown Source) ~[?:?]
The issue is with the Anypoint Studio.
The anypoint-mq connector configuration from Studio creates a internal tag with http:worker-threading-profile, which is not a valid child element for the anypoint-mq:config element.
To fix the error, you need to manually update the XML file by removing the http:worker-threading-profile, and add the following child element 'anypoint-mq:worker-threading-profile'. If you add this element, then it would not be shown in the Studio, but it will set the Thread profiling to Anypoint MQ connector.
This is an error with Studio.
Please refer the following link and go to section 'Threading Profile Settings'
https://docs.mulesoft.com/mule-user-guide/v/3.9/anypoint-mq-connector-reference
It seems you may be missing some configurations, do check the following SO answer : https://stackoverflow.com/a/37904111/7141847
And if you are setting maxThreadsActive to 1 i believe you need to set poolExhaustedAction="WAIT" in anypoint-mq-configurations
I have faced the similar issue.To ressolve this we need to use updated anypoint mq connector for the AnypointStudio-version(6.6.0).
Studio & Mq version

Jmeter 3.1- javax.net.ssl.SSLException: Received fatal alert: protocol_version

We are trying to run https request in Jmeter 3.1.
But while executing getting following error.
javax.net.ssl.SSLException: Received fatal alert: protocol_version
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.recvAlert(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.writeRecord(Unknown Source)
at sun.security.ssl.AppOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:828)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2116)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
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:269)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1166)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1155)
at org.apache.jmeter.threads.JMeterThread.executeSamplePackage(JMeterThread.java:475)
at org.apache.jmeter.threads.JMeterThread.processSampler(JMeterThread.java:418)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:249)
at java.lang.Thread.run(Unknown Source)
We tried following solutions but did't solved the issue:
added "https.default.protocol=TLSv1" in "jmeter.properties" file
Tried solution provided in
http://rajanmanoj.blogspot.in/2011/02/how-to-test-ssl-using-jmeter.html
this link
We are Using Jmeter 3.1, Java Jdk 1.7, Windows 7
Https default protocol may vary depending on the version of JVM.
You can change it. Go to jmeter home directory. Open jmeter.properties file. Uncomment line:
https.default.protocol=SSLv3
May be you need to restart jmeter after change. Not sure about that.
This is highly due to protocol version mismatch. There is mismatch between SSL protocol version used by the client and the server.
Make sure that you have latest version of Java and JMeter installed in your system. Also check for the security certificate in JMETER_HOME\bin folder.
You can check this question for more details.

NTLM Authentication with JMeter is receiving a SocketException

I'm trying to load test a SSO request with JMeter (version 2.13). I followed this tutorial and set up an HTTP Authorization Manager with Username, Password, Domain and Mechanism = BASIC_DIGEST.
When I set the proxy server settings of my HTTP Request to Server Name or IP = 127.0.0.1 and Port Number = 8888, I can see my request go through fiddler where it gets two 401 responses and then succeeds. This shows up in the JMeter View Results Tree as a single successful request. However, when I remove the proxy server settings, the request fails and I get the following response:
java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at sun.security.ssl.InputRecord.readFully(Unknown Source)
at sun.security.ssl.InputRecord.read(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at org.apache.http.conn.ssl.SSLSocketFactory.connectSocket(SSLSocketFactory.java:436)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.jmeter.protocol.http.sampler.MeasuringConnectionManager$MeasuredConnection.open(MeasuringConnectionManager.java:107)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:643)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.executeRequest(HTTPHC4Impl.java:517)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:331)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1146)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1135)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:434)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:261)
at java.lang.Thread.run(Unknown Source)
The log viewer also says this:
org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl$6: I/O exception (java.net.SocketException) caught when connecting to the target host: Connection reset
I have been trying all sorts of things to get this working without the proxy settings including using the HttpClient4 implementation, setting the following in user.properties
hc.parameters.file=hc.parameters
and the following in httpclient.parameters
http.protocol.reject-relative-redirect$Boolean=true
I will also note that when I run the test through Fiddler, I get a prompt asking if I want to ignore remote certificate errors
Session #106: The remote server (server name here) presented a certificate that did not validate, due to RemoteCertificateChainErrors.
0 - Unknown error.
I am assuming this won't make any difference in JMeter as I read that JMeter HTTP samplers are configured to accept all certificates.
Any help getting this up and running (without Fiddler) would be much appreciated.
The problem was that the Secure Credential Store I was trying to connect to required TLS version 1.0. I had to tell JMeter to use this by updating the jmeter.properties file with:
https.default.protocol=TLS
https.socket.protocols=TLSv1

Distributed Testing with Jmeter

I am using Jmeter 2.8 and trying to do distributed (master-slave) testing for the first time.
I setup everything fine
set Ip addresses in JMeter.properties
run Jmater-server.bat on all machines
but when I run test(a very simple request) it gets failed:
Request:
http://localhost:8080/web/login?credentials=<credential><userId>WillieWonka
</userId><passwd><![CDATA[WillieWonka]]></passwd></credential>
Error I am getting is
org.apache.http.conn.HttpHostConnectException: Connection to http://localhost:8080 refused
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:190)
at org.apache.http.impl.conn.ManagedClientConnectionImpl.open(ManagedClientConnectionImpl.java:294)
at org.apache.http.impl.client.DefaultRequestDirector.tryConnect(DefaultRequestDirector.java:640)
at org.apache.http.impl.client.DefaultRequestDirector.execute(DefaultRequestDirector.java:479)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:906)
at org.apache.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:805)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:284)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:62)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1075)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1064)
at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:426)
at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:255)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.PlainSocketImpl.doConnect(Unknown Source)
at java.net.PlainSocketImpl.connectToAddress(Unknown Source)
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at org.apache.http.conn.scheme.PlainSocketFactory.connectSocket(PlainSocketFactory.java:127)
at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:180)
While server is up and running (I tested this request running from localMachine only, It is working fine).
What is wrong?
What I am missing?
I have resolved this issue, replaced
localhost:8080
with
computerName:8080
and start application server via start.bat instead run.bat
now it is working fine.

Using Apache Directory Studio

I have followed http://confluence.atlassian.com/display/CROWD/Creating+a+Connection+to+your+LDAP+Directory
for basic understanding and trying to set up LDAP for my office use.
scenario:
I have started Apache 2.2 (Apache Directory Server) at localhost:389 and it's running fine.
Next, I installed Apache DirectoryStudio and trying to create new connection. But I am getting the following error while opening the connection:
Error while opening connection - localhost:389; socket closed
javax.naming.ServiceUnavailableException: localhost:389; socket closed
at com.sun.jndi.ldap.Connection.readReply(Unknown Source)
at com.sun.jndi.ldap.LdapClient.ldapBind(Unknown Source)
at com.sun.jndi.ldap.LdapClient.authenticate(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.connect(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.ensureOpen(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.ensureOpen(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.reconnect(Unknown Source)
at javax.naming.ldap.InitialLdapContext.reconnect(Unknown Source)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper$7.run(JNDIConnectionWrapper.java:1055)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.runAndMonitor(JNDIConnectionWrapper.java:1272)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.doBind(JNDIConnectionWrapper.java:1065)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.bind(JNDIConnectionWrapper.java:254)
at org.apache.directory.studio.connection.core.jobs.OpenConnectionsRunnable.run(OpenConnectionsRunnable.java:114)
at org.apache.directory.studio.connection.core.jobs.StudioConnectionJob.run(StudioConnectionJob.java:114)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
Please guide me!
I resolved this by changing theport numbers.
Now I am getting the following error:
Error while opening connection - [LDAP: error code 49 - cannot bind the principalDn.]
javax.naming.AuthenticationException: [LDAP: error code 49 - cannot bind the principalDn.]
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.connect(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.ensureOpen(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.ensureOpen(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.reconnect(Unknown Source)
at javax.naming.ldap.InitialLdapContext.reconnect(Unknown Source)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper$7.run(JNDIConnectionWrapper.java:1055)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.runAndMonitor(JNDIConnectionWrapper.java:1272)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.doBind(JNDIConnectionWrapper.java:1065)
at org.apache.directory.studio.connection.core.io.jndi.JNDIConnectionWrapper.bind(JNDIConnectionWrapper.java:254)
at org.apache.directory.studio.connection.core.jobs.OpenConnectionsRunnable.run(OpenConnectionsRunnable.java:114)
at org.apache.directory.studio.connection.core.jobs.StudioConnectionJob.run(StudioConnectionJob.java:114)
at org.eclipse.core.internal.jobs.Worker.run(Worker.java:55)
This means that your connection to the ldap server is wrong. I know the default username and password for Apache DS is admin and secret respectively.
Try the following as the bind DN or user string:
uid=admin,ou=system