Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a way to check before adding module to JBoss using CLI?

Is there a way to check module hasn't already been added before calling adding using JBoss CLI?

e.g.

module add --name=org.mysql --resources=/home/abc/drivers/mysql/MySQL5.jar



# Want to do similar check for module add
if (outcome != success) of /subsystem=datasources/jdbc-driver=org.mysql:read-resource
   # Add it...
end-if

Reason is trying to add a module that already exists causes an error.

like image 445
user1016765 Avatar asked Mar 18 '14 11:03

user1016765


1 Answers

When in domain mode, you can do that.

Here's how you can check a module's existence:

if (outcome != success) of /host=master/core-service=module-loading/:list-resource-loader-paths(module=your.module.name)
    echo install your.module.name ...   
    module add --name=your.module.name --dependencies=.. --resources=....jar
else 
    echo module your.module.name already installed
end-if
like image 118
aymens Avatar answered Sep 22 '22 12:09

aymens