java.lang.ClassCastException

org.hibernate.ejb.EntityManagerImpl cannot be cast to org.hibernate.Session >

Solutions on the web19029

  • via Oracle Community by ziphyre, 11 months ago
    org.hibernate.ejb.EntityManagerImpl cannot be cast to org.hibernate.Session >
  • org.hibernate.internal.SessionImpl cannot be cast to org.hibernate.ejb.EntityManagerImpl
  • org.hibernate.internal.StatelessSessionImpl cannot be cast to org.hibernate.Session
  • Stack trace

    • java.lang.ClassCastException: org.hibernate.ejb.EntityManagerImpl cannot be cast to org.hibernate.Session > at net.snodd.web.biz.CommentBean.getComments(CommentBean.java:29) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1011) at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:175) at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2920) at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:4011) at com.sun.ejb.containers.EJBObjectInvocationHandler.invoke(EJBObjectInvocationHandler.java:203)

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    You are the first who have seen this exception. Write a tip to help other users and build your expert profile.