I am using multiple context files and when I start Tomcat, I am getting a NoSuchBeanDefinitionException. But when I run the application, the beans are fine, since everything works okay. It seems like a pointless Exception, since everything works.
Here is how my web.xml is defined:
Code:<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" version="2.4"> <display-name>My Portal</display-name> <description>My Portal Application</description> <context-param> <param-name>contextConfigLocation</param-name> <param-value> classpath:myCommonBeans.xml classpath:commonBeans.xml /WEB-INF/classes/applicationBeans.xml </param-value> </context-param> <filter> <filter-name>Spring Open Session In View</filter-name> <filter-class>org.springframework.orm.hibernate3.support.OpenSessionInViewFilter</filter-class> <init-param> <param-name>sessionFactoryBeanName</param-name> <param-value>mySessionFactory</param-value> </init-param> </filter> <filter-mapping> <filter-name>Spring Open Session In View</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <listener> <listener-class> org.springframework.web.context.ContextLoaderListener </listener-class> </listener> <servlet> <servlet-name>controller</servlet-name> <servlet-class> org.springframework.web.servlet.ViewRendererServlet </servlet-class> </servlet> <servlet-mapping> <servlet-name>controller</servlet-name> <url-pattern>/WEB-INF/servlet/view</url-pattern> </servlet-mapping> </web-app>


Reply With Quote