How to set static port for RMI RenewClean Thread - rmi

Every time i re start my application RMI RenewClean Thread listens on dynamic port , below is my Thread stack trace
"RMI RenewClean-[10.58.121.180:16406]" Id=23 in TIMED_WAITING on lock=java.lang.ref.ReferenceQueue$Lock#6ab17e0a
at java.lang.Object.wait(Native Method)
at java.lang.ref.ReferenceQueue.remove(Unknown Source)
at sun.rmi.transport.DGCClient$EndpointEntry$RenewCleanThread.run(Unknown Source)
at java.lang.Thread.run(Unknown Source

Export your remote object on a fixed port.

Related

Blocked Thread Exception While Using BR-POP and Socket

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?

Connect on MongoDB under AmazonEC2 instance

I'm starting with AmazonEC2 and created a security group with port 27017 open, but when I try to connect using "MongoClient" (java) I got the following output, can someone help me?
I'm also using Amazon Linux, and already tried to check to MongoDB documentation (https://docs.mongodb.org/ecosystem/platforms/amazon-ec2/)
Exception in monitor thread while connecting to server ec2-54-233-146-156.sa-east-1.compute.amazonaws.com:27017
com.mongodb.MongoSocketOpenException: Exception opening socket
at com.mongodb.connection.SocketStream.open(SocketStream.java:63)
at com.mongodb.connection.InternalStreamConnection.open(InternalStreamConnection.java:114)
at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:127)
at java.lang.Thread.run(Unknown Source)
Caused by: java.net.ConnectException: Connection refused: connect
at java.net.DualStackPlainSocketImpl.waitForConnect(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 com.mongodb.connection.SocketStreamHelper.initialize(SocketStreamHelper.java:50)
at com.mongodb.connection.SocketStream.open(SocketStream.java:58)
... 3 more
Follow below my security group policies print screen:
Security group policies
Check your mongodb config and ensure that the bind IP is not set to 127.0.0.1 and listens to external connections
See if you can connect to mongo locally on that port
Take a look at this if the above two don't fix your issue https://serverfault.com/a/347272/269101

Bluemix remote debugging session not starting

I have followed the Bluemix/Eclipse instructions to setup the Liberty servers in eclipse. Able to do everything with the Bluemix/eclipse tools except for remote debugging.
Receiving the following exceptions/errors when I select the "Enable Debug Mode" on my application under the servers.
Tried a longer Debug timeout but that has not helped. Any pointers?
TIA
[2015-11-30 07:16:56.832] bluemixMgmgClient - ???? [pool-1-thread-1]
.... ERROR --- ClientProxyImpl: Cannot create the websocket
connections for JavaMemcachedApp
com.ibm.ws.cloudoe.management.client.exception.ApplicationManagementException:
javax.websocket.DeploymentException: The HTTP request to initiate the
WebSocket connection failed at
com.ibm.ws.cloudoe.management.client.impl.ClientProxyImpl.onNewClientSocket(ClientProxyImpl.java:161)
at
com.ibm.ws.cloudoe.management.client.impl.ClientProxyImpl$RunServerTask.run(ClientProxyImpl.java:267)
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.runWorker(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at
java.lang.Thread.run(Unknown Source) Caused by:
javax.websocket.DeploymentException: The HTTP request to initiate the
WebSocket connection failed at
org.apache.tomcat.websocket.WsWebSocketContainer.connectToServer(WsWebSocketContainer.java:315)
at
com.ibm.ws.cloudoe.management.client.impl.ClientProxyImpl.onNewClientSocket(ClientProxyImpl.java:158)
... 7 more Caused by: java.util.concurrent.TimeoutException at
org.apache.tomcat.websocket.AsyncChannelWrapperSecure$WrapperFuture.get(AsyncChannelWrapperSecure.java:505)
at
org.apache.tomcat.websocket.WsWebSocketContainer.processResponse(WsWebSocketContainer.java:542)
at
org.apache.tomcat.websocket.WsWebSocketContainer.connectToServer(WsWebSocketContainer.java:296)
... 8 more [2015-11-30 07:17:56.868] bluemixMgmgClient - ????
[pool-1-thread-1] .... ERROR --- ClientProxyImpl: Cannot create the
websocket connections for JavaMemcachedApp
com.ibm.ws.cloudoe.management.client.exception.ApplicationManagementException:
javax.websocket.DeploymentException: The HTTP request to initiate the
WebSocket connection failed at
com.ibm.ws.cloudoe.management.client.impl.ClientProxyImpl.onNewClientSocket(ClientProxyImpl.java:161)
at
com.ibm.ws.cloudoe.management.client.impl.ClientProxyImpl$RunServerTask.run(ClientProxyImpl.java:267)
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.runWorker(Unknown Source) at
java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source) at
java.lang.Thread.run(Unknown Source) Caused by:
javax.websocket.DeploymentException: The HTTP request to initiate the
WebSocket connection failed at
org.apache.tomcat.websocket.WsWebSocketContainer.connectToServer(WsWebSocketContainer.java:315)
at
com.ibm.ws.cloudoe.management.client.impl.ClientProxyImpl.onNewClientSocket(ClientProxyImpl.java:158)
... 7 more Caused by: java.util.concurrent.TimeoutException at
org.apache.tomcat.websocket.AsyncChannelWrapperSecure$WrapperFuture.get(AsyncChannelWrapperSecure.java:505)
at
org.apache.tomcat.websocket.WsWebSocketContainer.processResponse(WsWebSocketContainer.java:542)
at
org.apache.tomcat.websocket.WsWebSocketContainer.connectToServer(WsWebSocketContainer.java:296)
... 8 more
You need to ensure that you've done the following:
Enabled & configured the debug App Management utility as indicated here (1).
Ensure that dev mode for Eclipse Tools is enabled as indicated here (2).
Enable Remote Debug in Eclipse Tools as indicate here (3).
(1) https://www.ng.bluemix.net/docs/manageapps/app_management.html#Utilities
(2) https://www.ng.bluemix.net/docs/manageapps/app_management.html#devmode
(3) https://www.ng.bluemix.net/docs/manageapps/eclipsetools/eclipsetools.html#remotedebug
Do you happens to be using IBM JDK to launch the workbench? There is an existing problem that we are tracking on the debug support using that combination. If you happens to be using that, can you try using an Orcale JDK 8 to see if that resolves the problem?
The issue was with the JDK in use .... replaced the ORACLE JDK 7 with ORACLE JRE 8 and that resolved the issue.
Regards
RS

jstack understanding

I'm using JBoss 5.1.0 in a production environment and the shutdown time is quite long at times(>10 minutes). I've used jstack during one of the shutdown operations but I can't really understand its output. I'm attaching a snippet if there is some one who can help me.
Thank you.
"Thread-7326 (group:HornetQ-remoting-threads318818410-409317605)" prio=10 tid=0x000000004097b000 nid=0xbae waiting on condition [0x00007fc43f829000]
java.lang.Thread.State: TIMED_WAITING (parking)
at sun.misc.Unsafe.park(Native Method)
- parking to wait for <0x00000000c9d55b28> (a java.util.concurrent.SynchronousQueue$TransferStack)
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:198)
at java.util.concurrent.SynchronousQueue$TransferStack.awaitFulfill(SynchronousQueue.java:424)
at java.util.concurrent.SynchronousQueue$TransferStack.transfer(SynchronousQueue.java:323)
at java.util.concurrent.SynchronousQueue.poll(SynchronousQueue.java:874)
at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:945)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:907)
at java.lang.Thread.run(Thread.java:662)
"JBoss Shutdown Hook" daemon prio=10 tid=0x0000000041b59800 nid=0xba9 runnable [0x00007fc4530ca000]
java.lang.Thread.State: RUNNABLE
at java.lang.Throwable.fillInStackTrace(Native Method)
- locked <0x00000000f1e29d48> (a java.lang.NoSuchMethodException)
at java.lang.Throwable.<init>(Throwable.java:196)
at java.lang.Exception.<init>(Exception.java:41)
at java.lang.NoSuchMethodException.<init>(NoSuchMethodException.java:32)
at java.lang.Class.getDeclaredMethod(Class.java:1937)
at org.jboss.ejb3.interceptors.lang.SecurityActions$2.run(SecurityActions.java:58)
at org.jboss.ejb3.interceptors.lang.SecurityActions$2.run(SecurityActions.java:55)
at java.security.AccessController.doPrivileged(Native Method)
at org.jboss.ejb3.interceptors.lang.SecurityActions.getDeclaredMethod(SecurityActions.java:53)
at org.jboss.ejb3.interceptors.lang.ClassHelper.getDeclaredMethod(ClassHelper.java:165)
at org.jboss.ejb3.interceptors.lang.ClassHelper.getDeclaredMethod(ClassHelper.java:176)
at org.jboss.ejb3.interceptors.lang.ClassHelper.getDeclaredMethod(ClassHelper.java:176)
at org.jboss.ejb3.interceptors.lang.ClassHelper.getMethod(ClassHelper.java:138)
at org.jboss.ejb3.interceptors.lang.ClassHelper.isOverridden(ClassHelper.java:229)
at org.jboss.ejb3.interceptors.aop.LifecycleCallbacks.createLifecycleCallbackInterceptors(LifecycleCallbacks.java:99)
at org.jboss.ejb3.EJBContainer.invokeCallback(EJBContainer.java:1112)
at org.jboss.ejb3.EJBContainer.invokePreDestroy(EJBContainer.java:1149)
at org.jboss.ejb3.pool.AbstractPool.remove(AbstractPool.java:112)
at org.jboss.ejb3.InfinitePool.destroy(InfinitePool.java:44)
at org.jboss.ejb3.pool.ThreadlocalPool.destroy(ThreadlocalPool.java:71)
at org.jboss.ejb3.EJBContainer.lockedStop(EJBContainer.java:934)
at org.jboss.ejb3.session.SessionContainer.lockedStop(SessionContainer.java:276)
at org.jboss.ejb3.session.SessionSpecContainer.lockedStop(SessionSpecContainer.java:588)
at org.jboss.ejb3.stateless.StatelessContainer.lockedStop(StatelessContainer.java:221)
at org.jboss.ejb3.EJBContainer.stop(EJBContainer.java:923)
at sun.reflect.GeneratedMethodAccessor5513.invoke(Unknown Source)

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. ;)