3

I have a Dynamic Web Project in Eclipse that should be auto-deployed to Tomcat (version 5.5) but it's not happening. There are no build errors and the class files show up in the project in the workspace but they never get copied over to the Tomcat instance. The project name is timex2 and I've tried several different default output folders but to no avail. The default output folder is currently set to: timex2/WebContent/WEB-INF/classes.

Here's the source tab from the build path: source tab

Here's the project in the package explorer: package explorer

Here's the directory structure of the project in windows explorer:

directory structure

Update: Here's the Markers Window:

enter image description here

opike
  • 7,053
  • 14
  • 68
  • 95
  • Are you seeing any errors in output window? Provide the steps you did. – kosa Apr 10 '12 at 14:23
  • No build errors in the console although there are some warnings. I've done a "Build Project" and also a build with a clean. – opike Apr 10 '12 at 14:31
  • I suspect it will be a similar issue to one I used to run into - does this help? http://stackoverflow.com/q/4777026/586748 – Russell Apr 10 '12 at 14:38
  • That issue seems to have to do with external jar files but in my case the .class files from the actual project aren't getting deployed to tomcat. – opike Apr 10 '12 at 15:13
  • Are you attempting to deploy the web app to an instance of tomcat that is being run inside of eclipse or are you attempting to deploy the web app to an actual tomcat server? – ChadNC Apr 10 '12 at 15:47
  • Well that's part of what I'm figuring out right now. I have tomcat set up to run inside of eclipse. So it looks like in that instance the files don't get moved over to tomcat but tomcat points to the files within the workspace. So what I'm trying to figure out now is how tomcat knows where to look for those files in the workspace. – opike Apr 10 '12 at 16:44

2 Answers2

2

Eclipse will keep the files local to the project. This allows for hot deploy when debugging and sharing a tomcat instance among multiple projects,etc. The local files will have everything needed for deployment, see all the xml files defined in your server inside eclipse. This is what is used to bootstrap Tomcat.

If you want a quick way to check the runtime port just add an html file with soime markup at the root of the webapp, right click on it and say "run on server". This should open the file up using the context root and you will be good to go on with your development.

TechTrip
  • 4,299
  • 2
  • 21
  • 16
  • So these files and/or settings are passed to tomcat when eclipse kicks tomcat off? Is it done as a command line parameter? – opike Apr 10 '12 at 20:57
  • It is done behind the scenes as a java executable. The local catalina.properties lists all the settings. Server.xml defines server props (host, port, etc). The web.xml file will control the catalina servlet as well as other important settings and mappings. – TechTrip Apr 11 '12 at 00:33
  • The good news however is that you shouldn't be editing these files. Make changes through the eclipse interface. If you really wanted to you could have it use the installation of tomcat for the server path. If you double click on the launch config it will show you the startup parameters. This is where you see the important stuff I believe that will be of interest to you; i.e. the log file location. These are under the .metadata directory, typically in `${PROJECT_NAME}\.metadata\.plugins\org.eclipse.wst.server.core\tmp0`. A folder called wtpwebapps is where indigo expands your webapp. – TechTrip Apr 11 '12 at 00:41
  • Now, I must admit, 99% of the time you shouldn't have to dig in these locations. An exception may be when you want to debug into the generated JSP files. You should be getting some kind of error indicating what is going on. I would need a bit more to go on to try and figure out what is happening. Typical culprits, multiple apps on the same port, a compile time error and not having deploy with errors turned on, etc. – TechTrip Apr 11 '12 at 00:45
2

Take a look at the "Deployment Assembly" tab under project preferences and see if things are being deployed into the tomcat directory like they should be

Mouscellaneous
  • 2,584
  • 3
  • 27
  • 37