如何使用 Eclipse Juno 将一个 war 文件部署到 tomcat 6
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/13093868/
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
How do I deploy a war file onto tomcat 6 using eclipse Juno
提问by Tintin
I am not familiar with build processes on Eclipse with javascript (HTML5) and Java resources. But recently I got a war file from someone who asked me put it on tomcat (since the server where I used to access the project from is down). I tried putting it under C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps... and then I restarted the tomcat which I have mounted on eclipse... and then I thought I will be able to access the project using localhost
我不熟悉 Eclipse 上使用 javascript (HTML5) 和 Java 资源的构建过程。但是最近我从有人那里得到了一个War文件,他让我把它放在 tomcat 上(因为我用来访问项目的服务器已经关闭)。我试着把它放在 C:\Program Files\Apache Software Foundation\Tomcat 6.0\webapps... 然后我重新启动了我在 eclipse 上安装的 tomcat... 然后我想我将能够使用访问该项目本地主机
http://localhost:8080/<warprojectfilename>
But I get 404...
但我得到 404 ...
Could someone let me know how could I deploy it on tomcat and access it using localhost like a website.
有人可以让我知道如何将它部署在 tomcat 上并像网站一样使用 localhost 访问它。
Thanks
谢谢
采纳答案by Tintin
Since it was all static resource (javascript files)... I decided to extract the whole thing in a static web project on eclipse and it worked.
因为它都是静态资源(javascript 文件)...我决定在 Eclipse 上的静态 Web 项目中提取整个内容并且它起作用了。
回答by Marcin Wasiluk
it looks like you have got some other Tomcat (or other server using port 8080)running on your machine... please check which tomcat instance is running and stop it, or stop any other server running service that you mentioned is working fine...
看起来您的机器上正在运行其他一些 Tomcat(或其他使用端口 8080 的服务器)...请检查哪个 tomcat 实例正在运行并停止它,或者停止您提到的任何其他运行服务的服务器运行正常.. .
You can stop tomcat server by going in to tomcat/bin and execute
您可以通过进入 tomcat/bin 并执行来停止 tomcat 服务器
sh shutdown.sh
or
或者
shutdown.bat
in windows
在窗户里
and to deploy war file to Tomcat server :
并将war文件部署到Tomcat服务器:
1) go to your Tomcat path
1)转到您的Tomcat路径
2) open webapps directory
2)打开webapps目录
3) paste your war file here
3) 在这里粘贴您的战争文件
4) restart tomcat
4)重启tomcat
5) now you should be able to access your app
5) 现在您应该可以访问您的应用了
回答by user3668494
File -> import ->Web-War file this will import your .war as a web project. goto Servers->tomcat->web modules-> add the imported web project. restart tomcat. you should be good
文件 -> 导入 -> Web-War 文件,这会将您的 .war 文件作为 Web 项目导入。转到Servers->tomcat->web modules->添加导入的web项目。重启tomcat。你应该很好