• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

ClassCastException com .ibm.ws.drs.DRSBuffWrapper?

 
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
My application throw this exception recently, and I have no idea why, and I never saw this Class before. It seems sometimes it will throw this exception when the program try to access session object, which I will also do a cast to my specify object.
I think the only change made recently is I enabled memory to memory session persistence for two nodes clustering (Websphere 5.0 in AIX).

java.lang.ClassCastException: com.ibm.ws.drs.DRSBuffWrapper
at xxx.xxx.xxx.SearchAction.execute(SearchAction.java(Compiled Code))
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java(Inlined Compiled Code))
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java(Compiled Code))
at org.apache.struts.action.ActionServlet.process(ActionServlet.java(Inlined Compiled Code))
at org.apache.struts.action.ActionServlet.doGet(ActionServlet.java(Compiled Code))
at javax.servlet.http.HttpServlet.service(HttpServlet.java(Compiled Code
))
at com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServlet.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecycleServlet.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidServletReferenceState.java(Compiled Code))
at com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletInstanceReference.java(Inlined Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDi
spatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequestDispatcher.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker.java(Compiled Code))
at com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(CachedInvocation.java(Compiled Code))
at com.ibm.ws.webcontainer.cache.invocation.CacheableInvocationContext.i
nvoke(CacheableInvocationContext.java(Compiled Code))
at com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletRequestProcessor.java(Compiled Code))
at com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListener.java(Compiled Code))
at com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java(Compiled Code))
at com.ibm.ws.http.HttpConnection.run(HttpConnection.java(Compiled Code))
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)
 
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Any chance you could show us the line of code where it breaks?
Kyle
 
david chan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
MyUser user = (MyUser)session.getAttribute("user");
I am not able to Cast the "user" object stored in session back to "MyUser" type, this only happens sometimes, not always.
In memory to memory session persistence config, it is config as to sync. all session values for every 10 seconds, and there are two nodes(servers) in the clustering.
Thanks.
David
 
Kyle Brown
author
Posts: 3892
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK, next we need to see the code for "MyUser".
Kyle
 
david chan
Ranch Hand
Posts: 46
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
import java.sql.Date;
import org.apache.log4j.Logger;
public class MyUser implements Serializable
{
private final static long TOTAL_TIMES = ((long)90) * 24 * 60 * 60 * 1000;
protected static Logger mylogger = Logger.getLogger(MyUser.class);
private int id;
private String username;
private String lastnm;
private String firstnm;
private String nameinit;
private byte[] hash;
private int type;
private boolean disable = false;
private Date updateDate;
//here are getter and setter methods for the attributes

//toString method
public String toString()
{
StringBuffer sb = new StringBuffer();
sb.append(getId());
sb.append(":");
sb.append(getUsername());
sb.append(":");
sb.append(getLastnm());
sb.append(":");
sb.append(getFirstnm());
sb.append(":");
sb.append(getType());
return sb.toString();
}
}
 
Ranch Hand
Posts: 227
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hmmmm - looks like this "com.ibm.ws.drs.DRSBuffWrapper" is a wrapper used in data replication services for Websphere. Since no information is out on the net for this problem, I'd start by decompiling the com.ibm.ws.drs.** package, and take a look at the internals. Maybe that'll give you a hint.
How do you have the DRS configured? Timing, type, etc...
Here's a link to some pretty good stuff (scroll down though, the top is basic...).
 
We can walk to school together. And we can both read this tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic