tags:

views:

788

answers:

3

Hello: I am trying to deploy a war file outside of a deploy folder in jboss. I changed the context.xml with the following content:

<Context docBase="C:\Apps\foo.war" reloadable="true" privileged="true" antiResourceLocking="false" path="/"></Context>

The context file is inside jboss-5.1.0.GA\server\default\deploy\jbossweb.sar\ in 5.1.0.GA and jboss-4.2.3.GA\server\default\deploy\jboss-web.deployer\ in 4.2.3.GA.

This is what I thought would be the only changes. But is not working. Can someone please tell me what other files do I have to modify?

Thanks.

+1  A: 

I found out that I had to add the directory location at jboss-service.xml:

<attribute name="URLs">deploy/, file:\C:\Apps\foo.war</attribute>

This being in windows and jboss.4.2.3.GA and the application was successfully deployed and accessible through http://localhost:8080/foo.

Thanks.

royalGhost
I have explained this in my blog at http://paudelp.wordpress.com/2010/01/06/deploying-war-outside-of-deploy-directory-on-jboss-4-2-3-ga/ .
royalGhost
A: 

In order to deploy web application outside of deploy directory you have to change profile.xml
See bean BootstrapProfileFactory and property applicationURIs.

 <property name="applicationURIs">
  <list elementClass="java.net.URI">
   <value>${jboss.server.home.url}deploy</value>
   <value>...directory outside of deploy dir...</value>
  </list>
 </property>
Vladimir Bezugliy
+1  A: 

For JBoss 5, you need to add your custom deploy urls to the bootstrap profile service.

Be aware, JBoss 5 uses a vfs layer, which will require you to add your custom deploy location to the list of permanent roots in conf/bootstrap/vfs.xml if you want to avoid filling up your disk space with duplicate exploded jars. In addition, some versions of the vfs don't properly recognize literal deploy URLs so you may need to use bean injection.

pra