Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-2983

Unknown Entity when persisting seam managed JPA entity

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 2.0.1.GA
    • Fix Version/s: The future
    • Component/s: None
    • Labels:
      None
    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      If you need to create JPA entities when referring them in facelets, use the @Factory pattern to instantiate it instead of making the JPA entity seam managed.

      Show
      If you need to create JPA entities when referring them in facelets, use the @Factory pattern to instantiate it instead of making the JPA entity seam managed.

      Description

      Caused by: java.lang.IllegalArgumentException: Unknown entity: com.archinsurance.rdm.entity.packages.impl.RefReleasePackageImpl_$$_javassist_4
      at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:215)

      when attempting to persist a seam managed JPA entity. Seam instantiates a javassist proxy and this is what the user app is trying to persist.

      The exception is not thrown when the entity is marked with @Entity annotation, if it is mapped with XML hibernate mapping definition it will fail with the above exception.

      Implement a consistent behavior to handle the seam managed JPA entity usecase regardless of the mapping technique being used. As recommended by Pete Muir this use case should not be utilized.

      Suggested behavior should be to throw a more explicit exception on startup whenever this invalid usecase is detected.

      More details in the below forum thread:
      http://seamframework.org/Community/UnknownEntityWhenPersistingSeamManagedJPAEntity

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                gjeudy Guillaume Jeudy
              • Votes:
                2 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated: