Unknown entity class error message even though the entity is marked with @Entity annotation

前端 未结 3 1113
不思量自难忘°
不思量自难忘° 2021-02-15 02:36

I am building REST web app using Netbean6.9.1 and JPA EclipseLink.

The issue I\'m facing is even though my entity class MasatoTable is marked with Entity annotation, I g

相关标签:
3条回答
  • 2021-02-15 03:07

    How are you creating your EntityManager/Factory, is it managed or non-managed?

    If it is not managed, then I believe that EclipseLink will not be notified in any way of a redeployment, so will still have the old EntityManagerFactory cached as it is never closed. Can you ensure that you close the EntityManagerFactory after the hot deploy?

    You can make the persistence unit a managed persistence unit, that may resolve the issue.

    Either way, please log a bug for this with details in EclipseLink and Glassfish, as this issue should be tracked.

    I think this may be the bug, https://bugs.eclipse.org/bugs/show_bug.cgi?id=326552

    Please vote for this bug, and include your information in it.

    0 讨论(0)
  • 2021-02-15 03:07

    The solution here is to use JPA 1.0 if 2.0 is not required.

    0 讨论(0)
  • 2021-02-15 03:19

    Today i faced the same proble, but i corrected in persistence.xml

    1. Please check with entity class name and package are correctly defined in persistence.xml.
    0 讨论(0)
提交回复
热议问题