aspose file tools*
The moose likes Websphere and the fly likes ClassCastException com .ibm.ws.drs.DRSBuffWrapper? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Websphere
Bookmark "ClassCastException com .ibm.ws.drs.DRSBuffWrapper?" Watch "ClassCastException com .ibm.ws.drs.DRSBuffWrapper?" New topic
Author

ClassCastException com .ibm.ws.drs.DRSBuffWrapper?

david chan
Ranch Hand

Joined: Jun 10, 2002
Posts: 46
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)
Kyle Brown
author
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
Any chance you could show us the line of code where it breaks?
Kyle


Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at http://www.kyle-brown.com/ for other WebSphere information.
david chan
Ranch Hand

Joined: Jun 10, 2002
Posts: 46
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
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
    
    5
OK, next we need to see the code for "MyUser".
Kyle
david chan
Ranch Hand

Joined: Jun 10, 2002
Posts: 46
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();
}
}
Dana Hanna
Ranch Hand

Joined: Feb 28, 2003
Posts: 227
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...).
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: ClassCastException com .ibm.ws.drs.DRSBuffWrapper?