Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

java - typo in NotifyMessage.java #64

Closed
seoyoungjin opened this Issue Sep 29, 2012 · 5 comments

Comments

Projects
None yet
3 participants

I could't use notifyApply() because of this.

Index: src/main/java/org/msgpack/rpc/message/NotifyMessage.java
===================================================================
--- src/main/java/org/msgpack/rpc/message/NotifyMessage.java    (revision 474)
+++ src/main/java/org/msgpack/rpc/message/NotifyMessage.java    (working copy)
@@ -45,11 +45,12 @@
         pk.writeArrayBegin(3);
         pk.write(Messages.NOTIFY);
         pk.write(method);
-        pk.write(args.length);
+        pk.writeArrayBegin(args.length);
         for (Object arg : args) {
             pk.write(arg);
         }
         pk.writeArrayEnd();
+        pk.writeArrayEnd();
     }

     public void readFrom(Unpacker u) throws IOException {
Index: src/main/java/org/msgpack/rpc/message/RequestMessage.java
===================================================================
--- src/main/java/org/msgpack/rpc/message/RequestMessage.java   (revision 474)
+++ src/main/java/org/msgpack/rpc/message/RequestMessage.java   (working copy)
@@ -57,6 +57,7 @@
             pk.write(arg);
         }
         pk.writeArrayEnd();
+        pk.writeArrayEnd();
     }

     public void readFrom(Unpacker u) throws IOException {
Contributor

repeatedly commented Oct 4, 2012

Thanks for the report!

Do you have an sample code for this issue?

Hmmm,

I tried to notify like this.

// oneway
public void ifs3_broadcast_msg(ifs3_broadcast_msgRequest req)
{
    session.notifyApply("ifs3_broadcast_msg", new Object[]{req});
}

But, in sever side, I met an exception message like "Number is used ad
Array....".

    Value[] array = args.asArrayValue().getElementArray();
    if(array.length != 1) {
        throw new MessageTypeException();
    }

I couldn't any error in other code, I begin to read message serialization
itself.
Argument, 3rh element in notify message(type, name, arg) must be an array.
Please compare with RequestMessage.java.

Seo Youngjin

Contributor

repeatedly commented Oct 11, 2012

Thanks for more clarify!

I will check later. Please wait.

Contributor

frsyuki commented Oct 11, 2012

Oh, what's a terrible bug...I merged. Thanks a lot!

@frsyuki frsyuki closed this Oct 11, 2012

Contributor

repeatedly commented Oct 12, 2012

@frsyuki Thanks for quick fix. I gave up buliding Java program on CLI...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment