J2EE prepares use of the JNDI interface to access different resources like JMS, JDBC, EJB etc. The client finds up for these resources through the JNDI look-up. The JNDI look like is expensive because the client requires getting a network connection to the server first. So that look-up process is redundant and expensive.
To avoid this redundant and expensive process, service objects may be cached when a client process the JNDI look-up for the first time and redefine that service object from the cache for the subsequent look-ups. The service locator pattern imports this technique.