wicket-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brown, Berlin [GCG-PFS]" <Berlin.Br...@Primerica.com>
Subject Why would this cause an error, session sharing and session classcast issues
Date Fri, 04 Nov 2011 01:15:00 GMT
Using wicket 1.4.13 (yea, I know I need to upgrade)
 
I am getting a classcastexception error on wicket session classes with
session sharing between webapps.  This feature is supported by our web
application server, IBM WebSphere
 
Most of the time this works fine but for some reason, we get the error.
 
Here is the setup.
 
WebApp1:
 
web.xml:
 
   <servlet-mapping>
   <servlet-name>WebApp1</servlet-name>
   <url-pattern>/WebApp1/*</url-pattern>
   </servlet-mapping>
 
WebApp2:
 
web.xml:
 
   <servlet-mapping>
   <servlet-name>WebApp2</servlet-name>
   <url-pattern>/WebApp2/*</url-pattern>
   </servlet-mapping>
 
 <servlet>
  <servlet-name>WebApp2</servlet-name>
 
<servlet-class>org.apache.wicket.protocol.http.WicketServlet</servlet-cl
ass>
 </servlet>
...
 
When I look at the session attributes, I get a list like this:  There
are distinct instances of wicket sessions for the two applications.
 
wicket:WebApp1:session com.WebApp1Session@760e760e
<mailto:com.WebApp1Session@760e760e> 
wicket:WebApp2:session com.WebApp2Session@560e760e
<mailto:com.WebApp2Session@560e760e> 
 
But for some reason, if a user visits WebApp1 and then WebApp2,  a call
to:
 
Java code from WebApp1
 
(WebApp2Session) Session.get():
 
That code above will generate a classcastexception.
 
What do you think could be going on?  Why would it work most of the time
but why would I get the error some of the time.  How does Session.get()
work?
 
My only theory is that there is some kind of static class variable
within wicket that is shared between the two web apps that is the
causing some kind of issue.






Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message