Hibernate IllegalArgumentException

I am getting java.lang.IllegalArgumentException: Unknown object: path.to.MyEntity. I have explicitly specified the provider in the persistence.xml file using:

<persistence-unit ...>
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
</persistence-unit>

      

and MyEntity is annotated accordingly. Sleeping parts of the exception trace: ...

at org.hibernate.ejb.AbstractEntityManagerImpl.find(AbstractEntityManagerImpl.java:186)

      

... What can I lose?

0


a source to share


1 answer


It was a classpath issue. I had to set the META-INF folder (inside which persistence.xml was stored) in the root path of the path.



0


a source







All Articles