title: EHCache returning null after getCache
body: <p>I'm saving some content from a xml file in a ArrayList, to show in a carousel, so everytime someone enter the website, the xml is downloaded and etc, i don't want that, so i'm saving it in cache using ehcache. But i'm having a problem, in the method to get the Array that is stored, the cache return null, there's nothing there. I'm kinda stuck in this part... maybe i'm getting the cache in a wrong way.</p>
  
  <pre><code>public class xmlCache  {
  
  //getting the xml file in a Document
  public static Document loadXMLDocument() throws Exception {
      DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
      factory.setNamespaceAware(true);
      return factory.newDocumentBuilder().parse(new URL("https://www.w3schools.com/xml/cd_catalog.xml").openStream());
  }
  
  //putting the xml content in a ArrayList
  public static ArrayList&lt;String&gt; listXML(){
  
      ArrayList&lt;String&gt; xmlList = new ArrayList&lt;String&gt;();
  
      try {
          Document  doc = xmlCache.loadXMLDocument();
          doc.getDocumentElement().normalize();
          NodeList nList = doc.getElementsByTagName("CD");
  
          for (int temp = 0; temp &lt; nList.getLength(); temp++) {
              Node nNode = nList.item(temp);
              if (nNode.getNodeType() == Node.ELEMENT_NODE) {
  
                 Element eElement = (Element) nNode;
  
                 xmlList.add(eElement.getElementsByTagName("TITLE").item(0).getTextContent() + "|" + 
                          eElement.getElementsByTagName("ARTIST").item(0).getTextContent() + "|" +
                          eElement.getElementsByTagName("COUNTRY").item(0).getTextContent() + "|" +
                          eElement.getElementsByTagName("COMPANY").item(0).getTextContent() + "|" +
                          eElement.getElementsByTagName("YEAR").item(0).getTextContent());
              }
          }
      } catch (Exception e) {
          e.printStackTrace();
          return null;
      }
  
      return xmlList;
  
  }
  
  //putting the ArrayList in cache
  public static void cachingXML () {
      ArrayList&lt;String&gt; xmlList = xmlCache.listXML();
  
      CacheManager cacheManager = newCacheManagerBuilder().withCache("basicCache", newCacheConfigurationBuilder(Long.class, ArrayList.class, heap(300).offheap(5, MB)))
          .build(true); 
  
          Cache&lt;Long, ArrayList&gt; basicCache = cacheManager.getCache("basicCache", Long.class, ArrayList.class);
  
          basicCache.put(1L, xmlList);
          ArrayList&lt;String&gt; teste = new ArrayList&lt;&gt;();
  
          // if i do that here, is ok, the return is ok
          teste = basicCache.get(1L);
          System.out.println(teste.size());
  
  
  }
  
  //accessing the ArrayList stored
  public static ArrayList&lt;String&gt; getTicker() {
      ArrayList&lt;String&gt; ticker = new ArrayList&lt;&gt;();
  
      try(CacheManager cacheManager = newCacheManagerBuilder().withCache("basicCache", newCacheConfigurationBuilder(Long.class, ArrayList.class, heap(500).offheap(3, MB)))
              .build(true)){ 
  
              Cache&lt;Long, ArrayList&gt; basicCache = cacheManager.getCache("basicCache", Long.class, ArrayList.class);
  
              //the return is false           
              System.out.println(basicCache.containsKey(1L));
      }catch (Throwable e) {
          e.printStackTrace();
      }
      return ticker;
  }
  
   public static void main(String[] args) throws MalformedURLException, SAXException, IOException, ParserConfigurationException {
  
          //this one is ok
          xmlCache.cachingXML();
  
          //this one is not
          xmlCache.getTicker();
  
  
  
    }
  </code></pre>
  
  <p>}</p>