glassfish
  1. glassfish
  2. GLASSFISH-495

application fails to load with ValidationException when callbacks are defined in orm.xml

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 9.0pe
    • Fix Version/s: 9.0pe
    • Component/s: entity-persistence
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: Sun

    • Issuezilla Id:
      495

      Description

      Attempting to define callback methods in orm.xml results in the application
      failing to load with a ValidationException. The orm.xml contains three default
      listeners, with each entity defining callback methods. The callbacks methods on
      the entity class are not annotated instead defined in orm.xml. The validation
      exception states that the callback is invalid on the listener class, Product,
      where Product is an entity class.

      <persistence-unit-metadata>
      <persistence-unit-defaults>
      <entity-listeners>
      <entity-listener class="callback.common.ListenerA">
      </entity-listener>
      <entity-listener class="callback.common.ListenerB">
      </entity-listener>
      <entity-listener class="callback.common.ListenerC">
      </entity-listener>
      </entity-listeners>
      </persistence-unit-defaults>
      </persistence-unit-metadata>

      <package>callback.methodoverride</package>

      <entity name="Product" class="Product">
      <pre-persist method-name="prePersist"/>
      <post-persist method-name="postPersist"/>
      <pre-remove method-name="preRemove"/>
      <post-remove method-name="postRemove"/>
      <pre-update method-name="preUpdate"/>
      <post-update method-name="postUpdate"/>
      <post-load method-name="postLoad"/>
      </entity>

      Exception thrown:
      #|2006-03-28T14:54:49.459-0500|WARNING|sun-appserver-pe9.0|javax.enterprise.system.core.classloading|_ThreadI
      D=13;_ThreadName=httpWorkerThread-4848-1;_RequestID=ab26598e-65bd-4e27-9eb6-31cc36a43a48;|Exception
      [TOPLINK-7224] (Oracle TopLink Essentials - 2006.3 (Build 060324)):
      oracle.toplink.essentials.exceptions.ValidationException
      Exception Description: The method [preUpdate] on the listener class
      [class callback.methodoverride.Product] is an invalid callback method.
      javax.persistence.PersistenceException: Exception [TOPLINK-7224] (Oracle
      TopLink Essentials - 2006.3 (Build 06
      0324)): oracle.toplink.essentials.exceptions.ValidationException
      Exception Description: The method [preUpdate] on the listener class
      [class callback.methodoverride.Product] is an invalid callback method.
      at
      oracle.toplink.essentials.ejb.cmp3.EntityManagerFactoryProvider.createContainerEntityManagerFactory
      (EntityManagerFactoryProvider.java:173)

      The same error is reported using verifier.

        Activity

        Hide
        guypelletier added a comment -

        Starting ...

        Show
        guypelletier added a comment - Starting ...
        Hide
        marina vatkina added a comment -

        Reassigned

        Show
        marina vatkina added a comment - Reassigned
        Hide
        guypelletier added a comment -

        Re-assigning to myself ...

        Show
        guypelletier added a comment - Re-assigning to myself ...
        Hide
        guypelletier added a comment -

        Fix available in next persistence drop.

        Show
        guypelletier added a comment - Fix available in next persistence drop.
        Hide
        tware added a comment -

        Fix checked in

        Show
        tware added a comment - Fix checked in
        Hide
        tware added a comment -

        added build field

        Show
        tware added a comment - added build field

          People

          • Assignee:
            guypelletier
            Reporter:
            smcgowan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: