java Tomcat6 没有部署我的 webapp

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/4938378/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-30 08:41:45  来源:igfitidea点击:

Tomcat6 not deploying my webapp

javatomcatdeploymenttomcat6

提问by ktm5124

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.

我可以访问当前部署两个 web 应用程序的 Tomcat 服务器。当我将自己的 webapp 放在 apache-tomcat-6.xxx/webapps 目录中时,它不会部署它。尝试下载Tomcat示例webapp,部署到webapps目录下,还是没有部署。

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.

除了将 webapps 放在 apache*/webapps 目录中以让它们部署之外,还有什么我需要做的吗?我曾尝试启动/重新启动 Tomcat 令人作呕。

Thanks,
ktm

谢谢,
ktm

回答by limc

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

当您说您放置自己的 web 应用程序时,我假设您正在放置您的webapp.war文件?确保webapp在放置之前先删除现有目录webapp.war。Tomcat 将自动扩充 war 文件以创建该webapp目录。

回答by Rcunn87

Did you try stopping and starting tomcat?

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

回答by Jeshurun

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 thisquestion.

如果您从 Eclipse 导出 .war 文件,请确保您的项目的动态 Web 模块方面版本不超过您的生产服务器可以处理的版本。例如,3.0 版本适用于 Tomcat 7,但不适用于 Tomcat 6,需要将其设置为 2.5。要将项目方面版本降低一个档次,请参阅问题。

回答by kofrasa

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.

确保您的 war 文件的权限属于 tomcat 用户和组。确保先删除部署的目录,然后重新启动服务器。

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

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

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

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

Now restart the server

现在重启服务器

回答by JL Sardi?as

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...

我在使用 tomcat 6 的部署系统时遇到了问题。出于某种原因,文件 $CATALINA_HOME/conf/Catalina/localhost/MyAppName.xml 的长度为零......我不确定是什么原因造成的,但我删除了零长度的 XML,删除了 WAR,然后我重复了部署过程(将 WAR 复制到 webapps 目录)并正确部署。我在日志文件中发现了失败消息......现在我下次知道了,但我认为值得分享以防万一......

Hope it helps...

希望能帮助到你...

回答by chao

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

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

回答by Pritam Banerjee

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.

我面临的问题是运行的 Java 进程太多。不知何故,它没有让 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]

回答by Ankit

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

您的服务器启动了吗?如果是,那么您的项目目录将在 webapps 中创建。还要查找环境变量。

回答by Woot4Moo

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 应用程序。