问题
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
And then went to localhost:8080/vivek/index.jsp
and everything was fine.
But Similarly, for Jboss-as-7.1.1, I deployed the war file in standalone standalone\deployments
and started \bin\standalone.sh
and then went to localhost:8080/Hello/index.jsp
does not display the file.
it shows HTTP Status 404-/vivek/
(description The requested resource (/axis2/) is not available.)
in the browser.
What is the procedure to deploy a simple war file on Jboss-as-7.1.1 and how i get in browser.
if nay one have idea please help me?
Thanx
回答1:
You should PUT an empty flag file warname.dodeploy (ex. vivek.war.dodeploy) in your deployments directory.
More information about flag files is available in the README.TXT in the deployments directory.
回答2:
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?
回答3:
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/
- 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.
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
non-compressed implies it is simple directory structure you get from jar file after unzipping it example of directory structure is below -
vivek.war
|-index.jsp
|- WEB-INF
|- web.xml
回答4:
Its very simple, copy your war and paste it inside your standalone\deployments
and run standalone.bat
from your bin
directory in windows. If you are on Linux, run standalone.sh
from your bin
directory.
来源:https://stackoverflow.com/questions/12797931/how-to-deploy-a-simple-war-file-on-jboss-7