tags:

views:

118

answers:

1

I get a java.lang.IllegalArgumentException: Unknown entity: path.to.MyEntity. I have explicitly specified the provider in persistence.xml using:

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

and MyEntity is annotated appropriately. The hibernate portions of the exception trace: ...

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

... What could I be missing?

A: 

It was a classpath issue. I had to put META-INF folder (inside which persistence.xml was kept) in the root classpath.

Raghu