Abstract DAO pattern and Spring's “Proxy cannot be cast to …” problem!
I know this is very often asked , but I cannot find a working solution : This is my AbstractDAO : public interface AbstractDao<T> { public T get(Serializable id); //other CRUD operations } And this is my JPA's implementation: public abstract class AbstractDaoJpaImpl<T> implements AbstractDao<T> , Serializable { protected EntityManager em; protected Class<T> clazz; @SuppressWarnings("unchecked") public AbstractDaoJpaImpl() { ParameterizedType genericSuperclass = (ParameterizedType) getClass().getGenericSuperclass(); this.clazz = (Class<T>) genericSuperclass.getActualTypeArguments()[0]; } public