Blocked Thread Exception While Using BR-POP and Socket - sockets

We have running 1 vert.x Server connected with redis and DB for running Messenger App.
5~7 people(client) connected to redis simultaneously.
when we send a message to others or do some task processing via Web Socket.
WARNING: Thread Thread[vert.x-worker-thread-4,5,main] has been blocked for 74241 ms, time limit is 60000
io.vertx.core.VertxException: Thread blocked
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.socketRead(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at redis.clients.util.RedisInputStream.ensureFill(RedisInputStream.java:195)
at redis.clients.util.RedisInputStream.readByte(RedisInputStream.java:40)
at redis.clients.jedis.Protocol.process(Protocol.java:141)
at redis.clients.jedis.Protocol.read(Protocol.java:205)
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:297)
at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:233)
at redis.clients.jedis.Connection.getMultiBulkReply(Connection.java:226)
at redis.clients.jedis.Jedis.brpop(Jedis.java:1716)
at redis.clients.jedis.Jedis.brpop(Jedis.java:3400)
at com.ontheit.redis.clients.AbstractRedisClient.BRPOP(AbstractRedisClient.java:59)
at com.ontheit.redis.clients.AbstractRedisClient.BRPOP(AbstractRedisClient.java:50)
at com.ontheit.redis.clients.RedisRequestDaemonClient.getNotify(RedisRequestDaemonClient.java:147)
at com.ontheit.vertx.cache.CacheWorkVerticle.lambda$0(CacheWorkVerticle.java:27)
at com.ontheit.vertx.cache.CacheWorkVerticle$$Lambda$80/1754003563.handle(Unknown Source)
at io.vertx.core.impl.ContextImpl.lambda$executeBlocking$1(ContextImpl.java:273)
at io.vertx.core.impl.ContextImpl$$Lambda$85/1241209246.run(Unknown Source)
at io.vertx.core.impl.TaskQueue.run(TaskQueue.java:76)
at io.vertx.core.impl.TaskQueue$$Lambda$9/1676010932.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Unknown Source)
we got this warning
we cant understand that warning came out with current circumstance.
we also can't understand why clients number is too high compare to real user who is using redis server.
how can we solved this?

Related

java.lang.OutOfMemoryError: GC overhead limit exceeded on Scala

I'M Scala developer,I am getting this error in a Routes file it contains 1008 lines if I add another Line that's throw given below error..
Uncaught error from thread [sbt-web-scheduler-1] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[sbt-web]
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
at java.util.jar.Manifest.read(Unknown Source)
at java.util.jar.Manifest.<init>(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getManifest(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
[ERROR] [04/12/2016 15:17:32.883] [sbt-web-scheduler-1] [ActorSystem(sbt-web)] exception on LARSÆ timer thread
at java.net.URLClassLoader.access$100(Unknown Source)
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at akka.actor.LightArrayRevolverScheduler$$anon$8.nextTick(Scheduler.scala:409)
at java.security.AccessController.doPrivileged(Native Method)
at akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:375)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.Thread.run(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at akka.event.Logging$Info$.apply(Logging.scala:665)
at akka.event.BusLogging.notifyInfo(Logging.scala:1140)
at akka.event.LoggingAdapter$class.info(Logging.scala:950)
at akka.event.BusLogging.info(Logging.scala:1128)
at akka.actor.LightArrayRevolverScheduler$$anon$8.run(Scheduler.scala:382)
[ERROR] [04/12/2016 15:18:33.808] [sbt-web-scheduler-1] [ActorSystem(sbt-web)] Uncaught error from thread [sbt-web-scheduler-1] at java.lang.Thread.run(Unknown Source)
shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled
java.lang.OutOfMemoryError: GC overhead limit exceeded
at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
at java.util.jar.Manifest$FastInputStream.<init>(Unknown Source)
at java.util.jar.Manifest.read(Unknown Source)
at java.util.jar.Manifest.<init>(Unknown Source)
at java.util.jar.JarFile.getManifestFromReference(Unknown Source)
at java.util.jar.JarFile.getManifest(Unknown Source)
at sun.misc.URLClassPath$JarLoader$2.getManifest(Unknown Source)
at java.net.URLClassLoader.defineClass(Unknown Source)
at java.net.URLClassLoader.access$100(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
How Many lines accepted in Routes? How can I solve this?
Editor: Eclipse
Thanks By,
B.UdayaKumar
Usually, this error is thrown when there is insufficient space to allocate an object in the Java heap. In this case, The garbage collector cannot make space available to accommodate a new object, and the heap cannot be expanded further. Also, this error may be thrown when there is insufficient native memory to support the loading of a Java class. In a rare instance, a java.lang.OutOfMemoryError may be thrown when an excessive amount of time is being spent doing garbage collection and little memory is being freed.
You're essentially running out of memory to run the process smoothly. Options that come to mind are:
Specify more memory using the JAVA_OPTS enviroment variable, try something in between like -Xmx1G.
You can also tune your GC manually by enabling -XX:+UseConcMarkSweepGC
For more options on GC tuning refer Concurrent Mark Sweep
Increasing the HEAP size should fix your routes limit problem.

Couldn't connect to the Box API due to a network error?

I am getting below mentioned error while accessing the box api using box java sdk in java application.Please suggest the cause for this problem.
Exception in thread "main" com.box.sdk.BoxAPIException: Couldn't connect to the Box API due to a network error.
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:386)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:200)
at com.box.sdk.BoxAPIRequest.send(BoxAPIRequest.java:175)
at com.box.sdk.BoxUser.getCurrentUser(BoxUser.java:112)
at com.box.cdm.demo.Main.main(Main.java:24)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
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.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.<init>(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewHttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.connect(Unknown Source)
at com.box.sdk.BoxAPIRequest.trySend(BoxAPIRequest.java:384)
... 4 more
The main causes of this exception - and the things you need to check - are:-
There is no network between your application (the client) and the server (the Box API). Where is the Box instance running, on same machine as your application (locally)?
What port is Box listening on? You need to show your connection code code (endpoint / port etc).
If client and server on different hardware, and you know you have a network connection between them then is Box behind firewall?

DocuSign : Getting connection timedout while using the Java program in the Demo site.

I am new to DocuSign.
Started trying with the basic Login authentication in Java. Used the code snippet in the below link.
http://iodocs.docusign.com/APIWalkthrough/getEnvelopeRecipientStatus#java
Getting the below exception.
Exception in thread "main" java.net.ConnectException: Connection timed out: conn
ect
at java.net.DualStackPlainSocketImpl.connect0(Native Method)
at java.net.DualStackPlainSocketImpl.socketConnect(Unknown Source)
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.BaseSSLSocketImpl.connect(Unknown Source)
at sun.net.NetworkClient.doConnect(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.http.HttpClient.openServer(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.New(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.getNewH
ttpClient(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown Sour
ce)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect
(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown So
urce)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unk
nown Source)
at GetEnvelopeInfo.main(GetEnvelopeInfo.java:56)
Tried to Ping the server address. got the same Request timed out error.
ping demo.docusign.net
Pinging demo.docusign.net.akadns.net [209.46.117.172] with 32 bytes of data:
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Please help me out on this.
You might need to set the proxy information for your environment. The jvm parameters are http.proxyHost and http.proxyPort. It can be set by using
System.setProperty("http.proxyHost", "yourProxyHostname");

SoapUI: ConnectException: Connection timed out:

i try to send request via REST.
I get success response when using firefox rest-client,
but in SoapUI i get exception attached below.
How to resolve this issue?
Thanks.
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.(Unknown Source)
at java.net.Socket.(Unknown
Source) at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:80)
at
org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:122)
at
org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:707)
at
com.eviware.soapui.impl.wsdl.support.http.SoapUIMultiThreadedHttpConnectionManager$HttpConnectionAdapter.open(SoapUIMultiThreadedHttpConnectionManager.java:1637)
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
com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:202)
at
com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
at
java.util.concurrent.Executors$RunnableAdapter.call(Unknown
Source) at
java.util.concurrent.FutureTask$Sync.innerRun(Unknown
Source) at
java.util.concurrent.FutureTask.run(Unknown
Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown
Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown
Source) at
java.lang.Thread.run(Unknown Source)
Default socket timeout is set to 60000 milliseconds.
You can change it:
File -> Preferences -> HTTP Settings -> Socket Timeout
You can also set the value to 0 and then it doesn't time out.
Tested it with SoapUI 4.5.0
You can also set timeout for your request, it's on left bottom Request properties, that helped me (SoapUI 5.4.0)
I would try adjusting the socket timeout in SoapUI preferences. SoapUI has a standard timeout of 60000 milliseconds. I would try making that much larger to see if you have the same issue. This has fixed a timeout issue for myself before.
You can also edit this setting directly in the soapui-settings.xml
<con:setting id="HttpSettings#socket_timeout">120000</con:setting>
If this doesn't help, try asking on the eviware forum.
Apart from adjusting timeouts, if this issue still persists then it could be because few of the plugins needed by SoapUI are not loaded. Because these plugins are present in some other place that require permission to access.
If u check your logs u can find this trace :
java.lang.ClassNotFoundException: com.eviware.soapui.plugins.auto.factories.AutoImportMethodFactory
at java.net.URLClassLoader$1.run(Unknown Source)
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
The problem does not occur when starting the SoapUI directly from bin
Also you can run with Administrative privileges.

MongoDB java.net.ConnectException: Connection refused

I have problem with used MongoDB
I am testing a web aplication use Jmeter test.
When set up a big load, on the web application, it is right.
When set up a low load but many users, it is beginning exception..
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
sun.net.NetworkClient.doConnect(Unknown
Source) at
sun.net.www.http.HttpClient.openServer(Unknown
Source) at
sun.net.www.http.HttpClient.openServer(Unknown
Source) at
sun.net.www.http.HttpClient.(Unknown
Source) at
sun.net.www.http.HttpClient.New(Unknown
Source) at
sun.net.www.http.HttpClient.New(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.plainConnect(Unknown
Source) at
sun.net.www.protocol.http.HttpURLConnection.connect(Unknown
Source) at
org.apache.jmeter.protocol.http.sampler.HTTPSampler.sample(HTTPSampler.java:483)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:965)
at
org.apache.jmeter.protocol.http.sampler.HTTPSamplerBase.sample(HTTPSamplerBase.java:951)
at
org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:348)
at
org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:243)
at java.lang.Thread.run(Unknown
Source)
Tell me please, why..? (I use MongoDB, Tomcat, Java)Thanks..
This is the type of error you should expect to see when load testing any web application with a tool like JMeter, and tells you that you're hitting the upper limit of transactions that the app can support... and this is where you'd do some tweaking of the settings to get better results.
The error message is saying that there are too many HTTP connections going at once and Tomcat is overwhelmed. I'm not sure which version of Tomcat you're on, but it looks like the default for Tomcat 6 is to queue up to 100 requests, then refuse any after that, and maxes out at 200 threads. Try increasing the "acceptCount" or "maxThreads" and see if that helps.
You may also try retagging the question, since this is a broader problem that affects more than just MongoDB apps... and you should get more replies that way. ;)