4

I have access to a Tomcat server that is currently deploy two webapps. When I put my own webapp in the apache-tomcat-6.xxx/webapps directory, it doesn't deploy it. I tried downloading the Tomcat sample webapp, and deployed it in the webapps directory, and it still doesn't deploy.

Is there anything I have to do beyond putting the webapps in the apache*/webapps directory to get them to deploy? I have tried starting/restarting Tomcat ad nauseam.

Thanks,
ktm

ktm5124
  • 11,861
  • 21
  • 74
  • 119
  • i assume you do not have access to the tomcat-manager app?, also, consider that there is a configuration setting in server.xml (autoDeploy) that might be set to false. – chahuistle Feb 08 '11 at 21:07
  • I don't know what the tomcat-manager app really is. I'm completely new to this. However, autoDeploy is set to true in conf/server.xml. – ktm5124 Feb 08 '11 at 21:14
  • The manager is at /manager. You'll need an admin account, which by default you can create by editing conf/tomcat-users.xml. – OrangeDog Feb 08 '11 at 21:35
  • Do you have any hint in $CATALINA_HOME/logs/catalina.out or $CATALINA_BASE/logs/catalina.out ? tomcat might have complained. If you want to see what the output is and if you can restart tomcat, instead of using startup.sh simply stop tomcat and execute catalina.sh at the command prompt. – Alain Pannetier Feb 08 '11 at 21:50
  • I don't have any hint in catalina.out. It says "deploying web application archive [mywarapp]" which should be good news... – ktm5124 Feb 08 '11 at 21:57

9 Answers9

1

When you say you put your own webapp, I assume you are putting your webapp.war file? Make sure you delete the existing webapp directory first before you place webapp.war. Tomcat will automatically inflate the war file to create that webapp directory.

limc
  • 39,366
  • 20
  • 100
  • 145
  • Okay, I deleted the webapp directory and tried it with just webapp.war. Tomcat did indeed inflate my war file, but it still is not deploying it. When I go to my.url.com/[mywebapp], I get a 404 Not Found error. But when I go to my.url.com/[otherwebapp], the other web app runs fine. – ktm5124 Feb 08 '11 at 21:12
  • It seems like your autoDeploy must be false: http://tomcat.apache.org/tomcat-5.5-doc/deployer-howto.html#Deploying_on_a_running_Tomcat_server . Turn that on, and it should work. – limc Feb 08 '11 at 21:15
  • No, autoDeploy is true. It has always been that way. – ktm5124 Feb 08 '11 at 21:18
  • Try reloading the application by typing this in the web browser: http://localhost:8080/manager/reload?path=/webapp – limc Feb 08 '11 at 21:21
  • I tried that. I got a 403 Forbidden: "You don't have permission to access /manager/reload on this server." (I don't have physical access to the server, I am accessing it through SSH.) – ktm5124 Feb 08 '11 at 21:24
1

Did you try stopping and starting tomcat?

Rcunn87
  • 134
  • 2
  • 10
0

Ensure that permissions on your war file belongs to the tomcat user and group. Make sure to remove the deployed directory first, and then restart the server.

$ sudo rm -fr /path/to/tomcat/webapps/<yourwebapp>

$ sudo chown tomcat:tomcat /path/to/tomcat/webapps/<yourwebapp.war>

Now restart the server

kofrasa
  • 2,090
  • 2
  • 14
  • 10
0

I had a problem with tomcat 6's deployment system. For some reason the file $CATALINA_HOME/conf/Catalina/localhost/MyAppName.xml was zero-length... I'm not sure about what caused it, but I deleted the zero-lenght XML, deleted the WAR and then I repeated the deployment process (copied the WAR to the webapps directory) and it deployed correctly. I found the failure message in a log file... now I know it for the next time, but I though it would be worth to share just in case...

Hope it helps...

0

i also meet the problem,i redownload tomcat and check service.xml carefully,finnally i find my WEB-INF/web.xml not exsit.

chao
  • 1
0

Is your server getting started? And if yes than your project directory is created in webapps. Also look for environment variable.

Ankit
  • 2,753
  • 1
  • 19
  • 26
0

Check to see if the security manager is running. If it is you will need to edit the catalina.policy file to allow your web application to be deployed and accessed.

Woot4Moo
  • 23,987
  • 16
  • 94
  • 151
  • How do I know if the security manager is running? But I checked catalina.policy, and I didn't see any of the working webapps being granted permissions. – ktm5124 Feb 08 '11 at 21:54
  • in the startup scripts it will have the `-security` flag – Woot4Moo Feb 08 '11 at 22:40
0

The problem that I faced was there were too many java processes that were running. Somehow it was not letting Tomcat start and did not throw any error.

For that I killed all the java processes and then restarted the Tomcat and it worked.

In Linux:

> ps -aux | grep java
> kill -9 [pid_from_last_command]
Pritam Banerjee
  • 17,953
  • 10
  • 93
  • 108
0

If you export your .war file from eclipse, make sure your project's dynamic web module facet version is not more than what your production server can handle. For example, version 3.0 works for Tomcat 7, but doesn't work on Tomcat 6, which needs it to be set as 2.5. To knock the project facet version down a notch, see this question.

Community
  • 1
  • 1
Jeshurun
  • 22,940
  • 6
  • 79
  • 92