I am getting below error in browser while recording an application in JMeter.
org.apache.http.conn.HttpHostConnectException: Connection to http://access.xyz.com 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: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:481) at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:298) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74) at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1105) at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:236) Caused by: java.net.ConnectException: Connection timed out: 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) ... 10 more
I am giving the address as Localhost and port as 8080.
I am using JMeter 2.11 and it is working fine for all other applications.
Only while recording this particular application I am getting above error.
Your stack trace says in the first line:
org.apache.http.conn.HttpHostConnectException: Connection to http://access.xyz.com refused
In your description after the stack trace you said the service was on localhost port 8080. The problem is you are requesting a URL with no service behind it. Change the URL you are querying to:
http://localhost:8080
or if you've hacked your HOSTS file to have access.xyz.com resolve to localhost, then you need to specify the port number in your URL like this:
http://access.xyz.com:8080
Without the :8080, the protocol http uses the default port of 80. Similarly, the default port for the protocol https (SSL) is 443. If you use anything other than the default port, you have to explicitly set the port in the URL.
Related
I am running a JMeter test with "Java Request" sampler which performs POST request to HTTPS service which uses TLS v1.2. The request fails with
2015/12/01 19:11:50 ERROR - jmeter.protocol.java.sampler.AbstractJavaSamplerClient: 2015-12-01T16:11:50.189Z message:**** Exception in JMeter node for Login java.lang.RuntimeException: Failed to getServerToken
at com.chrysler.loadtest.GUIMimicLogin.getServerToken(GUIMimicLogin.java:227)
at com.chrysler.loadtest.GUIMimicLogin.runTest(GUIMimicLogin.java:97)
at org.apache.jmeter.protocol.java.sampler.JavaSampler.sample(JavaSampler.java:191)
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)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
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.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.http.impl.client.AbstractHttpClient.execute(AbstractHttpClient.java:784)
at com.chrysler.loadtest.GUIMimicLogin.getServerToken(GUIMimicLogin.java:215)
... 5 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at sun.security.ssl.InputRecord.read(Unknown Source)
... 18 more
JMeter used to work with this server when it used TLS v1.1. Is there a setting in JMeter properties which can set the applicable protocol.
The JMeter version is 2.13, Java version is 1.7.
This is an SSL error and can mean several things. Make sure you have TLS 1.2 enabled in your application (JVM argument?)(-Dhttps.protocols=TLSv1.2). You can use openssl to check the connection and see if you are getting back a certificate. If you are then check your keystore and make sure you have the correct certificate. You may not be authorized to access that server.
I am getting below error in browser while recording an application in Jmeter,
org.apache.http.conn.HttpHostConnectException: Connection to http://www.google.com 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: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:481)
at org.apache.jmeter.protocol.http.sampler.HTTPHC4Impl.sample(HTTPHC4Impl.java:298)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerProxy.sample(HTTPSamplerProxy.java:74)
at org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:1105)
at org.apache.jmeter.protocol.http.proxy.Proxy.run(Proxy.java:236) Caused by: java.net.ConnectException: Connection timed out: 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) ... 10 more
I am giving address as localhost and port is 8080. I am using Jmeter 2.11.
I am under corporate proxy.
Please suggest to resolve this error.
Thanks In Advance,
Kane
If you're under a corporate proxy you need to start JMeter a little bit differently:
Proxy-related command-line arguments are:
-H, --proxyHost <argument>
Set a proxy server for JMeter to use
-P, --proxyPort <argument>
Set proxy server port for JMeter to use
-N, --nonProxyHosts <argument>
Set nonproxy host list (e.g. *.apache.org|localhost)
-u, --username <argument>
Set username for proxy server that JMeter is to use
-a, --password <argument>
Set password for proxy server that JMeter is to use
So if you launch JMeter as follows:
jmeter -H your_corporate_proxy_host -P your_corporate_proxy_port etc
you should be able to record applications requiring Internet access via corporate proxy
See How do I run JMeter in non-gui mode? guide for more details and recommendations.
Add your corporate proxy address in the HTTP Request window
(which is located at bottom of window)
I am trying out GCM for communication between android client and a server application in java.
I am using XMPP based GCM as i need asynchronous, bidirectional messages.
On my client side,
1. Google Play Service check showed that an update is required.
google play services is out of date. Requires 4242000 but found 3136130
Api level- 17, Using AVD with google API, Android 4.2.2
Google play services Revision 15
How can i solve this?
But i can successfully register the device.
On Server side, i use
2. I am using smack library 3.4.1
i used the sample code in google docs.
I get the following error
gcm.googleapis.com:5235 Exception: XMPPError connecting to gcm.googleapis.com:5235.; : remote-server-error(502)
-- caused by: XMPPError connecting to gcm.googleapis.com:5235.: remote-server-error(502) XMPPError connecting to gcm.googleapis.com:5235.
-- caused by: java.net.ConnectException: Connection timed out: connect
at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:592)
at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1010)
at SmackCcsClient.connect(SmackCcsClient.java:247)
at SmackCcsClient.main(SmackCcsClient.java:341)
Nested Exception:
XMPPError connecting to gcm.googleapis.com:5235.: remote-server-error(502) XMPPError connecting to gcm.googleapis.com:5235.
-- caused by: java.net.ConnectException: Connection timed out: connect
at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:565)
at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1010)
at SmackCcsClient.connect(SmackCcsClient.java:247)
at SmackCcsClient.main(SmackCcsClient.java:341)
Nested Exception:
java.net.ConnectException: Connection timed out: 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 com.sun.net.ssl.internal.ssl.SSLSocketImpl.connect(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.<init>(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketFactoryImpl.createSocket(Unknown Source)
at org.jivesoftware.smack.XMPPConnection.connectUsingConfiguration(XMPPConnection.java:557)
at org.jivesoftware.smack.XMPPConnection.connect(XMPPConnection.java:1010)
at SmackCcsClient.connect(SmackCcsClient.java:247)
at SmackCcsClient.main(SmackCcsClient.java:341)
Exception in thread "main" java.lang.IllegalStateException: Not connected to server.
at org.jivesoftware.smack.XMPPConnection.sendPacket(XMPPConnection.java:483)
at SmackCcsClient.send(SmackCcsClient.java:131)
at SmackCcsClient.main(SmackCcsClient.java:356)
I have signed up the form for upstream messaging. but the approval is still pending. But the connection itself fails here. How can i solve this.
Please Help!
Thank you in advance!!
The ERROR CODE 502 implies that there is problem with connecting SERVER, There might be several reasons but some common problem are,
1 ) FIREWALL PROBLEM ----[configure properly your firewall]
2 ) Server internal error ----[retry latter]
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
Java sockets - java.net.ConnectException: Connection refused: connect
I've created a simple chat program which communicates using sockets. Everything works fine when I'm running it on localhost. However, the problems occur when I try to link the client and server programs using my IP.
http://www.canyouseeme.org/ can connect to my server on port 9999 so I know that the server is fine and the port is open. However, my client can't connect.
The error log...
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 java.net.Socket.connect(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at java.net.Socket.<init>(Unknown Source)
at Client.connect(Client.java:129)
at Client.main(Client.java:47)
Does anybody have any idea what might be causing this? Thanks in advance.
Links to the full source code:
http://pastebin.com/2XftHtn9
Are you trying to connect to your own server using its public IP address from inside your LAN? For most SoHo routers, port forwarding only works WAN-to-LAN, not LAN-to-LAN. What you're looking for is called "hairpin NAT", and many SoHo routers just don't do it. To reach your server from inside your LAN, use its inside IP address, not its public IP address.
After a hard work, I have set up Java RMI tunnelling using apache as http
server. Everything is fine and Works like a charm at my office LAN.But when I installed at client's place, I am getting some exception.The RMI System works only on his server.
When I tried from other clients' pcs I get the following.
Can you guys help me solve this?
java.rmi.ConnectException: Connection refused to host: 172.xx.x.xxx;
nested exception is: java.net.ConnectException: Connection timed
out: connect at sun.rmi.transport.tcp.TCPEndpoint.newSocket(Unknown
Source) at sun.rmi.transport.tcp.TCPChannel.createConnection(Unknown
Source) at sun.rmi.transport.tcp.TCPChannel.newConnection(Unknown
Source) at sun.rmi.server.UnicastRef.invoke(Unknown Source) at
java.rmi.server.RemoteObjectInvocationHandler.invokeRemoteMethod(Unknown
Source) at
java.rmi.server.RemoteObjectInvocationHandler.invoke(Unknown Source)
at $Proxy1.getUserID(Unknown Source) at
rmi.source.ServerImpl$JobScheduler.run(ServerImpl.java:265) at
java.util.TimerThread.mainLoop(Unknown Source) at
java.util.TimerThread.run(Unknown Source) Caused by:
java.net.ConnectException: Connection timed out: 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
java.net.Socket.connect(Unknown Source) at
java.net.Socket.<init>(Unknown Source) at
java.net.Socket.<init>(Unknown Source) at
sun.rmi.transport.proxy.RMIDirectSocketFactory.createSocket(Unknown
Source) at
sun.rmi.transport.proxy.RMIMasterSocketFactory.createSocket(Unknown
Source) ... 10 more
I am running files from roseindia rmi
there is mistake rmicregistry, one have to use rmiregistry:
I changed ip to localhost, how to run on special port number I don't know this moment
one has to use rmiregistry
not rmicregistry
so:
move to folder where does your class files take seat.
type : rmiregistry
then open 2 new command prompts move to same folder where classes seat and use one to run server and another to client.
RMI servers have the nasty habit to pass new port numbers to clients to handle the client communication to a particular Remote object. If this port number is blocked by the firewall, you would get an exception like that.
Make sure you register all Remote objects with the same port number. RMI will then multiplex the client calls for you.
after my research, the solution is:
System.setProperty("java.rmi.server.hostname", IP);
before you register the service on server side. following is an example, hope it might help you!
public static void main(String[] args) throws MalformedURLException, RemoteException, AlreadyBoundException {
RmiServer server=new RmiServer();
System.setProperty("java.rmi.server.hostname", 指定IP);
LocateRegistry.createRegistry(8808);
Naming.rebind("//10.10.116.74:8808/SAMPLE-SERVER", server);
}