Uploaded image for project: 'WildFly Core'
  1. WildFly Core
  2. WFCORE-48

EOFException when address of a mgmt operation is of a bad data type

    Details

      Description

      (Hopefully this belongs to WildFly Core. If not, please move to WildFly.)

      I'm doing a programmatic invocation of a simple mgmt operation on the root mgmt resource, say e.g. :whoami. I'm doing this against a freshly built WildFly from master branch (commit e2b9ecfb) and on the client side, I'm depending on org.wildfly.core:wildfly-controller-client:1.0.0.Alpha4.

      The code looks like this:

      ModelControllerClient client = ModelControllerClient.Factory.create("localhost", 9990);
      
      try {
          ModelNode op = new ModelNode();
          op.get(ClientConstants.OP).set("whoami");
          op.get(ClientConstants.OP_ADDR).set("");
          ModelNode result = client.execute(op);
          System.out.println(result);
      } finally {
          client.close();
      }
      

      This fails with an exception like this:

      Exception in thread "main" java.io.IOException: java.util.concurrent.ExecutionException: Operation failed
      	at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:129)
      	at org.jboss.as.controller.client.impl.AbstractModelControllerClient.execute(AbstractModelControllerClient.java:71)
      	at cz.ladicek.wildfly.ErrorReproducer.main(ErrorReproducer.java:17)
      	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      	at java.lang.reflect.Method.invoke(Method.java:606)
      	at com.intellij.rt.execution.application.AppMain.main(AppMain.java:134)
      Caused by: java.util.concurrent.ExecutionException: Operation failed
      	at org.jboss.threads.AsyncFutureTask.operationFailed(AsyncFutureTask.java:74)
      	at org.jboss.threads.AsyncFutureTask.get(AsyncFutureTask.java:268)
      	at org.jboss.as.controller.client.impl.AbstractDelegatingAsyncFuture.get(AbstractDelegatingAsyncFuture.java:100)
      	at org.jboss.as.controller.client.impl.AbstractModelControllerClient.executeForResult(AbstractModelControllerClient.java:127)
      	... 7 more
      Caused by: java.io.EOFException
      	at java.io.DataInputStream.readByte(DataInputStream.java:267)
      	at org.jboss.as.protocol.mgmt.ProtocolUtils.expectHeader(ProtocolUtils.java:83)
      	at org.jboss.as.controller.client.impl.AbstractModelControllerClient$1.handleRequest(AbstractModelControllerClient.java:167)
      	at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:270)
      	at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleRequest(AbstractMessageHandler.java:235)
      	at org.jboss.as.protocol.mgmt.AbstractMessageHandler.handleMessage(AbstractMessageHandler.java:113)
      	at org.jboss.as.protocol.mgmt.ManagementChannelReceiver$1.handleMessage(ManagementChannelReceiver.java:56)
      	at org.jboss.as.protocol.mgmt.ManagementChannelReceiver.handleMessage(ManagementChannelReceiver.java:84)
      	at org.jboss.remoting3.remote.RemoteConnectionChannel$5.run(RemoteConnectionChannel.java:452)
      	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
      	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
      	at java.lang.Thread.run(Thread.java:745)
      

      However, when I remove the line that sets address (op.get(ClientConstants.OP_ADDR).set("");), it works just fine.

      Fine, I made a mistake, but getting an EOFException? That's hardly an appropriate response. I should get a proper failure ("outcome" => "failed" etc.).

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                ehugonnet Emmanuel Hugonnet
                Reporter:
                lthon Ladislav Thon
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: