1 Reply Latest reply on Apr 30, 2014 6:48 AM by jaikiran

    cannot deploy using dmr/json api on full-ha cluster

    sachindole

      Hello,

       

      I am cross-posting this from the general wildfly forum - maybe this is a better place for the question?

       

      I have a domain setup with wildfly 8 and I am trying to deploy a war file using the JSON management API. I have this working for standalone, but cant seem to make it work for domain mode. Here is the two step process I follow:

       

      Step 1:

      to /management/add-content, send a post with "file" parameter set to the binary for my war file. I get a success resonse:

      {  
           "outcome" : "success",  
           "result" : {  
                "BYTES_VALUE" : /Aa3z8JORR1HWqXu9yOKh1WLpvs="  
           }
      }  
      

       

      Step 2:

      to /management, I send a post request with this json and I get back an internal server error (code 500)

       

      {  
           "content":[{  
                "hash":{  
                     "BYTES_VALUE":"8+CLT8fXmITHvIE3POn6cuQHXN0="  
                     }  
           }],  
           "address":[{  
                "deployment":"web-1.0-SNAPSHOT.war",  
                "server-groups":["trelair-server-group"],  
                "server":"trelair-server",  
                "host":"master"  
           }],  
           "operation":"add",  
           "enabled":"true",  
      }  
      

       

      The server side exception does not help much:


      2014-04-21 06:08:25,207 INFO  [org.jboss.as] (Controller Boot Thread) JBAS015874: WildFly 8.0.0.Final "WildFly" (Host Controller) started in 20638ms - Started 44 of 46 services (13 services are lazy, passive or on-demand)  
      2014-04-21 06:08:25,348 INFO  [org.jboss.as.host.controller] (server-registration-threads - 1) JBAS010919: Registering server trelair-server  
      2014-04-21 06:13:18,892 INFO  [org.jboss.as.repository] (XNIO-1 task-2) JBAS014900: Content added at location /tr/wildfly-8.0.0.Final/domain/data/content/fc/06b7cfc24e451d475aa5eef7238a87558ba6fb/content  
      2014-04-21 06:14:59,959 ERROR [io.undertow.request] (XNIO-1 task-5) Blocking request failed HttpServerExchange{ POST /management}: java.lang.IllegalArgumentException  
              at org.jboss.dmr.ModelValue.asProperty(ModelValue.java:96) [jboss-dmr-1.2.0.Final.jar:1.2.0.Final]  
              at org.jboss.dmr.ObjectModelValue.asProperty(ObjectModelValue.java:152) [jboss-dmr-1.2.0.Final.jar:1.2.0.Final]  
              at org.jboss.dmr.ModelNode.asProperty(ModelNode.java:372) [jboss-dmr-1.2.0.Final.jar:1.2.0.Final]  
              at org.jboss.as.controller.PathAddress.pathAddress(PathAddress.java:74) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]  
              at org.jboss.as.domain.http.server.DomainApiHandler.sendPreparedResponse(DomainApiHandler.java:286) [wildfly-domain-http-interface-8.0.0.Final.jar:8.0.0.Final]  
              at org.jboss.as.domain.http.server.DomainApiHandler.handleRequest(DomainApiHandler.java:155) [wildfly-domain-http-interface-8.0.0.Final.jar:8.0.0.Final]  
              at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:72) [wildfly-domain-http-interface-8.0.0.Final.jar:8.0.0.Final]  
              at org.jboss.as.domain.http.server.security.SubjectDoAsHandler$1.run(SubjectDoAsHandler.java:68) [wildfly-domain-http-interface-8.0.0.Final.jar:8.0.0.Final]  
              at java.security.AccessController.doPrivileged(Native Method) [rt.jar:1.8.0]  
              at javax.security.auth.Subject.doAs(Subject.java:422) [rt.jar:1.8.0]  
              at org.jboss.as.controller.AccessAuditContext.doAs(AccessAuditContext.java:94) [wildfly-controller-8.0.0.Final.jar:8.0.0.Final]  
              at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:68) [wildfly-domain-http-interface-8.0.0.Final.jar:8.0.0.Final]  
              at org.jboss.as.domain.http.server.security.SubjectDoAsHandler.handleRequest(SubjectDoAsHandler.java:63) [wildfly-domain-http-interface-8.0.0.Final.jar:8.0.0.Final]  
              at io.undertow.server.handlers.BlockingHandler.handleRequest(BlockingHandler.java:50) [undertow-core-1.0.0.Final.jar:1.0.0.Final]  
              at org.jboss.as.domain.http.server.DomainApiCheckHandler.handleRequest(DomainApiCheckHandler.java:77) [wildfly-domain-http-interface-8.0.0.Final.jar:8.0.0.Final]  
              at io.undertow.security.handlers.AuthenticationCallHandler.handleRequest(AuthenticationCallHandler.java:52) [undertow-core-1.0.0.Final.jar:1.0.0.Final]  
              at io.undertow.server.Connectors.executeRootHandler(Connectors.java:168) [undertow-core-1.0.0.Final.jar:1.0.0.Final]  
              at io.undertow.server.HttpServerExchange$1.run(HttpServerExchange.java:687) [undertow-core-1.0.0.Final.jar:1.0.0.Final]  
              at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [rt.jar:1.8.0]  
              at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [rt.jar:1.8.0]  
              at java.lang.Thread.run(Thread.java:744) [rt.jar:1.8.0]  
      

       

      What am I missing? Any suggestions either in plain json or in the jboss dmr style will help a LOT!

       

      Thank you!

       

      Sachin