简体   繁体   English

Tomcat6没有部署我的Web应用程序

[英]Tomcat6 not deploying my webapp

I have access to a Tomcat server that is currently deploy two webapps. 我可以访问当前正在部署两个Web应用程序的Tomcat服务器。 When I put my own webapp in the apache-tomcat-6.xxx/webapps directory, it doesn't deploy it. 当我将自己的Web应用程序放在apache-tomcat-6.xxx/webapps目录中时,它不会部署它。 I tried downloading the Tomcat sample webapp, and deployed it in the webapps directory, and it still doesn't deploy. 我尝试下载Tomcat示例webapp,并将其部署在webapps目录中,但仍未部署。

Is there anything I have to do beyond putting the webapps in the apache*/webapps directory to get them to deploy? 除了将webapp放置在apache * / webapps目录中之外,我还需要做其他事情吗? I have tried starting/restarting Tomcat ad nauseam. 我尝试启动/重新启动Tomcat ad nauseam。

Thanks, 谢谢,
ktm ktm

When you say you put your own webapp, I assume you are putting your webapp.war file? 当您说您放置自己的webapp时,我假设您正在放置webapp.war文件? Make sure you delete the existing webapp directory first before you place webapp.war . 确保在放置webapp.war之前先删除现有的webapp目录。 Tomcat will automatically inflate the war file to create that webapp directory. Tomcat将自动对war文件进行膨胀以创建该webapp目录。

您是否尝试过停止并启动tomcat?

Ensure that permissions on your war file belongs to the tomcat user and group. 确保对war文件的权限属于tomcat用户和组。 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 现在重新启动服务器

I had a problem with tomcat 6's deployment system. 我对tomcat 6的部署系统有疑问。 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. 由于某种原因,文件$ CATALINA_HOME / conf / Catalina / localhost / MyAppName.xml的长度为零...我不确定是什么原因造成的,但是我删除了零长度的XML,删除了WAR,然后重复了部署过程(将WAR复制到webapps目录),并且部署正确。 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... 希望能帮助到你...

我也遇到问题,我重新下载了tomcat并仔细检查了service.xml,最后我发现我的WEB-INF / web.xml不存在。

Is your server getting started? 您的服务器正在启动吗? And if yes than your project directory is created in webapps. 如果是,则在webapps中创建项目目录。 Also look for environment variable. 还要查找环境变量。

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. 如果是这样,则需要编辑catalina.policy文件以允许您的Web应用程序被部署和访问。

The problem that I faced was there were too many java processes that were running. 我面临的问题是正在运行的Java进程过多。 Somehow it was not letting Tomcat start and did not throw any error. 不知何故,它没有让Tomcat启动,也没有引发任何错误。

For that I killed all the java processes and then restarted the Tomcat and it worked. 为此,我杀死了所有的Java进程,然后重新启动了Tomcat,它开始工作了。

In Linux: 在Linux中:

> ps -aux | grep java
> kill -9 [pid_from_last_command]

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. 如果从eclipse导出.war文件,请确保项目的动态Web模块构面版本不超过生产服务器可以处理的版本。 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. 例如,3.0版适用于Tomcat 7,但不适用于Tomcat 6,后者需要将其设置为2.5。 To knock the project facet version down a notch, see this question. 要将项目构想版本降低一个档次,请参阅问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM