Ravi Kumar
Ravi Kumar

Reputation: 98

GWT.log throwing error

I am new to GWT and trying to build a sample application. Here is my EntryPoint class.

package com.google.gwt.sample.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;

public class TalkToServer implements EntryPoint {

  public TalkToServer() {}

  public void onModuleLoad() {
    HTTPRequest.asyncGet
      (GWT.getHostPageBaseURL() + "person.xml",
       new ResponseTextHandler() {
         public void onCompletion(String responseText) {
           GWT.log("some log message");
         }
       });
  }
}

The error here is -

log(java.lang.String,java.lang.Throwable) in com.google.gwt.core.client.GWT cannot be applied to (java.lang.String)  

I have checked gwt's javadoc and found that log can take string as argument. I am not able to figure out why log is throwing this error. Please let me know if I am missing something.

Upvotes: 2

Views: 64

Answers (1)

Sandhu Santhakumar
Sandhu Santhakumar

Reputation: 1688

Try using

GWT.log("some log message", new Throwable())

Upvotes: 1

Related Questions