Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Deploying a war outside of a deploy directory in jboss

Tags:

java

jboss

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.

like image 868
royalghost Avatar asked Dec 10 '09 07:12

royalghost


People also ask

Where should I deploy WAR in JBoss?

If we already have the war file and we want to deploy it on JBoss, we can go to the JBoss installation directory at standalone/deployments and paste the file there.

Can we deploy WAR file in JBoss?

After you configure all properties files in WAR files, you must deploy these WARs through the app server. IMPORTANT: The following configuration is same for all app servers, except the deployment paths for app servers. To deploy configured console .

How do I deploy a WAR file locally?

Copy and paste WAR files into Tomcat's webapps directory to deploy them. Tomcat monitors this webapps directory for changes, and if it finds a new file there, it will attempt to deploy it. If you do your application build on the same machine as your Tomcat server, simply cut and paste it to begin deployment.

How many ways we can deploy application in JBoss?

Deployment Modes The scanner can operate in one of two different modes, depending on whether it will directly monitor the deployment content in order to decide to deploy (or redeploy) it.


2 Answers

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.

like image 117
royalghost Avatar answered Oct 24 '22 10:10

royalghost


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.

like image 40
pra Avatar answered Oct 24 '22 10:10

pra