Hi Everyone,
i am getting crazy with following Problem and i struggle with this for 2 days now. I hope anyone can help me.
I created a WebApplication based on following web.xml (i just changed some names)
I run with this configuration for quite some time now, and i noticed that it seems that all my beans are created twice.Thats not problem for stateless beans, but i had to add a cache to a service bean and so, i just noticed the problem.Code:<?xml version="1.0" encoding="UTF-8"?> <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <context-param> <param-name>contextConfigLocation</param-name> <param-value> /WEB-INF/context/a.xml, /WEB-INF/context/b.xml, /WEB-INF/context/c.xml, /WEB-INF/context/d.xml </param-value> </context-param> <context-param> <param-name>contextClass</param-name> <param-value>org.springframework.web.context.support.XmlWebApplicationContext </param-value> </context-param> <listener> <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> <servlet> <servlet-name>servicelayer</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>servicelayer</servlet-name> <url-pattern>/services/*</url-pattern> </servlet-mapping> </web-app>
Whats wrong here and how can i set up the web.xml to load the Beans only once?
thank you in advance
Kai


Reply With Quote
