title: java.lang.NullPointerException Sun PetStore CatalogFacade
body: <p>in the Sun Java PetStore demo index.jsp file, I'm getting a Null Pointer Exception on <code>cf</code></p>
  
  <pre><code>CatalogFacade cf = (CatalogFacade)getServletContext().getAttribute("CatalogFacade");
  List&lt;Tag&gt; tags=cf.getTagsInChunk(0, 12);  &lt;--- cf is Null
  </code></pre>
  
  <p>I'm using Eclipse and I don't know why CatalogFacade is null or how to debug this.<br>
  Any clue greatly appreciated.</p>
  
  <p>Edit:
  In the <code>CatalogFacade</code> Class which <code>implements ServletContextListener</code>   </p>
  
  <pre><code>public void contextInitialized(ServletContextEvent sce) {
      ServletContext context = sce.getServletContext();
      context.setAttribute("CatalogFacade", this);
  }
  </code></pre>