3 Replies Latest reply on Jul 3, 2007 9:14 AM by Pete Muir

    convertEntity with GF+Toplink

    asaf sh Expert

      Hey,

      I'm trying to use <s:convertEntity/> Seam's tag under GF+Toplink but I get the following exception:

      java.lang.ClassCastException: oracle.toplink.essentials.internal.ejb.cmp3.EntityManagerImpl cannot be cast to org.hibernate.Session
      


      Shouldn't it support Toplink's entityManager as well?



      In persistence.xml I declare a PU as:
      <persistence-unit name="pu1" transaction-type="JTA">
      ...data source... etc etc...
      


      In web.xml I have the PU resource reference as:
      <persistence-unit-ref>
       <persistence-unit-ref-name>edm_acc_em</persistence-unit-ref-name>
       <persistence-unit-name>pu1</persistence-unit-name>
       </persistence-unit-ref>
      


      In components.xml I declare the managed persistence conext as:
      <core:managed-persistence-context name="entityManager" auto-create="true" persistence-unit-jndi-name="java:comp/env/edm_acc_em"/>
      



      It kinda work well when I try to use s:selectItems with queries defined in 'framework:entity-query', but with the entityConverter it fails,



      As always,
      Many thanks,


      Asaf.