我收到此错误org.springframework.beans.factory.BeanCreationException

时间:2013-07-31 08:55:27

标签: java hibernate spring-webflow

我正在努力纠正这个错误但不是因为3天有人可以帮我解决..!

当我使用tomcat 7部署我的应用程序时,我正在使用spring2.5和hibernate3以及struts2-2.1.6获取此错误。

Flowing是我的applicationContext.xml文件

提前致谢..

<bean id ="RegistrationBeanId" class="com.xxxx.click.action.Registration.RegistrationController">
    <property name="newregistration" ref="newregistration"/>
</bean>
<bean id="newregistration" class="com.xxxxx.click.service.addRegistration.NewRegistrationManager">
    <property name="webResourceModule" ref="webResourceModule"/>
</bean>
<bean id ="webResourceModule" class="com.seeinfobiz.click.daoImpl.Wrm.WrmDAOImpl">
    <property name="sessionFactory" ref="sessionFactory"/>
</bean>

<bean id ="fileUploadBeanId" class="com.xxxx.click.action.FileUpload.FileUploadController">
    <property name="fileuploadManager" ref="fileuploadManager"/>
</bean>
<bean id="fileuploadManager" class="com.seeinfobiz.click.service.FileUploadManager.FileUploadManager">
    <property name="fileUploadDAOImpl" ref="fileUploadDAOImpl"/>
</bean>
<bean id ="fileUploadDAOImpl" class="com.seeinfobiz.click.daoImpl.FileUploadDAOImpl">
    <property name="sessionFactory" ref="sessionFactory"/>
</bean>
<!--- filupload End -->

<!-- Login Beans - Start-->
<bean id="loginBeanId" class="com.xxxxx.click.action.login.LoginController">
    <property name="loginService" ref="loginService"></property>
    <property name="menuTreeId" ref="menuTreeId"></property>
    <property name="searchManager" ref="searchManager"></property>
</bean>

和web.xml文件

<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <distributable/>
    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/classes/applicationContext.xml</param-value>
    </context-param>
    <listener>
        <listener-class>com.xxxx.click.util.ClickPssServletContextListener</listener-class>
    </listener>
    <listener>
        <listener-class>com.xxxxx.click.util.ClickPssSessionListener</listener-class>
    </listener>
    <listener>
        <listener-class>com.xxxxx.click.zschedular.SchedularListener</listener-class>
    </listener>
    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>
    <filter>
        <filter-name>ResponseOverrideFilter</filter-name>
        <filter-class>org.displaytag.filter.ResponseOverrideFilter</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>ResponseOverrideFilter</filter-name>
        <url-pattern>*.export</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>ResponseOverrideFilter</filter-name>
        <url-pattern>*.action</url-pattern>
    </filter-mapping>
    <filter-mapping>
        <filter-name>ResponseOverrideFilter</filter-name>
        <url-pattern>*.jsp</url-pattern>
    </filter-mapping>
    <!--filter-mapping>
        <filter-name>ResponseOverrideFilter</filter-name>
        <url-pattern>*.do</url-pattern>
    </filter-mapping-->
    <filter>
        <filter-name>struts2</filter-name>
        <filter-class>org.apache.struts2.dispatcher.FilterDispatcher</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>struts2</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <filter>
        <filter-name>encodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>
    <filter-mapping>
        <filter-name>encodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>
    <session-config>
        <session-timeout>
           15
        </session-timeout>
    </session-config>
    <welcome-file-list>
        <welcome-file>clickpss/index.html</welcome-file>
    </welcome-file-list>
    <!-- added by stalin on 17 Sep, 2011-->
    <error-page>
        <error-code>404</error-code>
        <location>/error/404.jsp</location>
    </error-page>
    <error-page>
        <error-code>500</error-code>
        <location>/error/500.jsp</location>
    </error-page>
    <error-page>
        <error-code>403</error-code>
        <location>/error/403.jsp</location>
    </error-page>
    <error-page>
        <error-code>400</error-code>
        <location>/error/400.jsp</location>
    </error-page>
    <!-- Added by Adip  -->
    <security-constraint>
        <web-resource-collection>
            <web-resource-name>All JSP direct access</web-resource-name>
            <url-pattern>/views/*</url-pattern>
            <url-pattern>/WEB-INF/*</url-pattern>
        </web-resource-collection>
        <auth-constraint>
            <description>
                No Access
            </description>
            <role-name>restricted</role-name>
        </auth-constraint>
    </security-constraint>

</web-app>

请帮助我!

1 个答案:

答案 0 :(得分:0)

在你的applicationContext.xml文件中,我没有看到任何名称或id为sessionFactory的bean,而你正在引用它<property name="sessionFactory" ref="sessionFactory"/>并在另一个地方。请将名称或标识为bean的bean定义为sessionFactory。