On Thu, Feb 16, 2012 at 11:15 AM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Gregory,
>
> On 2/16/12 10:55 AM, Gregory Werner wrote:
> > In this case it is a test environment.  We are trying to emulate
> > two distinct physical servers/load-balancing (which is the real
> > case) on a single physical machine with one Tomcat instance.
> > Looking at the logs we can see some requests going to A and some
> > going to B so it is load balancing, but in the end I am only
> > placing a single war file and starting a single tomcat instance.
>
> So, you have a single Tomcat instance with a single webapp deployed,
> but your load balancer has two separate connections to the single
> instance? What are you using for your load-balancer (it doesn't
> matter, I'm just curious).
>
> >> Remember that it's not magic replication: Tomcat doesn't know
> >> when you modify the object itself. I suspect that if you modify
> >> the object itself (say, by adding elements to the cache) you'll
> >> have to do this:
> >>
> >> context.setAttribute("userCache", userCache);
> >
> > I do, that would be my next line.  I just stopped there because
> > the userCache I retrieve from the context is null so I get a
> > NullPointerException crashing things before I get an opportunity to
> > put it back in the cache.
>
> Gotcha.
>
> So, when are you actually putting a UserCache *into* the servlet
> context? I'm wondering if you can't find anything in the servlet
> context because you've never put anything there :)
>
>
Yeah, ok, I think we can end this thread now.  A particular problem that
does not occur in my dev where context works great, but does occur in my
test.  It is difficult to describe, but basically because of an access
control list error in the test setup, it never does make it to that
particular item, so I can see it is likely not entered into the context.

-Greg

Reply via email to