0 Replies Latest reply on Aug 27, 2008 11:37 PM by happybolin1030

    use seam when i call my page happen "Could not open JPA Enti

    happybolin1030

      i use seam ,richfaces with spring integration,the components.xml is that:
      <?xml version="1.0" encoding="UTF-8"?>
      <components xmlns="http://jboss.com/products/seam/components"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
      xmlns:spring="http://jboss.com/products/seam/spring"
      xmlns:persistence="http://jboss.com/products/seam/persistence"
      xmlns:core="http://jboss.com/products/seam/core"
      xmlns:drools="http://jboss.com/products/seam/drools"
      xmlns:bpm="http://jboss.com/products/seam/bpm"
      xmlns:security="http://jboss.com/products/seam/security"
      xmlns:mail="http://jboss.com/products/seam/mail"
      xsi:schemaLocation="
      http://jboss.com/products/seam/bpm
      http://jboss.com/products/seam/bpm-2.0.xsd
      http://jboss.com/products/seam/security
      http://jboss.com/products/seam/security-2.0.xsd
      http://jboss.com/products/seam/mail
      http://jboss.com/products/seam/mail-2.0.xsd
      http://jboss.com/products/seam/components
      http://jboss.com/products/seam/persistence
      http://jboss.com/products/seam/persistence-2.0.xsd
      http://jboss.com/products/seam/components-2.0.xsd
      http://jboss.com/products/seam/core
      http://jboss.com/products/seam/core-2.0.xsd
      http://jboss.com/products/seam/spring
      http://jboss.com/products/seam/spring-2.0.xsd">

      <core:init debug="true" jndi-pattern="@jndiPattern@"/>

      <component scope="APPLICATION" auto-create="true" name="renderManager" class="com.icesoft.faces.async.render.RenderManager" />

      <core:manager concurrent-request-timeout="500"
      conversation-timeout="120000"
      conversation-id-parameter="cid"
      parent-conversation-id-parameter="pid"/>

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

      <persistence:entity-manager-factory name="seamEntityManagerFactory"
      persistence-unit-name="Seamspring"/>

      <drools:rule-base name="securityRules">
      <drools:rule-files>/security.drl</drools:rule-files>
      </drools:rule-base>

      <security:identity authenticate-method="#{authenticator.authenticate}"
      security-rules="#{securityRules}"
      remember-me="true"/>








      <spring:context-loader/>

      <persistence:managed-hibernate-session name="hibernateSession" auto-create="true" session-factory="#{sessionFactory}"/>

      <core:thread-pool-dispatcher name="threadPoolDispatcher"/>

      <spring:task-executor-dispatcher schedule-dispatcher="#{threadPoolDispatcher}" task-executor="#{springThreadPoolTaskExecutor}"/>

      <spring:spring-transaction platform-transaction-manager="#{transactionManager}"/>
      <!-- For use with jBPM pageflow or process management -->
      <!--
      <bpm:jbpm>
      <bpm:process-definitions></bpm:process-definitions>
      <bpm:pageflow-definitions></bpm:pageflow-definitions>
      </bpm:jbpm>
      -->



      and my spring config file is:
      <?xml version="1.0" encoding="UTF-8"?>
      <beans xmlns="http://www.springframework.org/schema/beans" xmlns:aop="http://www.springframework.org/schema/aop"
      xmlns:util="http://www.springframework.org/schema/util" xmlns:seam="http://jboss.com/products/seam/spring-seam"
      xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http://www.springframework.org/schema/tx"
      xmlns:jee="http://www.springframework.org/schema/jee"
      xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
      http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd
      http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-2.0.xsd
      http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.0.xsd
      http://jboss.com/products/seam/spring-seam http://jboss.com/products/seam/spring-seam-2.0.xsd
      http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd"
      default-lazy-init="true">





















      <tx:annotation-driven proxy-target-class="true" />
      <seam:configure-scopes default-auto-create="true" />
















      com.happybolin.seam.domain.model.Account
      com.happybolin.seam.domain.model.Cmsuser
      <!--
      com.happybolin.seam.domain.model.Department
      com.happybolin.seam.domain.model.Fucdefine
      com.happybolin.seam.domain.model.Role
      com.happybolin.seam.domain.model.Rolefucperm
      com.happybolin.seam.domain.model.Userrole
      -->
















      <!--

      <seam:component class="com.happybolin.seam.domain.beanImpl.AccountBeanImpl"/>



      PROPAGATION_REQUIRED







      -->

      and i pack the ear deploy into jboss server,jboss is worked well.so i think spring container and seam container work well.but when i call my application http://localhost:8080/Seamspring/index.html
      jboss server render:
      Caused by: java.lang.IllegalStateException: JTA EntityManager cannot access a tr
      ansactions
      at org.hibernate.ejb.AbstractEntityManagerImpl.getTransaction(AbstractEn
      tityManagerImpl.java:316)
      at org.jboss.seam.persistence.EntityManagerProxy.getTransaction(EntityMa
      nagerProxy.java:110)
      at sun.reflect.GeneratedMethodAccessor121.invoke(Unknown Source)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
      sorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:597)
      at org.jboss.seam.ioc.spring.SeamManagedEntityManagerFactory$SeamManaged
      PersistenceContextHandler.invoke(SeamManagedEntityManagerFactory.java:142)
      at $Proxy211.getTransaction(Unknown Source)
      at org.springframework.orm.jpa.DefaultJpaDialect.beginTransaction(Defaul
      tJpaDialect.java:69)
      at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransact
      ionManager.java:326)
      ... 57 more
      11:36:38,093 ERROR [SeamPhaseListener] uncaught exception
      java.lang.IllegalStateException: Could not start transaction
      please help me!!!