0 Replies Latest reply on Jan 7, 2009 1:28 AM by Zarar Siddiqi

    convertEntity with Glassfish and Toplink gives: oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl cannot be cast to org.hibernate.Session

    Zarar Siddiqi Newbie
      Hi,

      I'm trying to get <s:convertEntity/> working in Glassfish using Toplink Essentials.

      The Facelet is easy enough:

      <h:selectOneMenu required="true" value="#{person.department}" label="Department">
         <s:selectItems value="#{departments}" var="v" label="#{v.name}"/>
         <s:convertEntity/>
      </h:selectOneMenu>

      The components.xml is where I'm having trouble, here's what I currently have:

      <persistence:entity-manager-factory name="dbFactory" persistence-unit-name="employeeDatabase"/>
      <persistence:managed-persistence-context name="entityManager"
                                                   auto-create="true"
                                                   entity-manager-factory="#{dbFactory}"/>

      <ui:jpa-entity-loader entity-manager="#{entityManager}"/>


      The error I get as soon as I view the Facelet is:

      oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl cannot be cast to org.hibernate.Session

      Why is it getting confused with Hibernate?  My persistence.xml mapping is straightforward:

      <persistence-unit name="employeeDatabase">
        ....
      </persistence-unit>

      Any help is appreciated. Thanks.