title: GWT: "unrecognized calling format": What does it mean?
body: <pre><code>public void query(String sql, QueryResult queryResult) {
      q = queryResult;
      realQuery(sql, conString);
  }
  
  public static native void realQuery(String sql, String conString) /*-{
      $wnd.pg.connect(conString, function(err, client) {
          client.query(sql, function(err, result) {
              console.log(result.rows);
              var code = "@db.tud.bp.werkstatt.client.PgClient::result(Ljava/lang/String;)(" + '"' + JSON.stringify(result.rows).replace('"','\\"') + '"' + ");";
              console.log(code);
              eval(code);
          });
      });
  }-*/;
  </code></pre>
  
  <p>I get this error:</p>
  
  <pre><code>com.google.gwt.event.shared.UmbrellaException: Exception caught: (Error) 
  @de.tud.bp.werkstatt.client.PgClient::realQuery(Ljava/lang/String;Ljava/lang/String;)
  ([string: 'SELECT age FROM person WHERE name='Ayeb'', string: '/rest/query']): 
    unrecognized calling format
      at com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:129)
  </code></pre>
  
  <p>What does "unrecognized calling format" mean, and why do I not get any Google results when searching for it?</p>
  
  <p>I suspect that I am calling the JSNI function in a wrong way in line 3. But I am AFAIK following all rules specified in the docs <a href="https://developers.google.com/web-toolkit/doc/latest/DevGuideCodingBasicsJSNI#writing" rel="nofollow">here</a>.</p>
  
  <p><strong>EDIT</strong>:</p>
  
  <p>This works:</p>
  
  <pre><code>public static native void realQuery(JavaScriptObject parsed) /*-{
      var sql = parsed[0];
      var conString = parsed[1];
      $wnd.pg.connect(conString, function(err, client) {
      });
  }-*/;
  </code></pre>
  
  <p>This doesn't:</p>
  
  <pre><code>public static native void realQuery(JavaScriptObject parsed) /*-{
      var sql = parsed[0];
      var conString = parsed[1];
      $wnd.pg.connect(conString, function(err, client) {
          client.query(sql, function(err, result) {
              console.log(result.rows);
          });
      });
  }-*/;
  </code></pre>