title: JSP XML Filewriter giving a NullpointerException
body: <p>The following code is giving me this error:</p>
  
  <blockquote>
    <p>java.lang.NullPointerException
      java.io.FileOutputStream.(Unknown Source)
      java.io.FileOutputStream.(Unknown Source)
      java.io.FileWriter.(Unknown Source)</p>
  </blockquote>
  
  <pre><code>SAXBuilder parser = new SAXBuilder();
  this.document = parser.build(path);
  
  //changes on the doc happening here
  
  FileWriter writer = new FileWriter(path);
  XMLOutputter out = new XMLOutputter();
  out.output(this.document, writer);
  writer.flush();
  writer.close();
  </code></pre>
  
  <p>How come? It the file locked or something?</p>
  
  <p>On a sidenote: What is the advantage of using BufferedOutputStream classes?</p>