java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/final-servlet.xml]
Solution 1
Put the final-servlet.xml under WEB-INF folder and it will works. What you are asking about your application-context.xml i think is something like this:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
WEB-INF/final-servlet.xml
classpath:application-context.xml
</param>
</context-param>
Solution 2
Files in the resources directory are deployed to the classpath, not WEB-INF
. If you want the file in WEB-INF
then it needs to be in src/webapp/WEB-INF
, as in any Maven-based web app project.
Otherwise the location referenced in the Spring config needs to be classpath-relative.
JOHND
http://www.aonlinetraining.com/online_training_textile_designing_gallery1.html http://www.sasmira.org/courses.htm http://www.birlavidyamandir.com/Careers/institutes_art%20architecture%20photography%20design%20fashion.htm
Updated on June 05, 2022Comments
-
JOHND almost 2 years
I am creating simple maven project plugin . Application directory structure is like standard maven project directory structure.
I have place application-context.xml file under src/main/java/resources folder.
Problem :
How to configure this path in web.xml file ?
I am getting java.io.FileNotFoundException: Could not open ServletContext resource
[/WEB-INF/final-servlet.xml]
errorDo i have to configure my project properties in eclipse???
Can any one guide me on the same....??
Thanks in advance..>!
-
Dave Newton almost 12 yearsDid you mean /src/main/resources? In any case, we don't know how you're trying to access the file, so diagnosing what's gone wrong is difficult.
-
JOHND almost 12 yearshow to access ..?? i dont know . I just created folder structure and welcome file. I am just tasting my framework.
-
JOHND almost 12 yearswhen i build and run it using eclipse it gives java.io.FileNotFoundException: Could not open ServletContext resource [/WEB-INF/final-servlet.xml] error On console
-
Dave Newton almost 12 yearsWe don't know what you're doing. If you're just creating a spring web project put the file in the right location.
-
JOHND almost 12 yearsI am creating plugin project for future reference
-
-
Admin about 10 yearsHow can we access these files for
BufferedWriter
in the Service layer?