1 Reply Latest reply on Sep 20, 2007 10:25 PM by Gavin King

    Seam 2.0 NOT support OpenJPA?

    clf clf Newbie

      I try to test the Seam's compatibility with openjpa.
      The web project is tomacat + myfaces + seam + spring jpa + openjpa.
      I define entityManagerFactory in the application.xml

      <!-- JPA EntityManagerFactory -->
       <bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
       <property name="dataSource" ref="dataSource"/>
       <property name="loadTimeWeaver">
       <bean class="org.springframework.instrument.classloading.ReflectiveLoadTimeWeaver"/>
       </property>
       <property name="jpaVendorAdapter">
       <!--
       <bean class="org.springframework.orm.jpa.vendor.TopLinkJpaVendorAdapter">
       <property name="databasePlatform"
       value="org.springframework.samples.petclinic.toplink.EssentialsHSQLPlatformWithNativeSequence"/>
       <property name="showSql" value="true"/>
       </bean>
       -->
       <!--
       <bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter">
       <property name="database" value="HSQL"/>
       <property name="showSql" value="true"/>
       </bean>
       -->
       <bean id="jpaAdapter" class="org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter">
       <property name="database" value="HSQL"/>
       <property name="showSql" value="true"/>
       </bean>
       </property>
       </bean>
      

      And Define managed-persistence-context in component.xml
      <persistence:managed-persistence-context name="courseEntityManager"
       entity-manager-factory="#{entityManagerFactory}"
       auto-create="true" />
      

      The Web Project reports Error
      2007-09-21 09:21:09,981 ERROR [org.jboss.seam.jsf.SeamPhaseListener] - <uncaught exception>
      java.lang.RuntimeException: could not proxy delegate
       at org.jboss.seam.persistence.HibernatePersistenceProvider.proxyDelegate(HibernatePersistenceProvider.java:102)
      Caused by: java.lang.ClassCastException: org.apache.openjpa.persistence.EntityManagerImpl
       at org.jboss.seam.persistence.HibernatePersistenceProvider.proxyDelegate(HibernatePersistenceProvider.java:98)
      

      Is it Means that Seam 2.0 Not Support OpenJPA? or Am I Wrong?
      AnyOne Can Help? Thank in Advance!