码迷,mamicode.com
首页 > 其他好文 > 详细

ssh2整合: No bean named 'sessionFactory' is defined(求大神指点)

时间:2017-11-09 14:46:50      阅读:385      评论:0      收藏:0      [点我收藏+]

标签:cep   web   app   cto   sql   ram   path   报错   dia   

applicationContext.xml 中已经配置

<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
        <property name="dataSource" ref="dataSource"/>
        <property name="hibernateProperties">
            <props>
                <prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
                <prop key="hibernate.show_sql">true</prop>
                <prop key="hibernate.format_sql">false</prop>
            </props>
        </property>
        <property name="mappingLocations">
            <list>
                <value>classpath:com.ceshi.entry/*.hbm.xml</value>
            </list>
        </property>
 </bean>

web.xml中

    <filter>
        <filter-name>openSessionInView</filter-name>
        <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
        <init-param>  
          <param-name>sessionFactoryBeanName</param-name>  
          <param-value>sessionFactory</param-value>
        </init-param> 
    </filter>
    <filter-mapping>
        <filter-name>openSessionInView</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

 报错信息:

org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘sessionFactory‘ is defined
    org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:549)
    org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition(AbstractBeanFactory.java:1096)
    org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:278)
    org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
    org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1121)
    org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:278)
    org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:263)
    org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:195)
    org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107)

 

ssh2整合: No bean named 'sessionFactory' is defined(求大神指点)

标签:cep   web   app   cto   sql   ram   path   报错   dia   

原文地址:http://www.cnblogs.com/count-mjb/p/7808247.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!