- This topic has 2 replies, 2 voices, and was last updated 18 years, 2 months ago by Haris Peco.
-
AuthorPosts
-
mimi_grebiciMemberHi
I have the following exception when I want to start my application :
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named ‘sessionFactory’ is defined
org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:352)
org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:671)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:198)
org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:151)
org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:559)
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:76)But at the server start, I see that the context is created, the mapping objects and DAO objects are instanciated!!
So I dont know why there is an exception about the sessionFactory?
thanks
Mimi
mimi_grebiciMemberI found the error !!!
it was because of the sessionFilter that I used !!
this was the sessionFilter configuration in web.xml :
<filter> <filter-name>sessionFilter</filter-name> <filter-class> org.springframework.orm.hibernate3.support.OpenSessionInViewFilter </filter-class> <init-param> <param-name>singleSession</param-name> <param-value>false</param-value> </init-param> </filter> <filter-mapping> <filter-name>sessionFilter</filter-name> <url-pattern>/*</url-pattern> </filter-mapping>
But I dont understand why this filter cause problem, so what is its role?
Thank you
Haris PecoMembermimi_grebici,
For description ‘Open session in View’ see http://www.hibernate.org/43.html
Spring have own implementation ofr this pattern – check spring documentationBest
Peco -
AuthorPosts