In certain cases Hibernate won't find JPA entities and simply will fail with java.lang.IllegalArgumentException: Not an entity: class com.github.vok.example.crud.personeditor.Person. Even though it *is* a correctly annotated JPA entity and works properly when referenced via the class element. I tried to employ
<property name="hibernate.archive.autodetection" value="class, hbm"/>
with no success. I think that Hibernate only scans jar files on classpath and ignores folders with classes. This is especially on development environments where Jetty is launched using a simple main class.
If this is the case, can I somehow force Hibernate to also scan classpath directories for annotated classes?
My project is located in https://github.com/mvysny/vaadin-on-kotlin
- just open it in your IDE and then launch the Server class (located in vok-example-crud/src/test/java/com/github/vok/example/crud/Server.kt). You'll need the Kotlin plugin installed. If you are interested, I can prepare a very simple Maven project which also demonstrates the issue.
Thank you very much for any pointer in this regard.