title: Why, when working with Web Fragments to I get a "Premature End of File" error
body: <p>I created 2 maven projects, a <em>web application</em> <strong>fxserver2</strong> and a <em>web library</em> <strong>SleepyFox</strong>.</p>
  
  <p>I then created a <strong>src/main/resources/META-INF/<em>web-fragment.xml</em></strong> file in <strong><em>SleepyFox</em></strong> that I'd like to be automatically "included" into my <strong>fxserver web.xml</strong></p>
  
  <p>Unfortunately, I'm getting an error that looks like this:</p>
  
  <pre><code>24-Jan-2012 19:38:50 org.apache.catalina.startup.HostConfig deployDescriptor
  INFO: Deploying configuration descriptor fxserver2.xml from /Users/sparkyspider/Tomcat/apache-tomcat-7.0.12/conf/Catalina/localhost
  24-Jan-2012 19:38:50 org.apache.tomcat.util.digester.Digester fatalError
  SEVERE: Parse Fatal Error at line 1 column 1: Premature end of file.
  org.xml.sax.SAXParseException: Premature end of file.
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195)
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.fatalError(ErrorHandlerWrapper.java:174)
  </code></pre>
  
  <p>and then</p>
  
  <pre><code>24-Jan-2012 19:38:50 org.apache.catalina.startup.ContextConfig parseWebXml
  SEVERE: Parse error in application web.xml file at jndi:/localhost/fxserver2/WEB-INF/lib/SleepyFox-0.9.jar!/META-INF/web-fragment.xml
  org.xml.sax.SAXParseException: Premature end of file.
      at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:195) 
  </code></pre>
  
  <p>The second error seems to indicate that the correct file is indeed being read, but I have no idea why its giving me a premature end of file error.</p>
  
  <p>I included my <strong><em>fxserver2 web.xml</em></strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;web-app&gt;   
      &lt;session-config&gt;
          &lt;session-timeout&gt;
              30
          &lt;/session-timeout&gt;
      &lt;/session-config&gt;
  &lt;/web-app&gt;
  </code></pre>
  
  <p>And also my <strong><em>SleepyFox web-fragment.xml</em></strong></p>
  
  <pre><code>&lt;web-fragment&gt;
      &lt;listener&gt;
          &lt;listener-class&gt;com.foxbomb.fxserver2.ApplicationContext&lt;/listener-class&gt;
      &lt;/listener&gt;
  &lt;/web-fragment&gt;
  </code></pre>
  
  <p>Any advice greatly appreciated.</p>