0 Replies Latest reply on Dec 12, 2012 2:58 PM by Kamran Muhammad

    Unable to bound Resource Adapter Connection after creating Connection Definition, using Management API

    Kamran Muhammad Newbie

      Hi Everyone!

      I have been able to create a connection definition using Jboss Management API but it's jndi name is not available until i restart jboss.

      Basically it does not bound JCA Connection Factory right after create but it's get created in standalone.xml. Following is the code snippet:

       

      JBoss 7.1.0.Final

       

      ModelNode request = new ModelNode();

                                    request.get("enabled").set("true");

                                    request.get(ClientConstants.OPERATION_HEADERS).get("allow-resource-service-restart").set(Boolean.TRUE);

                                    request.get(ClientConstants.OP).set(ClientConstants.ADD);

                                    request.get(ClientConstants.OP_ADDR).add("subsystem","resource-adapters");

                                    request.get(ClientConstants.OP_ADDR).add("resource-adapter","teiid-connector-file.rar");

                                    request.get(ClientConstants.OP_ADDR).add("connection-definitions","test");

                                    request.get("jndi-name").set("java:/test");

                                    request.get("class-name").set("com.lgc.RS");

                                    request.get("pool-prefill").set(Boolean.FALSE);

                                    request.get("min-pool-size").set(5);

                                    request.get("max-pool-size").set(10);

       

       

                                    client = jbossAdmin.getClient();

                                    ModelNode response = client.execute(new OperationBuilder(request).build());

       

      response :

       

      outcome : success

       

       

      Same is the case with remove, when i remove connection definition, it's jndi name is still registered, it's not unbound, what should i add here:

       

      ModelNode request = new ModelNode();

                                    request.get(ClientConstants.OP).set("remove");

                                    request.get(ClientConstants.OP_ADDR).add("subsystem", "resource-adapters");

                                    request.get(ClientConstants.OP_ADDR).add("resource-adapter", "teiid-connector-file.rar");

                                    request.get(ClientConstants.OP_ADDR).add("connection-definitions","test");

                                    request.get("operation-headers").get("allow-resource-service-restart").set(true);

       

       

                                    client = jbossAdmin.getClient();

                                    client.execute(new OperationBuilder(request).build());

       

       

       

      Anything wrong here?

       

      Please help me in this regard,

       

      Thanks you