I would try having your ServiceLocator also implement javax.servlet.ServletContextListener and use its hook to clean up when the application is redeployed.
I'm assuming that contextDestroyed will be called in this scenario.
Thanks Steve. I'll give it a blast.
Actually I got it the wrong way around.
My service locator is in the war, and it's when I redeploy the EJB ear that all the cached RemoteHomes are invalidated.
So following your logic still though, is there some sort of ContextListener for the EJB ear?
The ear and the war are seperate.