标签: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