Home » Java » wtpwebapps/myapp is empty when running Tomcat under Eclipse

wtpwebapps/myapp is empty when running Tomcat under Eclipse

Posted by: admin December 28, 2021 Leave a comment

Questions:

I know that tomcat is running because when I type http://localhost, the tomcat page dispay. My problem is I can’t figure out why the wtpwebapps/myapp is empty, is like the eclipse doesn’t publish it and when i type http://localhost/myapp, I get 404 error.

In the server overview :

  • Server Location is set to “Use Tomcat installation” | server path: the servers’s folder | deploy path : wtpwebapps
  • Server Option : Publish module contexts to separate XML file
  • Publishing : Automatically publish when ressource change

I use eclipse Ganymede 3.4.2, tomcat 6.0, under Win7

Any help would be appreciated, thanks

Answers:

your files must be somwhere, so start searching in:

<YOUR_WORKSPACE_DIR>\.metadata\.plugins\org.eclipse.wst.server.core\tmp<SOME_NUMBER>\wtpwebapps

###

I had a similar problem, when updating our project (.project and .classpath are checked in for convenience, but causes sometimes problems).

Console-Log in eclipse always says:

Error configuring application listener of class org.sth.ThisClass
java.lang.ClassNotFoundException: org.sth.ThisClass

The reason was that $WORKSPACE_DIR/.metadata/.plugins/org.eclipse.wst.server.core/tmp$NUMBER/wtpwebapps/$CONTEXT/WEB-INF/lib/classes was empty. The solution was to enter under Project Properties > Deployment Assembly an entry:

Source: /src

Deploy Path: WEB-INF/classes

###

If you use a Maven in your project, this is a solution for you:

  1. Delete the project(s) in the Eclipse.
  2. create project from Maven sources (select your workspace directory).
  3. Check found pom.xml to import.

Restart the Tomcat.

###

Try to look into servers explorer and it will show you what state is your application at and if its deployed.

###

Since I had difficulty finding where this “server overview” is, I like to add that you just double click on a server under the “servers” view. I kept on right click and look at the “Properties” and was not getting to this information.