Details
Description
How to reproduce:
Follow installation instructions of my tasklist-cdi tutorial
https://github.com/cschneider/Karaf-Tutorial/tree/master/tasklist-blueprint-cdi
- After installation the example works
- refresh net.lr.tasklist.cdi.tasklist-model
- When accessing http://localhost:8181/tasklist you get the exception below
- After a restart of karaf it works again
So the problem seems to be that with a refresh you get a new classloader for the model bundle but the persistence unit (EnityManagerFactory) is not renewed so it still uses the old classloader.
I am not yet sure if the problem is in jpa.container or jpa.container.context.
I will try to recreate this error in an itest for jpa so we can track it easily.
—
java.lang.IllegalArgumentException: Type specified for TypedQuery [net.lr.tasklist.model.Task] is incompatible with query return type [class net.lr.tasklist.model.Task]
at org.hibernate.ejb.AbstractEntityManagerImpl.resultClassChecking(AbstractEntityManagerImpl.java:702)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:303)
at