2011-09-27 5 views
0

J'ai une erreur comme ce travail avec webflow 2.3.0.RELEASE et richfaces 4.0.0.Final dans jboss 7.0.1.FINAL:erreur exception imbriquée est org.springframework.beans.factory.NoSuchBeanDefinitionException WebFlow

12: 16: 46,989 INFO [stdout] (thread de service MSC 1-7) 2011-09-20 12: 16: 46,987 [thread de service MSC 1-7] ERROR (FrameworkServlet.java:314) � Initialisation de contexte Échec 12: 16: 46 989 INFO [stdout] (thread 1-7 du service MSC) org.springframework.beans.factory.BeanCreationException: Erreur lors de la création du bean avec le nom 'flowExecutor': Impossible de créer le bean interne '(bean interne)' du type [ org.springframework.webflow.config.FlowExecutionListenerLoaderFactoryBean] lors de la définition de la propriété bean 'flowExecutionListenerLoader'; l'exception imbriquée est org.springframework.beans.factory.BeanCreationException: Erreur lors de la création du bean avec le nom '(bean interne) # 1': Impossible de résoudre la référence au bean 'jpaFlowExecutionListener' lors de la définition de la propriété bean 'listeners'; l'exception imbriquée est org.springframework.beans.factory.BeanCreationException: Erreur lors de la création du bean avec le nom 'jpaFlowExecutionListener' défini dans la ressource ServletContext [/WEB-INF/spring/transportes-webflow.xml]: Impossible de résoudre la référence au bean 'entityManagerFactory' lors de la configuration argument constructeur; L'exception imbriquée est org.springframework.beans.factory.NoSuchBeanDefinitionException: Aucun bean nommé 'entityManagerFactory' n'est défini.

Eh bien, je suppose que l'erreur est parce que je le configuracion Mise en veille prolongée dans META-INF comme ceci:

  • META-INF/printemps/printemps-master.xml
    • META -INF/ressort/ressort-hibernate.xml
    • META-INF/ressort/ressort-datasource.xml
    • META-INF/printemps/jdbc.properties

et la configuration webflow dans WEB-INF: WEB-INF/printemps/Transportes-webflow.xml

<?xml version="1.0" encoding="UTF-8"?> 
<beans xmlns="http://www.springframework.org/schema/beans" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
    xmlns:webflow="http://www.springframework.org/schema/webflow-config" 
    xmlns:context="http://www.springframework.org/schema/context" 
    xmlns:faces="http://www.springframework.org/schema/faces" 
    xsi:schemaLocation=" 
    http://www.springframework.org/schema/beans 
    http://www.springframework.org/schema/beans/spring-beans-3.0.xsd 
    http://www.springframework.org/schema/webflow-config 
    http://www.springframework.org/schema/webflow-config/spring-webflow-config-2.3.xsd 
    http://www.springframework.org/schema/faces 
    http://www.springframework.org/schema/faces/spring-faces-2.0.xsd 
    http://www.springframework.org/schema/context 
    http://www.springframework.org/schema/context/spring-context-3.0.xsd"> 

<!--Flow executor for Jpa integration and security --> 
<webflow:flow-executor id="flowExecutor"> 
    <webflow:flow-execution-listeners> 
     <webflow:listener ref="securityFlowExecutionListener"/> 
     <webflow:listener ref="jpaFlowExecutionListener"/> 
    </webflow:flow-execution-listeners> 
</webflow:flow-executor> 

<!-- Flow register --> 
<webflow:flow-registry flow-builder-services="facesFlowBuilderServices" 
         id="flowRegistry" base-path="/WEB-INF/flows/"> 
    <!-- <webflow:flow-location path="/welcome/welcome.xml"/> --> 
    <webflow:flow-location-pattern value="/**/*-flow.xml"/> 
</webflow:flow-registry> 

<faces:flow-builder-services id="facesFlowBuilderServices" 
          enable-managed-beans="true" development="true"/> 

<!-- For use interface flow controller --> 
<bean 
     class="org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter"/> 

<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerAdapter"> 
    <property name="flowExecutor" ref="flowExecutor"/> 
    <!-- need to tell Spring Web Flow about how to handle Ajax requests. --> 
    <property name="ajaxHandler"> 
     <bean class="org.springframework.faces.richfaces.RichFacesAjaxHandler" /> 
    </property> 
</bean> 

<bean class="org.springframework.webflow.mvc.servlet.FlowHandlerMapping"> 
    <property name="flowRegistry" ref="flowRegistry"/> 
    <property name="defaultHandler"> 
     <bean class="org.springframework.web.servlet.mvc.UrlFilenameViewController"/> 
    </property> 
</bean> 

<!-- LISTENER'S for SECURITY and JPA--> 
<bean id="securityFlowExecutionListener" 
     class="org.springframework.webflow.security.SecurityFlowExecutionListener"/> 

<bean id="jpaFlowExecutionListener" 
     class="org.springframework.webflow.persistence.HibernateFlowExecutionListener"> 
    <constructor-arg ref="entityManagerFactory"/> 
    <constructor-arg ref="transactionManager"/> 
</bean> 

<!-- Facelets config --> 
<bean id="faceletsViewResolver" 
     class="org.springframework.web.servlet.view.UrlBasedViewResolver"> 
    <property name="viewClass" value="org.springframework.faces.mvc.JsfView"/> 
    <property name="prefix" value="/WEB-INF/flows/"/> 
    <property name="suffix" value=".xhtml"/> 
</bean> 

Ceci est mon complet rapide pour téléchargé:

https://rapidshare.com/files/335929555/prompt-jboss.zip

grâce

Répondre

0
NoSuchBeanDefinitionException: No bean named 'entityManagerFactory' is defined 

signifie qu'il est incapable de localiser une définition de haricots pour entityManagerFactory.A partir de votre webflow config il est nécessaire par jpaFlowExecutionListener:

<bean id="jpaFlowExecutionListener" 
    class="org.springframework.webflow.persistence.HibernateFlowExecutionListener"> 
    <constructor-arg ref="entityManagerFactory"/> 
    <constructor-arg ref="transactionManager"/> 
</bean> 

Dans le cas où ce haricot est défini dans:

META-INF/spring/spring-hibernate.xml 

Il doit soit être importé par une configuration webflow (WEB-INF/spring/transportes-webflow.xml)

<import resource="classpath:META-INF/spring/spring-hibernate.xml" /> 

Ou assurez-vous d'avoir ces deux fichiers dans votre écouteur de configuration Web:

<context-param> 
    <param-name>contextConfigLocation</param-name> 
    <param-value>classpath:META-INF/spring/spring-hibernate.xml /WEB-INF/spring/transportes-webflow.xml ... </param-value> 
</context-param> 

<listener> 
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> 
</listener> 
Questions connexes