Today, when configuring Opensessioninview, Tomcat starts without an error, but sends an error when sending a request, as follows:
Org.springframework.beans.factory.NoSuchBeanDefinitionException:No Bean named ' sessionfactory ' is defined Org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition (
defaultlistablebeanfactory.java:387) Org.springframework.beans.factory.support.AbstractBeanFactory.getMergedLocalBeanDefinition ( abstractbeanfactory.java:971) Org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean ( abstractbeanfactory.java:246) Org.springframework.beans.factory.support.AbstractBeanFactory.getBean ( abstractbeanfactory.java:185) Org.springframework.beans.factory.support.AbstractBeanFactory.getBean ( abstractbeanfactory.java:168) Org.springframework.context.support.AbstractApplicationContext.getBean (
abstractapplicationcontext.java:884) 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:76)
Also do not know how, unconsciously I go to the Web.xml configuration file with a little configuration, the problem is resolved, as follows:
<init-param>
<param-name>sessionFactoryBeanName</param-name>
<param-value> ID of the mysessionfactory</param-value>//sessionfactory bean
</init-param>
Why is this so I do not know, but also hope to consult