useTicketCache normally used in the intiator side, and storeKey on the acceptor side. When both are set to true, and a valid TGT is found inside the cache, no password or keytab will be required, and therefore no key to store. This combination is useless and should have been set to illegal. However, some customers simply set a lot of arguments to true and this will actually work if password or key is used. We don't want to break their programs. For this case, when there is no key but storeKey is true, a proper LoginException should be thrown. This is also consistent with the JDK 6 behavior.