Tomcat6 没有部署我的 web 应用程序
我可以访问当前部署两个 Web 应用程序的 Tomcat 服务器。当我将自己的 webapp 放在 apache-tomcat-6.xxx/webapps 目录中时,它不会部署它。我尝试下载 Tomcat 示例 webapp,并将其部署在 webapps 目录中,但它仍然没有部署。
除了将 webapps 放入 apache*/webapps 目录中以进行部署之外,我还需要做些什么吗?我已经尝试过启动/重新启动 Tomcat,令人恶心。
谢谢,
克特姆
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(9)
当你说你放置了自己的 webapp 时,我假设你正在放置你的
webapp.war
文件?确保在放置webapp.war
之前先删除现有的webapp
目录。 Tomcat 将自动扩展 war 文件以创建该webapp
目录。When you say you put your own webapp, I assume you are putting your
webapp.war
file? Make sure you delete the existingwebapp
directory first before you placewebapp.war
. Tomcat will automatically inflate the war file to create thatwebapp
directory.您是否尝试过停止并启动tomcat?
Did you try stopping and starting tomcat?
你的服务器启动了吗?如果是,那么您的项目目录将在 webapps 中创建。
还要查找环境变量。
Is your server getting started? And if yes than your project directory is created in webapps.
Also look for environment variable.
检查安全管理器是否正在运行。如果是,您将需要编辑 catalina.policy 文件以允许部署和访问您的 Web 应用程序。
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.
如果从 eclipse 导出 .war 文件,请确保项目的动态 Web 模块构面版本不超过生产服务器可以处理的版本。例如,版本3.0适用于Tomcat 7,但不适用于Tomcat 6,需要将其设置为2.5。要将项目构面版本降低一个档次,请参阅 这个问题。
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.
确保您的 war 文件的权限属于 tomcat 用户和组。确保先删除部署的目录,然后重新启动服务器。
$ sudo rm -fr /path/to/tomcat/webapps/
$ sudo chown tomcat:tomcat /path/to/tomcat/webapps/< /code>
现在重新启动服务器
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
我在tomcat 6的部署系统上遇到了问题。由于某种原因,文件 $CATALINA_HOME/conf/Catalina/localhost/MyAppName.xml 的长度为零...我不确定是什么原因导致的,但我删除了零长度的 XML,删除了 WAR,然后我重复了部署过程(将 WAR 复制到 webapps 目录)并且部署正确。我在日志文件中找到了失败消息...现在我下次知道了,但我认为值得分享以防万一...
希望它有帮助...
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...
我也遇到这个问题,我重新下载tomcat并仔细检查service.xml,最后我发现我的WEB-INF/web.xml不存在。
i also meet the problem,i redownload tomcat and check service.xml carefully,finnally i find my WEB-INF/web.xml not exsit.
我面临的问题是正在运行的 java 进程太多。不知何故,它没有让 Tomcat 启动,也没有抛出任何错误。
为此,我杀死了所有 java 进程,然后重新启动 Tomcat,它就工作了。
在Linux中:
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: