Code example for CacheException

0
          ctx = new InitialContext(jndiProperties);
          return (EmbeddedCacheManager) ctx.lookup(jndiNamespace);
      } catch (NamingException ne) {
          String msg = "Unable to retrieve CacheManager from JNDI [" + jndiNamespace + "]";
          log.info(msg, ne);
          throw new CacheException( msg );
      } finally { 
          if (ctx != null) {
              try { 
                  ctx.close();
              } catch( NamingException ne ) {
                  log.info("Unable to release initial context", ne);
              } 
          } 
      } 
   } 
 
   @Override 
   public void stop() { 
      // Do not attempt to stop a cache manager because it wasn't created by this region factory.