Hi, Once the http session is replicated this method should be executed on the node that did not process the request org.apache.wicket.page.PageStoreManager.SessionEntry#readObject(). Here Wicket will either store the page(s) on the disk or will schedule them for storing. There is no much usage of Loggers here so you will have to attach a debugger and see what happens.
Martin Grigorov Wicket Training and Consulting https://twitter.com/mtgrigorov On Thu, Mar 23, 2017 at 6:11 PM, Wayne W <[email protected]> wrote: > If I put the AbstractDefaultAjaxBehavior back in, it always fails. If I > remove the AbstractDefaultAjaxBehavior most of the time it works, but every > now and then it fails to replicate. Its really inconsistent. > > I have no idea how to get to the bottom of this. Any pointers or help is > much appreciated. > > On Thu, Mar 23, 2017 at 4:53 PM, Wayne W <[email protected]> > wrote: > > > So it seems the homepage is not the only page. However removing the > > AbstractDefaultAjaxBehavior makes no difference I still get the same > > issues. Just don;t know where to start with this one. Is there a way I > can > > turn on the logging around replication in wicket? > > > > On Thu, Mar 23, 2017 at 4:27 PM, Wayne W <[email protected]> > > wrote: > > > >> Hi Martin, > >> > >> no - I still get the ComponentNotFoundException in the new instance. :-/ > >> > >> On Thu, Mar 23, 2017 at 3:57 PM, Martin Grigorov <[email protected]> > >> wrote: > >> > >>> Hi, > >>> > >>> On Thu, Mar 23, 2017 at 4:20 PM, Wayne W <[email protected]> > >>> wrote: > >>> > >>> > Hi Martin, > >>> > > >>> > that was a typo on my part. I've been doing a lot more testing > before I > >>> > replied to make sure things are as I say. This is what I am > observing: > >>> > > >>> > > >>> > - I have a 2 node tomcat cluster setup with apache balancing > between > >>> > them locally on my machine. > >>> > - Testing with a very simple Wicket app I can see the replication > is > >>> > working fine when shutting down either instance. > >>> > - Testing with our very heavy weight wicket app it sometimes work > >>> and > >>> > sometimes does not. > >>> > > >>> > Now the last point above I have narrowed down to our homepage. If I > am > >>> not > >>> > on the homepage the replication seems to work ok. However if I am on > >>> the > >>> > homepage I always get a ComponentNotFoundException when failing over > >>> to the > >>> > other instance. > >>> > The homepage has an AbstractDefaultAjaxBehavior which is called once > >>> the > >>> > page is rendered, this in turn adds to the the page a DataView > >>> containing a > >>> > lot of content and links. The user needs to be logged in before they > >>> see > >>> > the homepage, so the session is already setup. > >>> > > >>> > I don't know what it is about this page that breaks the replication. > Is > >>> > there anything around the ajax part that could do this? Any pointers > >>> would > >>> > be most welcome as it will be a long long task to break that page > down > >>> and > >>> > do rounds and rounds of cluster testing > >>> > > >>> > >>> Let's try something! > >>> In you Ajax callback method do something like: > >>> getSession().setAttribute("someKey", UUID.randomUUID().toString()) > >>> Does this trigger replication ? > >>> > >>> > >>> > > >>> > many thanks > >>> > > >>> > > >>> > > >>> > > >>> > On Wed, Mar 22, 2017 at 12:34 PM, Martin Grigorov < > >>> [email protected]> > >>> > wrote: > >>> > > >>> > > Hi, > >>> > > > >>> > > "I can stop one of the instances and I'm not logged in" > >>> > > This statement says that you don't really have a properly > configured > >>> > > failover. > >>> > > If those two Tomcat instances are in a cluster then the http > sessions > >>> > > should be replicated and you should stay logged in no matter which > >>> one is > >>> > > serving the request. > >>> > > Wicket will store the used stateful page at the disks for all > >>> Tomcats in > >>> > > the cluster, if it the replication is actually working! > >>> > > > >>> > > > >>> > > On Wed, Mar 22, 2017 at 1:02 PM, Wayne W < > >>> [email protected]> > >>> > > wrote: > >>> > > > >>> > > > Hi, > >>> > > > > >>> > > > We have 2 instances of Tomcat running with Apache sitting in > front > >>> > > > balancing between the Tomcat instances. I have session > replication > >>> > setup > >>> > > > which seems to work for basic bookmarkable links on the pages. I > >>> can > >>> > stop > >>> > > > one of the instances and I'm not logged in as it failover to the > >>> other > >>> > > > instance. > >>> > > > > >>> > > > However for normal Link<?> and ajax links etc I get > >>> > > > ComponentNotFoundException thrown as the new instance cannot > find > >>> it > >>> > in > >>> > > > the session it seems. > >>> > > > > >>> > > > Clearly I'm not understanding how wicket manages the page state > or > >>> I've > >>> > > > configured something wrong. > >>> > > > > >>> > > > Does wicket support full session failover ? > >>> > > > > >>> > > > Many thanks > >>> > > > > >>> > > > >>> > > >>> > >> > >> > > >
