Question: I have built an application using Spring with Eclipse IDE. When I launch the project from Eclipse IDE everything is fine but when I package the maven project as a war file and deployed to separate tomcat I have this issue

```
The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.

```

This is a configuration snippet from my xml file

```
<!-- View Resolver -->
    <beans:bean
        class="org.springframework.web.servlet.view.InternalResourceViewResolver">
        <beans:property name="prefix" value="/WEB-INF/pages/" />
        <beans:property name="suffix" value=".jsp" />
    </beans:bean>

```

I am trying to access this controller 

```
@RequestMapping(value = {"/welcome", "/"})
    public String defaultPage() {
            return "Web Service data successfuly consumed";

    }

```

anyone with an idea why this is failing on deployed to tomcat?

Answer: 
Trying to run a servlet in Eclipse (right-click + "Run on Server") I encountered the very same problem:
"HTTP Status: 404 / Description: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists."
Adding an index.html did not help, neither changing various settings of the tomcat.

Finally, I found the problem in an unexpected place: In Eclipse, the Option "Build automatically" was not set. Thus the servlet was not compiled, and no File "myServlet.class" was deployed to the server (in my case in the path .wtpwebapps/projectXX/WEB-INF/classes/XXpackage/).
Building the project manually and restarting the server solved the problem.

My environment: Eclipse Neon.3 Release 4.6.3, Tomcat-Version 8.5.14., OS Linux Mint 18.1.
I am also facing the same issue and i resolve it by putting web.xml file and the applicationcontext.xml file in WEB-INF folder.

Hope this helps :)