خرید بک لینک

Vote count: 0

This is not a duplicate question.

I am getting the following error Document root element "persistence", must match DOCTYPE root "null" Below is the XML file causing it.

<?xml version="1.0" encoding="UTF-8" ?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
             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_1_0.xsd" version="1.0">

    <persistence-unit name="my-persistence">
        <description>Persistence Unit</description>
        <provider>org.hibeate.jpa.HibeatePersistenceProvider</provider>
        <mapping-file>WEB-INF/config/application-context.xml</mapping-file>
        <!--<jar-file>packedEntity.jar</jar-file>-->
        <class>domain.Applicant</class>
        <class>testScrEntry</class>
        <properties>
            <property name="javax.persistence.jdbc.url" value="oracle.jdbc.OracleDriver"/>
            <property name="javax.persistence.jdbc.user" value="user"/>
            <property name="javax.persistence.jdbc.password" value="password"/>
        </properties>
    </persistence-unit>

</persistence>

Stacktrace

`o.s.w.c.s.XmlWebApplicationContext WARN: Exception encountered during 
 context initialization - cancelling refresh attempt: 
 org.springframework.beans.factory.BeanDefinitionStoreException: Failed 
 to parse configuration class [configuration.JpaConfiguration]; nested 
 exception is java.util.InvalidPropertiesFormatException:  
 org.xml.sax.SAXParseException: Document root element "persistence", must     
 match DOCTYPE root "`null"

Naturally I googled the error and it tells me to add which I did and it looked like:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE persistence PUBLIC xmlns="http://java.sun.com/xml/ns/persistence"
             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_1_0.xsd" version="1.0">

    <persistence-unit name="my-pu">
        <description>Persistence Unit</description>
        <provider>org.hibeate.jpa.HibeatePersistenceProvider</provider>
        <!--<mapping-file>application-context.xml</mapping-file>-->
        <!--<jar-file>packedEntity.jar</jar-file>-->
        <class>domain.Applicant</class>
        <class>applicant.testScrEntry</class>
        <properties>
            <property name="javax.persistence.jdbc.url" value="oracle.jdbc.OracleDriver"/>
            <property name="javax.persistence.jdbc.user" value="user"/>
            <property name="javax.persistence.jdbc.password" value="password"/>
        </properties>
    </persistence-unit>

</persistence>

However the above also doesn't saying the file must be close by a >. It is referring to the red ~ line next to </persistence>.

asked 2 mins ago

برچسب: نویسنده: استخدام کار تاريخ: شنبه 15 خرداد 1395 ساعت: 1:55

صفحه بندی