Search code examples
jpajakarta-eejava-8glassfisheclipselink

2.2 versioned Orm.xml marshaling failed in Java EE 8/Glassfish v5/JPA 2.2(EclipseLink 2.7)


I am trying to add a orm.xml to register a EntityListener for all entities.

The following orm.xml will cause marshaling exception in console when deploy to Glassfish v5.

<?xml version="1.0" encoding="UTF-8"?>
<entity-mappings xmlns="http://xmlns.jcp.org/xml/ns/persistence/orm"
                   xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                   xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence/orm
          http://xmlns.jcp.org/xml/ns/persistence/orm_2_2.xsd"
                   version="2.2">
    <persistence-unit-metadata>
        <persistence-unit-defaults>
            <entity-listeners>
                <entity-listener class="com.github.hantsy.ee8sample.support.AuditEntityListener" />
            </entity-listeners>
        </persistence-unit-defaults>
    </persistence-unit-metadata>
</entity-mappings>

But if I change the version to 2.1, the exception will be disappeared.

Is this a EclipseLink specific bug?


Solution

  • Known issue in 2.7.0, see https://bugs.eclipse.org/bugs/show_bug.cgi?id=521954 for details

    btw: there is no difference between 2.1 and 2.2 version of the schema other than version number change