org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'sessionFactory' is defined
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:360)
org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:686)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:219)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:149)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:541)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:223)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:207)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:146)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
com.tlt.app.filter.SessionFilter.doFilter(SessionFilter.java:45)
org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:75)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:77)
它说 No bean named 'sessionFactory' is defined,想起了web.xml下有个配置:
<filter>
<filter-name>OpenSessionInViewFilter</filter-name>
<filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class>
</filter>
<filter-mapping>
<filter-name>OpenSessionInViewFilter</filter-name>
<url-pattern>/*</url-pattern>
</filter-mapping>
把它去掉就可以了。
因为我没有让Spring管理hibernate,也就是说Spring配置文件中没有任何hibernate的影子,所以在web.xml中也不需要OpenSessionInViewFilter这个东西。否则就报错。
OpenSessionInViewFilter类作用 见下面的文章:
http://gundumw100.iteye.com/blog/508658
分享到:
相关推荐
org.springframework.beans-3.0.4.RELEASE.jar org.springframework.context.support-3.0.4.RELEASE.jar org.springframework.context-3.0.4.RELEASE.jar org.springframework.core-3.0.4.RELEASE.jar org....
Maven坐标:org.springframework:spring-beans:5.2.0.RELEASE; 标签:springframework、spring、beans、中英对照文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览...
org.springframework.flex-1.0.3.RELEASE.jar.zip用于JAR包,org.springframework.flex-1.0.3.RELEASE.jar.zip用于JAR包org.springframework.flex-1.0.3.RELEASE.jar.zip用于JAR包org.springframework.flex-1.0.3....
Maven坐标:org.springframework:spring-beans:5.0.10.RELEASE; 标签:spring、beans、springframework、jar包、java、API文档、中文版; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.transaction.interceptor.TransactionInterceptor#0': Error setting property values; nested ...
org.springframework.beans-3.0.5.RELEASE.jar org.springframework.context-3.0.5.RELEASE.jar org.springframework.context.support-3.0.5.RELEASE.jar org.springframework.core-3.0.5.RELEASE.jar org.spring...
Maven坐标:org.springframework:spring-beans:5.2.0.RELEASE; 标签:springframework、spring、beans、中文文档、jar包、java; 使用方法:解压翻译后的API文档,用浏览器打开“index.html”文件,即可纵览文档...
nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'userController' defined in ServletContext resource [/WEB-INF/springMVC-servlet.xml]: Error ...
aopalliance-1.0.jar,org.springframework.aop-3.0.0.RELEASE.jar,org.springframework.jdbc-3.0.0.RELEASEorg.springframework.beans-3.0.0.RELEASE.jar等
9. **Integration with other Spring Modules**:`org.springframework.web.jar`与Spring框架的其他模块紧密集成,如Spring Core、Spring Beans、Spring AOP等,共同构建出一个完整的应用框架。 总的来说,`org....
org.springframework.beans-3.0.0.M4.jar
org.springframework.beans-3.0.5工程所需jar包,com.springsource.net.sf.cglib-2.2.0.jar、 com.springsource.org.apache.commons.logging-1.1.1.jar、 javax.inject.jar、 javax.servlet.jsp.jar、 org.spring...
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.test.context.ContextConfiguration; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; @...
org.springframework.beans-sources-3.0.5.release.jar
`org.springframework.beans.factory.config.PropertyPlaceholderConfigurer` 是Spring框架中的一个重要组件,主要负责处理配置文件中的占位符替换。这个类是Spring在初始化bean时用来解析和注入环境变量或系统属性...
org.springframework.beans-3.1.RELEASE.jar org.springframework.context.support-3.1.RELEASE.jar org.springframework.context-3.1.RELEASE.jar org.springframework.core-3.1.RELEASE.jar org.spring...
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/...
org.springframework.beans-3.0.0.RELEASE.jar org.springframework.context.support-3.0.0.RELEASE.jar org.springframework.context-3.0.0.RELEASE.jar org.springframework.core-3.0.0.RELEASE.jar org.spring...
org.springframework.beans-3.1.1.RELEASE org.springframework.context.support-3.1.1.RELEASE org.springframework.context-3.1.1.RELEASE org.springframework.core-3.1.1.RELEASE org.springframework....
在Spring框架中,`org.springframework.beans.factory.InitializingBean`接口是一个非常重要的概念,它用于标记那些需要在初始化完成后执行特定逻辑的bean。这个接口只包含一个方法:`afterPropertiesSet()`,当bean...