Hi Everything looks ok. I can imagine the exception is caused because you are switching from client side to server side state saving in one view.
Server side state saving uses a String as token, but client side uses an object array. In 2.1.9 some improvements were done in state saving algorithm: https://issues.apache.org/jira/browse/MYFACES-3563 I suppose the problem is not in myfaces code, because many tests were done in that part before commit the code. Check your code, maybe on the first requests, some code is executed to calculate which strategy to use and when the switch happen, other thread choose the opposite or the existing thread used the other one. Really I don't know the details behind it, so all I'm saying is pure speculation until you confirm it. regards, Leonardo Uribe 2012/10/5 Thomas Andraschko <[email protected]>: > Hi, > > sometimes under high load i get 2 ClassCastExceptions on #restoreView with > MyFaces 2.1.9: > > java.lang.ClassCastException: [Ljava.lang.Object; cannot be cast to > java.lang.String > at > org.apache.myfaces.renderkit.ServerSideStateCacheImpl$CounterKeyFactory.decode(ServerSideStateCacheImpl.java:1137) > at > org.apache.myfaces.renderkit.ServerSideStateCacheImpl.getServerStateId(ServerSideStateCacheImpl.java:281) > at > org.apache.myfaces.renderkit.ServerSideStateCacheImpl.restoreSerializedView(ServerSideStateCacheImpl.java:1054) > at > org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getState(HtmlResponseStateManager.java:208) > at > org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreView(DefaultFaceletsStateManagementStrategy.java:207) > at > org.apache.myfaces.application.StateManagerImpl.restoreView(StateManagerImpl.java:130) > at > javax.faces.application.StateManagerWrapper.restoreView(StateManagerWrapper.java:86) > ... > > java.lang.ClassCastException: java.lang.String cannot be cast to > [Ljava.lang.Object; > at > org.apache.myfaces.renderkit.ClientSideStateCacheImpl.restoreSerializedView(ClientSideStateCacheImpl.java:63) > at > org.apache.myfaces.renderkit.html.HtmlResponseStateManager.getState(HtmlResponseStateManager.java:208) > at > org.apache.myfaces.view.facelets.DefaultFaceletsStateManagementStrategy.restoreView(DefaultFaceletsStateManagementStrategy.java:207) > at > org.apache.myfaces.application.StateManagerImpl.restoreView(StateManagerImpl.java:130) > ... > > This exceptions occured only 4 times for ~1500 requests under high load. > > Any idea? > > Best regards, > Thomas >
