I'm writing a simple Spring/Quartz/Hibernate-based job scheduling system (as a web application), and trying to get the Spring ContextLoaderListener to pick up my context.xml. I don't know much about the whole j2ee lifecycle thing, but when I deploy my WAR file, Tomcat picks it up and explodes it, but the ContextLoaderListener never kicks off (never loads my context.xml file). No exceptions, just... nothing.
Here's the web.xml:
Yeah, that's the WHOLE thing. I'm guessing the listener isn't firing because there's just no context to load. Is that possible? How can I force the listener to fire when my entire application is essntially contained in Spring-Injected beans?
Try to remove the WEB-INF part, because iirc WEB-INF is the location that it is automatically looked at.
For instance, if you were to name the file applicationContext.xml and put it in the WEB-INF folder at its root, then you don't need the <context-param> tags anymore, because applicationContext.xml is the default file name it searches for if you don't put in a <context-param> tag in your web.xml
I've actually used this exact same config in other projects (where there was a servlet configured), and it worked fine, so I don't think that's it. Check out this Spring Beans Docs. They also mention using the ContextLoaderServlet, guess I could do, although I hear that's been deprecated in favor of ContextLoaderListener...
UPDATE: Yeah, ContextLoaderServlet doesn't exist in Spring 3.0.0M1, so that won't work :-(
Aaaaaand ... we're on the march. Stylin. Get with it tiny ad.