7 Replies Latest reply on Jul 29, 2010 7:41 AM by jdestef

    Serilaization Question

    jdestef

      Hi,

       

      I Have an object that looks like this:

       

      import org.jboss.errai.bus.server.annotations.ExposeEntity;

       

      import com.google.gwt.user.client.rpc.IsSerializable;

       

      @ExposeEntity
      public class QueryMessage implements IsSerializable {
          private String startDate;
          private String endDate;
          private Boolean processed;
         
          public QueryMessage() {
          }

       

          public QueryMessage(String startDate, String endDate, Boolean processed) {
              super();
              this.startDate = startDate;
              this.endDate = endDate;
             
              this.processed = processed;
          }

       

          public String getStartDate() {
              return startDate;
          }

       

          public void setStartDate(String startDate) {
              this.startDate = startDate;
          }

       

          public String getEndDate() {
              return endDate;
          }

       

          public void setEndDate(String endDate) {
              this.endDate = endDate;
          }

       

          public Boolean isProcessed() {
              return processed;
          }

       

          public void setProcessed(Boolean processed) {
              this.processed = processed;
          }
         
          @Override
          public String toString() {
              StringBuffer buf = new StringBuffer();
              buf.append(startDate);
              buf.append("|");
              buf.append(endDate);
              buf.append("|");
              buf.append(processed);
              return buf.toString();
          }

       

      }

       

       

      I am trying to send this object to a server side service as follows:

       

      final QueryMessage msg = ErrorUtils.makeQueryMessage(searchForm);
                  MessageBuilder.createMessage().toSubject(ErrorEndPoints.ErrorService.getName())
                          .with(MessageParts.ReplyTo, ErrorEndPoints.ErrorConsumer.getName()).with(ErrorProtocols.QueryMessage, msg)
                          .errorsHandledBy(errorHandler).sendNowWith(bus);

       

       

      When the message gets to the server it looks like it is only partially unmarshalled. The boolean feild is correct, as is the first String attribute (startDate). However, endDate is always null? I checked on the client side to make sure the object had all the data. Is it possible to send an object this way from client to server?

       

      Thx

        • 1. Re: Serilaization Question
          cbrock

          What version are you using? This may be a known bug that we've fixed already.  Have you tested it against our SVN trunk?

          • 2. Re: Serilaization Question
            jdestef

            Hi,

             

            Yes, this is from a fresh update for today. Also, I just noticed something else. I an sending a message to the server like this:

             

            MessageBuilder.createMessage().toSubject(ErrorEndPoints.ErrorDetailService.getName())
                            .with(MessageParts.ReplyTo, ErrorEndPoints.ErrorDetailConsumer.getName())
                            .with(ErrorProtocols.Edit, edit)
                            .with(ErrorProtocols.ErrorId, "" + currentErrorDTO.getErrorId())
                            .errorsHandledBy(errorHandler).sendNowWith(bus);

             

             

            The message recieved by the server only has the following parts:

             

            Edit=ErrorDetailConsumer, ToSubject=ErrorDetailService, ErrorId=2723

             

            The Edit parameter should be a boolean value. This did work last Thursday with the trunk.

             

            Any ideas?

             

             

            Thx

            • 3. Re: Serilaization Question
              cbrock

              Okay.  I'll look into this, further.

              • 4. Re: Serilaization Question
                jdestef

                Hi,

                 

                I'm noticing this happening consistenly in my code. Serilaization from the client to the server is not working as it did last week. However, from the server to the client is working fine.

                 

                Thanks for looking into this.

                • 5. Re: Serilaization Question
                  cbrock

                  Just to update you, I have been able to reproduce the problem and I hope to have a fix soon.

                  • 6. Re: Serilaization Question
                    cbrock

                    This should be fixed now.

                    • 7. Re: Serilaization Question
                      jdestef

                      Yes,

                       

                      It works.

                       

                      Thx