14

I downloaded JBoss Application Server 5 and successfully deployed a war file. I copypasted the Hello.war which has a simple index.jsp file into

\jboss-5.1.0.GA-jdk6\jboss-5.1.0.GA\server\default\deploy

and it worked fine.

However when I used JBoss AS 7 and deployed the war file here, it did not get executed.

jboss-as-7.0.0.Final\jboss-as-7.0.0.Final\standalone\deployments

How to deploy it?

EDIT: I googled it but was not able to find info as JBoss AS 7 is relatively new.

Umesh Awasthi
  • 22,642
  • 37
  • 122
  • 198

6 Answers6

22

Actually, for the latest JBOSS 7 AS, we need a .dodeploy marker even for archives. So add a marker to trigger the deployment.

In my case, I added a Hello.war.deployed file in the same directory and then everything worked fine.

Hope this helps someone!

Subodh Joshi
  • 10,006
  • 23
  • 84
  • 177
16

Read the file $AS/standalone/deployments/README.txt

  • you have two different modes : auto-deploy mode and manual deploy mode
  • for the manual deploy mode you have to placed a marker files as described in the others posts
  • for the autodeploy mode : This is done via the "auto-deploy" attributes on the deployment-scanner element in the standalone.xml configuration file:

    <deployment-scanner scan-interval="5000" relative-to="jboss.server.base.dir"
    path="deployments" auto-deploy-zipped="true" **auto-deploy-exploded="true"**/>
    
j0k
  • 21,914
  • 28
  • 75
  • 84
influence160
  • 161
  • 1
  • 2
9

I built the following ant-task for deployment based on the jboss deployment docs:

<target name="deploy" depends="jboss.environment, buildwar">
    <!-- Build path for deployed war-file -->
    <property name="deployed.war" value="${jboss.home}/${jboss.deploy.dir}/${war.filename}" />

    <!-- remove current deployed war -->
    <delete file="${deployed.war}.deployed" failonerror="false" />
    <waitfor maxwait="10" maxwaitunit="second">
        <available file="${deployed.war}.undeployed" />
    </waitfor>
    <delete dir="${deployed.war}" />

    <!-- copy war-file -->
    <copy file="${war.filename}" todir="${jboss.home}/${jboss.deploy.dir}" />

    <!-- start deployment -->
    <echo>start deployment ...</echo>
    <touch file="${deployed.war}.dodeploy" />

    <!-- wait for deployment to complete -->
    <waitfor maxwait="10" maxwaitunit="second">
        <available file="${deployed.war}.deployed" />
    </waitfor>
    <echo>deployment ok!</echo>
</target>

${jboss.deploy.dir} is set to standalone/deployments

oleh
  • 651
  • 1
  • 12
  • 20
3

Can you provide more info on the deployment failure? Is the application's failure to deploy triggering a .war.failed marker file?

The standalone instance Deployment folder ships with automatic deployment enabled by default. The automatic deployment mode automates the same functionality that you use with the manual mode, by using a series of marker files to indicate both the action and status of deployment to the runtime. For example, you can use the unix/linux "touch" command to create a .war.dodeploy marker file to tell the runtime to deploy the application.

It might be useful to know that there are in total five methods of deploying applications to AS7. I touched on this in another topic here : JBoss AS7 *.dodeploy files

I tend to use the Management Console for application management, but I know that the Management CLI is very popular among other uses also. Both are separate to the deployment folder processes. See how you go with the other methods to fit your needs.

If you search for "deploy" in the Admin Guide, you can see a section on the Deployment Scanner and a more general deployment section (including the CLI): https://docs.jboss.org/author/display/AS7/Admin+Guide

Community
  • 1
  • 1
ddri
  • 2,140
  • 16
  • 29
1

Just copy war file to standalone/deployments/ folder, it should deploy it automatically. It'll also create your_app_name.deployed file, when your application is deployed. Also be sure that you start server with bin/standalone.sh script.

Robert Balent
  • 1,432
  • 10
  • 21
  • I copy pasted in the deployments folder and started the standalone.sh It is of no use the server is showing an error. –  Aug 10 '11 at 18:31
  • So probably some dependencies are missing. Read something about JBoss AS7 modules and classloading: https://docs.jboss.org/author/display/AS7/Class+Loading+in+AS7 – Robert Balent Aug 10 '11 at 18:35
-2

open up console and navigate to bin folder and run

JBOSS_HOME/bin > stanalone.sh

Once it is up and running just copy past your war file in

standalone/deployments folder

Thats probably it for jboss 7.1

tosha Shah
  • 1,077
  • 10
  • 13