title: WebSphere 8 persistence.xml syntax error (expected root element)
body: <p>Installing my web application to WebSphere Application Server 8 fails due to a syntax error in my persistence.xml. According to my IDE, there is no error. What is the actual problem?</p>
  
  <p>persistence.xml:</p>
  
  <pre><code>  &lt;?xml version="1.0" encoding="UTF-8"?&gt;
    &lt;persistence xmlns="http://xmlns.jcp.org/xml/ns/persistence" version="2.1"
                 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
                                    http://java.sun.com/xml/ns/persistence/persistence_2_1.xsd"
    &gt;
        &lt;persistence-unit name="myapp"&gt;
            &lt;provider&gt;org.hibernate.jpa.HibernatePersistenceProvider&lt;/provider&gt;
        &lt;/persistence-unit&gt;
    &lt;/persistence&gt;
  </code></pre>
  
  <p>Excerpts from stack trace (SystemOut.log):</p>
  
  <p>1:</p>
  
  <pre><code>Caused by: com.ibm.ws.metadata.MetaDataException: CWWJP0040E: The persistence.xml in application PA_Appl, module Appl-0.1.war, has a syntax error at line number: 6, column number: 2.
  </code></pre>
  
  <p>2:</p>
  
  <pre><code>Caused by: org.xml.sax.SAXParseException: expected root element {http://java.sun.com/xml/ns/persistence}persistence
  </code></pre>
  
  <p>Please comment, if you need more information.</p>