I have created a Spring Mvc application using IntelliJ IDEA and then I moved and renamed the default application-config file to another directory. Now I am getting this error : 'Application context not configured for this file' The new place of the file is src/main/webapp/WEB-INF/spring/appServlet/servlet-context.xml
The file is this one:
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd">
<!-- Enables the Spring MVC @Controller programming model -->
<mvc:annotation-driven/>
<mvc:resources mapping="/resources/**" location="/"/>
<bean class="org.springframework.web.servlet.view.InternalResourceViewResolver">
<property name="prefix" value="/WEB-INF/pages/"/>
<property name="suffix" value=".jspx"/>
</bean>
<context:component-scan base-package="com.apress.prospring3.ch17.web.controller"/>
</beans>
Any ideas? Thank you.
Check the config of spring in the web.xml file.
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:applicationContext.xml
</param-value>
</context-param>
The contextConfigLocation parameter config the xml location about spring, Check you web.xml is correct.
If you load the xml by java code,like @skiabox, you can ignore this warning.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With