Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-2263

JGRP000225: failed unmarshalling buffer into return value

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Major
    • 4.0.12
    • 4.0.11
    • None
    • Hide
      public class SimpleChat {
          JChannel channel;
          RpcDispatcher dispatcher;
      
          private static final RequestOptions IMPORTANT = new RequestOptions(ResponseMode.GET_ALL, TimeUnit.SECONDS.toMillis(60)).setFlags(Message.Flag.DONT_BUNDLE);
      
          private void start() throws Exception {
              channel = new JChannel();
              dispatcher = new RpcDispatcher(channel, new Test() {
      
              });
              channel.connect("ChatCluster");
              channel.getState(null, 10000);
              Method test = Test.class.getMethod("test");
              Object o = dispatcher.callRemoteMethods(null, new MethodCall(test), IMPORTANT);
              System.out.println(o);
              channel.close();
          }
      
      
          public static void main(String[] args) throws Exception {
              new SimpleChat().start();
          }
      
          public static class Test {
              public Object test() {
                  return new EError(EError.EErrorKind.WRONG_PARAMS);
              }
          }
      
          public static class EError extends Error {
              private static final long serialVersionUID = 1L;
      
              enum EErrorKind {
                  WRONG_PARAMS,
              }
      
              final EErrorKind code;
      
              public EError(EError.EErrorKind code) {
                  this.code = code;
              }
          }
      }
      
      Show
      public class SimpleChat { JChannel channel; RpcDispatcher dispatcher; private static final RequestOptions IMPORTANT = new RequestOptions(ResponseMode.GET_ALL, TimeUnit.SECONDS.toMillis(60)).setFlags(Message.Flag.DONT_BUNDLE); private void start() throws Exception { channel = new JChannel(); dispatcher = new RpcDispatcher(channel, new Test() { }); channel.connect( "ChatCluster" ); channel.getState( null , 10000); Method test = Test. class. getMethod( "test" ); Object o = dispatcher.callRemoteMethods( null , new MethodCall(test), IMPORTANT); System .out.println(o); channel.close(); } public static void main( String [] args) throws Exception { new SimpleChat().start(); } public static class Test { public Object test() { return new EError(EError.EErrorKind.WRONG_PARAMS); } } public static class EError extends Error { private static final long serialVersionUID = 1L; enum EErrorKind { WRONG_PARAMS, } final EErrorKind code; public EError(EError.EErrorKind code) { this .code = code; } } }

    Description

      trying to send a class that previous work with 3.x return
      "failed unmarshalling buffer into return value"

      jgroups instance it's configured with the default settings

      i create a test case to reproduce it, executing this class on my 2 boxes return


      GRAVE: JGRP000225: failed unmarshalling buffer into return value
      java.lang.InstantiationException: com.eg.util.comm.SimpleChat$EError
      at java.lang.Class.newInstance(Class.java:427)
      at org.jgroups.util.Util.readException(Util.java:899)
      at org.jgroups.util.Util.exceptionFromStream(Util.java:843)
      at org.jgroups.util.Util.exceptionFromStream(Util.java:831)
      at org.jgroups.util.Util.objectFromStream(Util.java:782)
      at org.jgroups.util.Util.objectFromStream(Util.java:742)
      at org.jgroups.blocks.RequestCorrelator.replyFromBuffer(RequestCorrelator.java:463)
      at org.jgroups.blocks.RequestCorrelator.handleResponse(RequestCorrelator.java:408)
      at org.jgroups.blocks.RequestCorrelator.dispatch(RequestCorrelator.java:363)
      at org.jgroups.blocks.RequestCorrelator.receiveMessageBatch(RequestCorrelator.java:326)
      at org.jgroups.blocks.MessageDispatcher$ProtocolAdapter.up(MessageDispatcher.java:589)
      at org.jgroups.JChannel.up(JChannel.java:837)
      at org.jgroups.stack.ProtocolStack.up(ProtocolStack.java:896)
      at org.jgroups.stack.Protocol.up(Protocol.java:372)
      at org.jgroups.protocols.RSVP.up(RSVP.java:233)
      at org.jgroups.protocols.FRAG2.up(FRAG2.java:196)
      at org.jgroups.protocols.FlowControl.up(FlowControl.java:416)
      at org.jgroups.protocols.FlowControl.up(FlowControl.java:416)
      at org.jgroups.stack.Protocol.up(Protocol.java:372)
      at org.jgroups.protocols.pbcast.STABLE.up(STABLE.java:293)
      at org.jgroups.protocols.UNICAST3.deliverBatch(UNICAST3.java:1024)
      at org.jgroups.protocols.UNICAST3.removeAndDeliver(UNICAST3.java:833)
      at org.jgroups.protocols.UNICAST3.handleBatchFromSelf(UNICAST3.java:520)
      at org.jgroups.protocols.UNICAST3.up(UNICAST3.java:435)
      at org.jgroups.protocols.pbcast.NAKACK2.up(NAKACK2.java:697)
      at org.jgroups.protocols.BARRIER.up(BARRIER.java:195)
      at org.jgroups.stack.Protocol.up(Protocol.java:372)
      at org.jgroups.protocols.FD_ALL.up(FD_ALL.java:212)
      at org.jgroups.stack.Protocol.up(Protocol.java:372)
      at org.jgroups.stack.Protocol.up(Protocol.java:372)
      at org.jgroups.stack.Protocol.up(Protocol.java:372)
      at org.jgroups.protocols.TP.passBatchUp(TP.java:1274)
      at org.jgroups.util.MaxOneThreadPerSender$BatchHandlerLoop.passBatchUp(MaxOneThreadPerSender.java:284)
      at org.jgroups.util.SubmitToThreadPool$BatchHandler.run(SubmitToThreadPool.java:136)
      at org.jgroups.util.MaxOneThreadPerSender$BatchHandlerLoop.run(MaxOneThreadPerSender.java:273)
      at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
      at java.lang.Thread.run(Thread.java:745)
      Caused by: java.lang.NoSuchMethodException: com.eg.util.comm.SimpleChat$EError.<init>()
      at java.lang.Class.getConstructor0(Class.java:3082)
      at java.lang.Class.newInstance(Class.java:412)
      ... 37 more


      Attachments

        Activity

          People

            rhn-engineering-bban Bela Ban
            ramarro123 rama rama (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: