java.lang.ClassCastException: com.ibm.ws.persistence.EntityManagerImpl incompatible with org.hibernate.impl.SessionImpl

openxava | paulalvarez | 7 years ago
  1. 0

    OX WebSphere Portal problema de despliegue

    openxava | 7 years ago | paulalvarez
    java.lang.ClassCastException: com.ibm.ws.persistence.EntityManagerImpl incompatible with org.hibernate.impl.SessionImpl
  2. 0

    Liferay + Glassfish

    openxava | 8 years ago | achurilov
    java.lang.ClassCastException: oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl cannot be cast to org.hibernate.impl.SessionImpl
  3. 0

    This issue is also documented in the following thread, but no-one has replied to the original author. http://forum.hibernate.org/viewtopic.php?t=968907&highlight=fulltextsessionimpl The following class cast exception occurs inside org.hibernate.search.impl.FullTextSessionImpl. java.lang.ClassCastException: org.jboss.ejb3.entity.TransactionScopedHibernateSession incompatible with org.hibernate.impl.SessionImpl at org.hibernate.search.impl.FullTextSessionImpl.<init>(FullTextSessionImpl.java:54) at org.hibernate.search.Search.createFullTextSession(Search.java:17) This happens because FullTextSessionImpl's constructor is casting the org.hibernate.Session interface passed as an argument to the constructor to org.hibernate.impl.SessionImpl. Of course the jboss class TransactionScopedHibernateSession is not an instance of SessionImpl. public class FullTextSessionImpl implements FullTextSession { private final SessionImpl session; private PostTransactionWorkQueueSynchronization postTransactionWorkQueueSynch; public FullTextSessionImpl(Session session) { this.session = (SessionImpl) session; } ... Also, the method createFullTextQuery constructs an instance of FullTextQueryImpl with the session that the FullTextSessionImpl was instantiated with. The FullTextQueryImpl constructor expects to receive an instance of org.hibernate.engine.SessionImplementor. TransactionScopedHibernateSession and the interface org.hibernate.Session do not implement this interface. The following link is an issue in jira for JBoss EJB 3 about the fact it doesn't support SessionImplementor. Though I don't know if JBoss should implement this interface or not - it may well be bad design for JBoss to implement this just to get it working and perhaps some hibernate refactoring is needed to sort these issues out instead. http://jira.jboss.com/jira/browse/EJBTHREE-714 FYI the class definition of TransactionScopedHibernateSession is as follows... public class TransactionScopedHibernateSession implements Session, Externalizable { ... } This is critical since the search functionality in 3.2.1GA of annotations cannot be used in JBoss as the Session is proxied by TransactionScopedHibernateSession.

    Hibernate JIRA | 10 years ago | Adrian Pillinger
    java.lang.ClassCastException: org.jboss.ejb3.entity.TransactionScopedHibernateSession incompatible with org.hibernate.impl.SessionImpl
  4. Speed up your debug routine!

    Automated exception search integrated into your IDE

  5. 0

    This issue is also documented in the following thread, but no-one has replied to the original author. http://forum.hibernate.org/viewtopic.php?t=968907&highlight=fulltextsessionimpl The following class cast exception occurs inside org.hibernate.search.impl.FullTextSessionImpl. java.lang.ClassCastException: org.jboss.ejb3.entity.TransactionScopedHibernateSession incompatible with org.hibernate.impl.SessionImpl at org.hibernate.search.impl.FullTextSessionImpl.<init>(FullTextSessionImpl.java:54) at org.hibernate.search.Search.createFullTextSession(Search.java:17) This happens because FullTextSessionImpl's constructor is casting the org.hibernate.Session interface passed as an argument to the constructor to org.hibernate.impl.SessionImpl. Of course the jboss class TransactionScopedHibernateSession is not an instance of SessionImpl. public class FullTextSessionImpl implements FullTextSession { private final SessionImpl session; private PostTransactionWorkQueueSynchronization postTransactionWorkQueueSynch; public FullTextSessionImpl(Session session) { this.session = (SessionImpl) session; } ... Also, the method createFullTextQuery constructs an instance of FullTextQueryImpl with the session that the FullTextSessionImpl was instantiated with. The FullTextQueryImpl constructor expects to receive an instance of org.hibernate.engine.SessionImplementor. TransactionScopedHibernateSession and the interface org.hibernate.Session do not implement this interface. The following link is an issue in jira for JBoss EJB 3 about the fact it doesn't support SessionImplementor. Though I don't know if JBoss should implement this interface or not - it may well be bad design for JBoss to implement this just to get it working and perhaps some hibernate refactoring is needed to sort these issues out instead. http://jira.jboss.com/jira/browse/EJBTHREE-714 FYI the class definition of TransactionScopedHibernateSession is as follows... public class TransactionScopedHibernateSession implements Session, Externalizable { ... } This is critical since the search functionality in 3.2.1GA of annotations cannot be used in JBoss as the Session is proxied by TransactionScopedHibernateSession.

    Hibernate JIRA | 10 years ago | Adrian Pillinger
    java.lang.ClassCastException: org.jboss.ejb3.entity.TransactionScopedHibernateSession incompatible with org.hibernate.impl.SessionImpl
  6. 0

    Application on websphere throws ClassCastException on application restart

    Stack Overflow | 4 years ago | Mukul Goel
    java.lang.ClassCastException: com.csc.fs.ra.SimpleConnectionSpecImpl incompatible with com.csc.fs.ra.SimpleConnectionSpecImpl

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. java.lang.ClassCastException

      com.ibm.ws.persistence.EntityManagerImpl incompatible with org.hibernate.impl.SessionImpl

      at org.openxava.annotations.parse.AnnotatedClassParser.obtainManagedClassNamesUsingHibernate()
    2. org.openxava.annotations
      AnnotatedClassParser.parse
      1. org.openxava.annotations.parse.AnnotatedClassParser.obtainManagedClassNamesUsingHibernate(AnnotatedClassParser.java:2247)
      2. org.openxava.annotations.parse.AnnotatedClassParser.getManagedClassNames(AnnotatedClassParser.java:2162)
      3. org.openxava.annotations.parse.AnnotatedClassParser.getClassNameFor(AnnotatedClassParser.java:2124)
      4. org.openxava.annotations.parse.AnnotatedClassParser.parse(AnnotatedClassParser.java:56)
      4 frames
    3. org.openxava.component
      MetaComponent.get
      1. org.openxava.component.ComponentParser.parseAnnotatedClass(ComponentParser.java:46)
      2. org.openxava.component.ComponentParser.parse(ComponentParser.java:35)
      3. org.openxava.component.MetaComponent.get(MetaComponent.java:60)
      3 frames
    4. org.openxava.tab
      Tab.setModelName
      1. org.openxava.tab.Tab.getMetaTab(Tab.java:203)
      2. org.openxava.tab.Tab.getPreferences(Tab.java:843)
      3. org.openxava.tab.Tab.loadUserPreferences(Tab.java:1047)
      4. org.openxava.tab.Tab.setModelName(Tab.java:776)
      4 frames