java 如何在 JBOSS 7 上部署一个简单的 war 文件?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12797931/
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-31 10:15:38  来源:igfitidea点击:

How to deploy a simple war file on JBOSS 7?

javajakarta-eejbossjboss7.xjboss5.x

提问by vivek rai

I deployed a simple war file (vivek.war) which contains a simple index.jsp file successfully in Jboss-5.X.X and Jboss-6.X.X.I simply placed the war file in server\default\deploy

我部署了一个简单的war文件(vivek.war),其中包含一个简单的index.jsp文件,Jboss-5.X.X and Jboss-6.X.X.我只是将war文件放在server\default\deploy

And then went to localhost:8080/vivek/index.jspand everything was fine.

然后去了localhost:8080/vivek/index.jsp,一切都很好。

But Similarly, for Jboss-as-7.1.1, I deployed the war file in standalone standalone\deploymentsand started \bin\standalone.shand then went to localhost:8080/Hello/index.jspdoes not display the file. it shows HTTP Status 404-/vivek/(description The requested resource (/axis2/) is not available.)in the browser.

但是同样的,对于Jboss-as-7.1.1,我在standalone中部署了war文件standalone\deployments,启动\bin\standalone.sh然后去localhost:8080/Hello/index.jsp不显示文件。它显示HTTP Status 404-/vivek/(description The requested resource (/axis2/) is not available.)在浏览器中。

What is the procedure to deploy a simple war file on Jboss-as-7.1.1 and how i get in browser.

在 Jboss-as-7.1.1 上部署一个简单的 war 文件的过程是什么以及我如何进入浏览器。

if nay one have idea please help me?

如果有人有想法请帮助我?

Thanx

谢谢

回答by cache

You should PUT an empty flag file warname.dodeploy (ex. vivek.war.dodeploy) in your deployments directory.

您应该在您的部署目录中放置一个空标志文件warname.dodeploy(例如 vivek.war.dodeploy)。

More information about flag files is available in the README.TXT in the deployments directory.

部署目录中的 README.TXT 中提供了有关标志文件的更多信息。

回答by Jagdish Chandra

While deploying a war project in Jboss AS7 ,one either copy a so-called exploded web application, i.e non-compressed, or a compressed web application resource .WAR file to this location ${jboss.server.base.dir}/standalone/deployments/

在 Jboss AS7 中部署 war 项目时,可以将所谓的爆炸式 Web 应用程序(即未压缩)或压缩的 Web 应用程序资源 .WAR 文件复制到此位置 ${jboss.server.base.dir}/standalone/部署/

  • When one choose to deploy the project in the non-compressed or exploded-directory-form, one need to specify marker file .dodeploy e.g. vivek.war.dodeploy if folder name is vivek.war
  • When One choose to deploy the project in a compressed web application resource form , No flag file is required.
  • 当一个人选择在非压缩或爆炸的目录表单中部署项目时,需要指定标记文件.Dodeploce,例如vivek.war.dodeploy,如果文件夹名称是vivek.war
  • 当 One 选择以压缩的 Web 应用程序资源形式部署项目时,不需要标志文件。

You can refer following resources for more details
1. A useful link for this is as follows Link for deployments in JBoss AS 7
2. For extensive details you can have a look at the ${jboss.server.base.dir}/standalone/deployments/README.txt file located at the location

您可以参考以下资源以获取更多详细信息
1. 一个有用的链接如下JBoss AS 7 中的部署链接
2. 有关详细信息,您可以查看 ${jboss.server.base.dir}/standalone/位于该位置的 deployments/README.txt 文件

non-compressed implies it is simple directory structure you get from jar file after unzipping it example of directory structure is below -

未压缩意味着它是解压缩后从 jar 文件中获得的简单目录结构 目录结构示例如下 -

   vivek.war   
      |-index.jsp    
      |- WEB-INF   
          |- web.xml   

回答by Kirill Mikhailov

Hmm, my JBoss 7.1.1 do not need .dodeploy file in deployments directory. Its enough simply to copy .war or .ear or ejb.jar to deployments dir for server to start deployment process. Please provide server.log to see the details. Do you set context-root tag in META-INF/web.xml or application.xml?

嗯,我的 JBoss 7.1.1 不需要部署目录中的 .dodeploy 文件。只需将 .war 或 .ear 或 ejb.jar 复制到服务器的部署目录即可开始部署过程。请提供 server.log 以查看详细信息。您是否在 META-INF/web.xml 或 application.xml 中设置了上下文根标记?

回答by srk

Its very simple, copy your war and paste it inside your standalone\deploymentsand run standalone.batfrom your bindirectory in windows. If you are on Linux, run standalone.shfrom your bindirectory.

它非常简单,复制您的War并将其粘贴到您的目录中standalone\deployments,然后standalone.bat从您bin的 Windows 目录运行。如果您使用的是 Linux,请standalone.sh从您的bin目录运行。