it is the NamingServer stub that is cached, not the initial context. anyhow, I have the same problem:
when i perform some JNDI operations on an initial context/subcontext, close the initialcontext via close(), and create a new initial context with the same target server as before und make a lookup on it, I receive the same kind of exception as the Naming object is still cached in org.jnp.NamingContext. If I wait some minutes before trying to perform this lookup, everythings fine, as the cache seems to be cleared again.
As a bad solution I'm making a test lookup on the initial context a priori, which makes the NamingContext remove the invalid stub if an exception is thrown.
Does someone know when this cache is cleared and how I can control it?