Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!

Manohar Parelly

Greenhorn
+ Follow
since Mar 31, 2010
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
1
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Manohar Parelly

Hi,

We have 4 jboss nodes in our producton environment. node1 & node2 are in one server and node3 & node4 jboss instances are in another server. Last week all of a sudden node4 jboss instance stopped responding to requests and thrown below error in server.log file.
I am not able to understand the root cause of this error. We have restarted node4 jboss instance to make it work.
Please help me in identifying the root cause of this error and what preventing actions can be taken to avoid this kind of errors in future.

Please find attached thread dump.

+++++++++++++++++++++++++++++++++++++++
2010-09-17 20:50:37,821 ERROR [org.apache.catalina.connector.CoyoteAdapter] An exception or error occurred in the container during the request processing
java.lang.RuntimeException: JBossCacheService: exception occurred in cache get after retry ...
at org.jboss.web.tomcat.service.session.JBossCacheWrapper.get(JBossCacheWrapper.java:94)
at org.jboss.web.tomcat.service.session.JBossCacheWrapper.get(JBossCacheWrapper.java:59)
at org.jboss.web.tomcat.service.session.JBossCacheService.getAttribute(JBossCacheService.java:380)
at org.jboss.web.tomcat.service.session.JBossCacheService.getAttributes(JBossCacheService.java:468)
at org.jboss.web.tomcat.service.session.AttributeBasedClusteredSession.populateAttributes(AttributeBasedClusteredSession.java:190)
at org.jboss.web.tomcat.service.session.JBossCacheClusteredSession.initAfterLoad(JBossCacheClusteredSession.java:66)
at org.jboss.web.tomcat.service.session.JBossCacheManager.loadSession(JBossCacheManager.java:1046)
at org.jboss.web.tomcat.service.session.JBossCacheManager.findSession(JBossCacheManager.java:796)
at org.apache.catalina.connector.Request.doGetSession(Request.java:2283)
at org.apache.catalina.connector.Request.getSession(Request.java:2075)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:99)
at org.jboss.web.tomcat.service.session.ClusteredSessionValve.invoke(ClusteredSessionValve.java:87)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:84)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:157)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:262)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:583)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:446)
at java.lang.Thread.run(Thread.java:595)
Caused by: org.jboss.cache.lock.TimeoutException: failure acquiring lock: fqn=/JSESSION/localhost/atheebweb/AHzI9NDUPWkS-o0FGOSoCQ**, caller=Thread[http-0.0.0.0-8180-31,5,jboss], lock=write owner=Thread[IncomingMessageHandler (channel=Tomcat-AtheebWeb),5,JGroups threads] (activeReaders=0, activeWriter=Thread[IncomingMessageHandler (channel=Tomcat-AtheebWeb),5,JGroups threads], waitingReaders=3, waitingWriters=0, waitingUpgrader=0)
at org.jboss.cache.Node.acquire(Node.java:500)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.acquireNodeLock(PessimisticLockInterceptor.java:381)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.lock(PessimisticLockInterceptor.java:309)
at org.jboss.cache.interceptors.PessimisticLockInterceptor.invoke(PessimisticLockInterceptor.java:183)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.UnlockInterceptor.invoke(UnlockInterceptor.java:32)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.ReplicationInterceptor.invoke(ReplicationInterceptor.java:39)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.TxInterceptor.handleNonTxMethod(TxInterceptor.java:365)
at org.jboss.cache.interceptors.TxInterceptor.invoke(TxInterceptor.java:160)
at org.jboss.cache.interceptors.Interceptor.invoke(Interceptor.java:68)
at org.jboss.cache.interceptors.CacheMgmtInterceptor.invoke(CacheMgmtInterceptor.java:138)
at org.jboss.cache.TreeCache.invokeMethod(TreeCache.java:5877)
at org.jboss.cache.TreeCache.get(TreeCache.java:3641)
at org.jboss.cache.TreeCache.get(TreeCache.java:3622)
at sun.reflect.GeneratedMethodAccessor129.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:585)
at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
at $Proxy443.get(Unknown Source)
at org.jboss.web.tomcat.service.session.JBossCacheWrapper.get(JBossCacheWrapper.java:80)
... 21 more
Caused by: org.jboss.cache.lock.TimeoutException: read lock for /JSESSION/localhost/atheebweb/AHzI9NDUPWkS-o0FGOSoCQ** could not be acquired by Thread[http-0.0.0.0-8180-31,5,jboss] after 15000 ms. Locks: Read lock owners: []
Write lock owner: Thread[IncomingMessageHandler (channel=Tomcat-AtheebWeb),5,JGroups threads]
, lock info: write owner=Thread[IncomingMessageHandler (channel=Tomcat-AtheebWeb),5,JGroups threads] (activeReaders=0, activeWriter=Thread[IncomingMessageHandler (channel=Tomcat-AtheebWeb),5,JGroups threads], waitingReaders=3, waitingWriters=0, waitingUpgrader=0)
at org.jboss.cache.lock.IdentityLock.acquireReadLock(IdentityLock.java:262)
at org.jboss.cache.Node.acquireReadLock(Node.java:512)
at org.jboss.cache.Node.acquire(Node.java:474)
... 47 more

Regards,
Manohar P
11 years ago
Hi,

Using window.name javascript property we can track tabs/windows in the same session. I successfully used window.name in my application to track & do necessary action when application is accessed from multiple tabs.
Implementation details to restrict multi tabs access:
On Login page submit, set the window.name property to some value. Pass the same value as a hidden variable to Login action.
With this we can always ensure that proper login attempt window will have a name associated with it.
You have to put a check in Login action. If the value is not there in the session, it means 1st time you are trying to login in the session. Put the value in the session. If value already exist in the session, it means you are trying to login from another tab in the same session.
if(sessionmap.get("WINDOW_NAME") == null){
sessionmap.put("WINDOW_NAME", windowName);
}else{
return "InvalidBrowserWindowError";
}

Assume user is already logged in from 1st tab. In my application, if I open another tab in IE (even another window in forefox) and copy & paste the URL from 1st tab... it automatically takes the user to same page as in 1st page. To restrict this access, I identified all entry points to different modules in my application, and put below logic in some required jsp files to throw error page.

<form name="invalidwindow" id="invalidwindow" action="<<some action>>" method="post">
</form>

<script language="JavaScript" type="text/javascript">
if(window.name == '' || window.name != <<some value>>'){
invokeInvalidBrowserWindow();
}
function invokeInvalidBrowserWindow(){
document.invalidwindow.submit();
}
</script>

Above logic is to restrict web application access from multiple tabs.

If you want to support multiple logins from same machine you can do like below:
IE --> login from one IE tab. Open a new IE window (File --> New Window). and login from new window.
Mozilla --> Install CookiePie add-on in your mizilla browser window. Enable CookiePie for each tab. CookiePie will ensure that a new session will be created for each tab.

Regards,
Manohar Parelly
12 years ago
Dear Maddy,

Would like to know if you have got the solution for this multi tab session issue?
We are facing major issue with this problem in our application and have to resolve ASAP.
Appreciate your immediate response on this.

Regards,
Manohar P
12 years ago