3 Replies Latest reply: Sep 18, 2012 5:11 PM by Frank Langelage RSS

Add resource-adapter via jboss-cli?

Frank Langelage Master

How do I add a new resource adapter via jboss-cli.sh?

I did not find a command for doing this job.

 

Currently I have this static in my standalone-full.xml:

{code:xml}

        <subsystem xmlns="urn:jboss:domain:resource-adapters:1.0">

            <resource-adapters>                                                                                                    

                <resource-adapter>                                                                                                 

                    <archive>controller.rar</archive>                                                                              

                    <connection-definitions>                                                                                       

                        <connection-definition jndi-name="java:/eis/maj2e-lafr-dev/Controller">                                    

                            <config-property name="ClientService">JCAClient</config-property>                                      

                            <config-property name="ServerName">sb2000</config-property>                                            

                            <config-property name="PortNumber">6506</config-property>                                              

                            <config-property name="SocketTimeout">0</config-property>                                              

                            <config-property name="Encoding">ISO-8859-15</config-property>                                         

                        </connection-definition>                                                                                   

                    </connection-definitions>                                                                                      

                </resource-adapter>                                                                                                

            </resource-adapters>                                                                                                   

        </subsystem>                                                                                                               

{code}

  • 1. Re: Add resource-adapter via jboss-cli?
    Stefano Maestri Expert

    From cli: Using :add operaton on the resource adapter and then on subresources (like connection definiton). At the end you can call :activate on resource-adapter to apply the config on already deployed archive.

    In your case you have to do something like

     

    /subsystem=resource-adapters/resource-adapter=controller.rar:add(archive=controller.rar)

    /subsystem=resource-adapters/resource-adapter=controller.rar/connection-definitions=Controller:add(jndi-name="java:/eis/maj2e-lafr-dev/Controller")

    /subsystem=resource-adapters/resource-adapter=controller.rar/connection-definitions=Controller/config-properties=ClientService:add(value=JCAClient)

    /subsystem=resource-adapters/resource-adapter=controller.rar/connection-definitions=Controller/config-properties=<name>:add(value=<value>) for all other config-property

    /subsystem=resource-adapters/resource-adapter=controller.rar:activate

     

    Weconsole: AFAIK not yet supported scheduled for 7.1.1

     

    hoping it helps

    S.

  • 2. Re: Add resource-adapter via jboss-cli?
    gaurav singhal Newbie

    Is there a way to "remove" a resource-adapter like this that was added via CLI and also any way to "edit" a config-property for a resource adapter that was added previously. And is there a restart required for these changes to take effect? I'm asking because in this JIRA issues it mentions that https://issues.jboss.org/browse/AS7-1381?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

  • 3. Re: Add resource-adapter via jboss-cli?
    Frank Langelage Master

    Here my 2 files, first to add and second to remove the adapter:

    connect

    /subsystem=resource-adapters/resource-adapter=int2e-langfr-dev:add(archive=controller.rar, transaction-support=NoTransaction)

    /subsystem=resource-adapters/resource-adapter=int2e-langfr-dev/connection-definitions=int2e-langfr-dev:add(jndi-name="java:/eis/int2e-langfr-dev/ControllerConnector",class-name="biz.mbisoftware.fn.jca.controllerconnector.ManagedConnectionFactoryImpl",enabled="true")

    /subsystem=resource-adapters/resource-adapter=int2e-langfr-dev/connection-definitions=int2e-langfr-dev/config-properties=ClientService:add(value=JCAClient)

    /subsystem=resource-adapters/resource-adapter=int2e-langfr-dev/connection-definitions=int2e-langfr-dev/config-properties=SocketTimeout:add(value=0)

    /subsystem=resource-adapters/resource-adapter=int2e-langfr-dev/connection-definitions=int2e-langfr-dev/config-properties=Encoding:add(value=ISO-8859-15)

    /subsystem=resource-adapters/resource-adapter=int2e-langfr-dev/connection-definitions=int2e-langfr-dev/config-properties=ServerName:add(value=sb2000)

    /subsystem=resource-adapters/resource-adapter=int2e-langfr-dev/connection-definitions=int2e-langfr-dev/config-properties=PortNumber:add(value=6502)

    /subsystem=resource-adapters/resource-adapter=int2e-langfr-dev:activate

     

    connect

    /subsystem=resource-adapters/resource-adapter=int2e-langfr-dev:remove