Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable/disable deployed components in jboss 6 using cli

Is there a way to disable/enable deployed components using the jboss cli for jboss 6.2. I need to keep the components deployed on the server but disabled until needed.

EDIT: Found a way to deploy modules as disabled adding the --disabled option in the cli file on that component.

Still looking for a way to enable modules through the cli.

EDIT 2: Is there a way to disable a already deployed component without first un-deploying? --force can not be combined with --disabled.

like image 528
jne Avatar asked Jun 17 '14 05:06

jne


People also ask

How use JBoss CLI sh?

For Windows Server, use the EAP_HOME\bin\jboss-cli. bat script to launch the management CLI. See Connect to the Server for details on launching the management CLI and connecting to the server in one step using the --connect argument. The jboss-cli scripts set the com.

Can we deploy multiple applications in JBoss?

It's very common for multiple applications to be deployed using the same instance of the wildfly VM, which means they share they same configuration and the applications all go into the same "deployments" folder. It won't hurt to have datasources, or JMS endpoints, etc.

How do you deploy an application in JBoss domain mode?

Start by logging into the Web application at the default address: https://localhost:9990/console. Then, select the Runtime tab (Point 1 in the screenshot). You will see that in the left panel of the screen, there's a Deployments menu, which includes the option Manage Deployments (Point 2).

Where is WAR deployed 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.


4 Answers

Deployment of a 'sample' web application

[standalone@localhost:9999 /] deploy /home/rudy/Downloads/sample.war

Disabling a 'sample' web application

[standalone@localhost:9999 /] undeploy sample.war --keep-content

Re-enabling a 'sample' web application

[standalone@localhost:9999 /] deploy --name=sample.war

Undeployment of a 'sample' web application

[standalone@localhost:9999 /] undeploy sample.war
like image 135
Rudy Vissers Avatar answered Oct 14 '22 13:10

Rudy Vissers


You can disable deployed components with undeploy {deployment name} --keep-content

like image 25
djmoch Avatar answered Oct 14 '22 13:10

djmoch


First of all, do you mean JBoss EAP 6.x by jboss6? I don't know anything about CLI in JBoss 6. I didn't find a way to actively disable or enable deployments via CLI, but at least you can enable a disabled deployment with

deploy --name={your_deployment_name.ear/war}

See also https://community.jboss.org/thread/223931

like image 3
Daniel Nuss Avatar answered Oct 14 '22 13:10

Daniel Nuss


In standalone it works but in domain mode you can have your application in Content Repository as well as deployed on server-group but disabled. In such case command fails:

deploy --name=app.war --server-groups=your-server-group
 JBAS014803: Duplicate resource

To enable/disable without undeploy from server group you can type:

 /server-group=your-server-group/deployment=app.war:deploy
 /server-group=your-server-group/deployment=app.war:undeploy
like image 1
Eanlr Avatar answered Oct 14 '22 11:10

Eanlr