Uploaded image for project: 'Seam 2'
  1. Seam 2
  2. JBSEAM-1946

seam 2.0's persistence:managed-persistence-context not support openjpa

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: 2.0.0.GA
    • Fix Version/s: 2.0.2.CR1
    • Component/s: Core
    • Labels:
      None
    • Environment:

      tomacat 6+ myfaces 1.2.0 + seam 2.0 ga+ spring 2.0.6 + openjpa 0.9.7

      Description

      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
      [code]
      <!-- 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>
      [/code]
      And Define managed-persistence-context in component.xml
      [code]
      <persistence:managed-persistence-context name="courseEntityManager"
      entity-manager-factory="#

      {entityManagerFactory}

      "
      auto-create="true" />
      [/code]
      The Web Project reports Error
      [code]
      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)
      [/code]

      I also test seam with toplink and hibernate,and find toplink fail,hibernate success
      It seems to me that seam's persistence:managed-persistence-context only supports hibernate as entity-manager-factory
      and not supports other jpa implementation.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  jbalunas Jay Balunas
                  Reporter:
                  davidclf clf clf
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  0 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: