做SSH2的时候遇到的一个问题,哪位高手帮忙解决一下!
Tomcat启动正常,站点也是true状态,但是打开站点就报一下错误: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:914)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:241)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:737)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:243)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.lookupSessionFactory(OpenSessionInViewFilter.java:227)
org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:171)
org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:75)
org.apache.struts2.dispatcher.FilterDispatcher.doFilter(FilterDispatcher.java:413)
--------------------编程问答-------------------- 学习…… --------------------编程问答-------------------- 问题解决了。
原来在spring配置文件中构造sessionFactory的bean的id名字必须是‘sessionFactory’,我的id名字是‘sessionfactory’。但是我之前的项目用的‘sessionfactory’都没有这个错误的,很不解。
补充:.NET技术 , C#