title: What does this serialization error mean, and how can I prevent it?
body: <p>I am coding in GWT 2.3 using Eclipse. While I have had coding experience, it has been limited to client-side. My current project involves creating a mapping program, which takes a list of points from an Excel sheet and places them on a predefined image. Now, I have my servlet and my client code connected, and I already have some idea how to read the Excel file.</p>
  
  <p><strong>My current problem:</strong> I get the following error when I load my application on Firefox using Development Mode: </p>
  
  <blockquote>
    <p>Something other than an <code>int</code> was returned from JSNI method '<code>@com.google.gwt.user.client.rpc.impl.ClientSerializationStreamReader::readInt()</code>': JS value of type undefined, expected <code>int</code></p>
  </blockquote>
  
  <p>Development Mode's console doesn't give me any errors when I run, those it does tell me there is a [WARN] with two things I'm not using (images which I misnamed, but do not load ever).</p>
  
  <p>Currently, my code is as follows:</p>
  
  <p>In my <code>Floor.java</code> client side code:</p>
  
  <blockquote>
  <pre><code> MyServiceAsync service = (MyServiceAsync) GWT.create(MyService.class);
      AsyncCallback&lt;String&gt; callback = new AsyncCallback&lt;String&gt;() {
  </code></pre>
  </blockquote>
  
  <pre><code>        public void onFailure(Throwable caught) {
              printerModel.setText("FAILED");
              String details = caught.getMessage();
              printerModel.setText(details);
          }
          @Override
          public void onSuccess(String result) {
              //I purposefully have this as an empty method so I could figure out the error
  
          }
      };
  
      service.readFile("PrinterList.xls", callback);
  </code></pre>
  
  <p>In my <code>MyService.java</code>:</p>
  
  <pre><code>&gt;public String readFile(String s);
  
  In `MyServiceImpl.java`:
  
  &gt;public String readFile(String s) {
  
          // TODO Auto-generated method stub
          try {
             } catch (Exception e) {
          }
          return "foo";
      }
  </code></pre>
  
  <p>My <code>AsyncCallback</code> type is <code>String</code>, which seems to be causing the error. The method my client code calls returns a single String at this point, "fubar" (for simplicity). I thought that Strings were automatically <a href="http://code.google.com/webtoolkit/doc/1.6/tutorial/RPC.html#serialize" rel="nofollow">serializable</a>, but I am not sure. So, how do I get this error to go away? And how do I make the server code serialized?</p>