What my guess would be is that you aren't setting it up correctly with 2 ApplicationContexts, which is typical in a Spring MVC app.
So the DispatcherServlet servlet creates a child application context, this should have beans that are for the Web Layer only. No Services or below in this config.
The ContextLoaderListener creates a parent application context. This should have your middle tier beans only. Services and below.
With this setup in the web.xml, then the child app context can see all thebeans in the parent app context.
So my guess is you deployed the DispatcherServlet pointing to the config file for the Web Tier beans, which is correct. But you didn't configure the ContextLoaderListener in your web.xml
Mark Spritzler wrote:Well, it isn't seeing your Service classes.
What my guess would be is that you aren't setting it up correctly with 2 ApplicationContexts, which is typical in a Spring MVC app.
So the DispatcherServlet servlet creates a child application context, this should have beans that are for the Web Layer only. No Services or below in this config.
The ContextLoaderListener creates a parent application context. This should have your middle tier beans only. Services and below.
With this setup in the web.xml, then the child app context can see all thebeans in the parent app context.
So my guess is you deployed the DispatcherServlet pointing to the config file for the Web Tier beans, which is correct. But you didn't configure the ContextLoaderListener in your web.xml
Post your web.xml
Mark
Hi ..
Thanks for the reply. Please find web.xml. Let me know where and what am I doing wrong ?
You have two context-params. The first one is for the ContextLoaderListener and is correct. Although if that is the file you have in your WEB-INF with that name, then you don't need the context-param for it, that is the default location and name.
As far as your second one. That is supposed to be used for your DispatcherServlet, which should be in your <servlet> tag as an <init-param>
But again, for that init-param, you name it also following the naming default strategy, so you wouldn't even need it either. If that is the location and name of that config file.
So my recommendation first.
Remove both <context-param> that you have in your web.xml and try it out.
Mark
J amodi
Greenhorn
Joined: Nov 09, 2011
Posts: 18
posted
0
Ok. Let me try it out ...
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.
subject: NoSuchBeanDefinitionException using spring and mybatis