2

I am taking over an existing Struts-based web application and am trying to deploy it for the first time on my local machine. My predecessor told me to run it through Eclipse on a Tomcat server.

I have installed the latest tomcat and it is running fine. I have grabbed the code from their CVS server and, with a few tweaks, removed all of the errors from the Java files. I then created a new Run Configuration having it run as "Run on server".

When I run the Run Config, the tomcat server starts up without error messages in the Console and an Eclipse browser page pops up to the correct local URL. The returned page is a 404, however. Looking at my Tomcat "webaps" folder, I see that my application is not there.

My question is, how can I troubleshoot this? My tomcat error logs do not get updated when I deploy and the Console output, shown below, offers no hint that there is a problem.

May 30, 2011 3:48:07 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: <long list of paths>
May 30, 2011 3:48:07 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
May 30, 2011 3:48:07 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 410 ms
May 30, 2011 3:48:07 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
May 30, 2011 3:48:07 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.32
May 30, 2011 3:48:08 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor CanPost_Emil.xml
May 30, 2011 3:48:08 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
May 30, 2011 3:48:08 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
May 30, 2011 3:48:08 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/31  config=null
May 30, 2011 3:48:08 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 244 ms
Haphazard
  • 10,900
  • 6
  • 43
  • 55
  • Try running it outside eclipse and analyzing the logs. – Abhishek May 30 '11 at 20:16
  • @Abhishek I am looking into this but I was told that their Ant build file is out of date and they relied solely on the Eclipse deploy. – Haphazard May 30 '11 at 20:41
  • Use a normal webbrowser. What is the URL you enter in the browser address bar? – BalusC May 30 '11 at 21:04
  • I believe that the real problem is that the app does not get deployed at all. I do not see it deployed in the Tomcat webapps folder. That said, the URL is http://localhost:8080// – Haphazard May 30 '11 at 21:09
  • Actually, it seems to be creating its own instance of a Tomcat server. I cannot seem to get it to hook into the full Tomcat install and I have no clue where it is trying to deploy to. I''ll have to dig deeper tomorrow. – Haphazard May 30 '11 at 21:29
  • possible duplicate of [Debugging a tomcat project in Eclipse 3.4.2](http://stackoverflow.com/questions/663769/debugging-a-tomcat-project-in-eclipse-3-4-2) – Thorbjørn Ravn Andersen May 30 '11 at 21:44

2 Answers2

1

This is not the way to run web apps inside Eclipse.

Go to the Server view panel instead, and choose Add server. Here install the Tomcat adapter according to the instructions, and then add the projects you have (if they are Dynamic Web Projects). You can now start and stop the server and have the projects chosen updated when you change.

Do it this way. Do not try to create a Run Configuration launching Tomcat.

Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
0

I have exactly the same problem.

While this is not a solution to the problem itself (running the project on Tomcat from within Eclipse), it is a way to run the project:

  1. Pack(age) the project (I use maven: 'mvn clean package')
  2. Copy the .war file into the webapps dir inside your tomcat installation.
  3. (if not already running) Start up tomcat.

This works for me. I'm still looking for the proper answer to your question, but until I find it I'll just continue to manually package/deploy the project.

Svend Hansen
  • 3,277
  • 3
  • 31
  • 50
  • Good idea. Unfortunately, this isn't a Maven-based project so I'm not even sure how they package it up but I'll look into it. – Haphazard Jun 01 '11 at 11:55