Apache Tomcat using old resources - changes in Eclipse project not reflected in Web App

JGSuw picture JGSuw · Jul 18, 2013 · Viewed 7.6k times · Source

I am using the Eclipse Java EE IDE with Apache Tomcat version 6 to develop a web application.

The structure of the application is very simple, there are just two classes, one is the servlet class and the other is a object which is built by the servlet and does most of the work.

The problem that I am having is this: since this morning changes which I have made to both class files have not been appeared in the behaviour of the Web application. The application essentially behaves as if it is running my code from yesterday. To make sure that this is the case, I temporarily altered the behaviour of the program in radical ways and low, these changes still did not affect the web application.

Some relevant information:I am running Ubuntu 12, my Eclipse project is set to build automatically, and the tomcat server is configured to auto load modules by default and to automatically publish whenever a resource is changed. I have also cleaned out the server's working directory.

How can I overcome this issue? I need my web application to implement the changes which I have made to the source code of my servlet and the class which the servlet uses.

Answer

Paul Vargas picture Paul Vargas · Jul 18, 2013

If you add the Tomcat server in the standar way in the tabs Servers, the deploy path lives in the .metadata directory of your workspace.

The next tree directory is for my workspace. I added Tomcat 7.

MY_WORKSPACE
+---.metadata
|   \---.plugins
|       +---org.eclipse.wst.server.core
|       |   |   monitors.xml
|       |   |   publish.xml
|       |   |   servers.xml
|       |   |   tmp-data.xml
|       |   |   
|       |   +---publish
|       |   |       publish0.dat
|       |   |       publish1.dat
|       |   |       
|       |   \---tmp0
|       |       +---conf
|       |       |   |   catalina.policy
|       |       |   |   catalina.properties
|       |       |   |   context.xml
|       |       |   |   server.xml
|       |       |   |   tomcat-users.xml
|       |       |   |   web.xml
|       |       |   |   
|       |       |   \---Catalina
|       |       |       \---localhost
|       |       +---logs
|       |       |       catalina.2013-07-06.log
|       |       |       catalina.2013-07-11.log
|       |       |       host-manager.2013-07-06.log
|       |       |       host-manager.2013-07-11.log
|       |       |       localhost.2013-07-06.log
|       |       |       localhost.2013-07-11.log
|       |       |       localhost_access_log.2013-07-06.txt
|       |       |       localhost_access_log.2013-07-11.txt
|       |       |       manager.2013-07-06.log
|       |       |       manager.2013-07-11.log
|       |       |       
|       |       +---temp
|       |       +---webapps
|       |       +---work
|       |       |   \---Catalina
|       |       |       \---localhost
|       |       \---wtpwebapps
|       |           +---ROOT
|       |           |   \---WEB-INF
|       |           |           web.xml
|       |           |           
|       |           \---MyWebProject
|       |               |   index.html
|       |               |       
|       |               \---WEB-INF
|       |                   +---classes
|       |                   |   |   
|       |                   |   \---several-packages-and-clases
|       |                   \---lib
|       |                           log4j-1.2.17.jar
|       |                           slf4j-api-1.7.5.jar
|       |                           slf4j-log4j12-1.7.5.jar
|       |                           
|       \---org.other.plugins
|               
\---Servers
    |   .project
    |   
    +---.settings
    |       org.eclipse.wst.server.core.prefs
    |       
    \---Tomcat v7.0 Server at localhost-config
            catalina.policy
            catalina.properties
            context.xml
            server.xml
            tomcat-users.xml
            web.xml

The real path for my web application MyWebProject is in the directory wtpwebapps. You can delete MyWebProject and try again.

If you have several Tomcat's in your workspace, you see directories like tmp0, tmp1, tmp2 ...