Take the 2-minute tour ×

I have developed a GWT application and also installed a Apache Solr Server on the localhost machine.

The Solr is working fine and the queries are returning the desired results.

Now for embedding the results in my GWT application I am sending a http request using GWT's RequestBuilder to the Solr server.

The query is reaching on the Solr as I can view it in the command prompt.

On the GWT side the request is successful as my onResponseRecieved() is called. But the size of the response is 0 and also the status code is 0.

I am unable to find where is the problem.

Also, if there is a Same Origin Policy then the onError() method should be run but it isn't.

Following is my sending and handling code

String url = "http://localhost:8983/solr/select/?q=bname:"+whatBox.getText()+"&version=2.2&start=0&rows=10&indent=on";
        RequestBuilder rb = new RequestBuilder(RequestBuilder.POST, URL.encode(url));
            Request req = rb.sendRequest(null, new RequestCallback() {

                public void onResponseReceived(Request request, Response response) {
                    System.out.println("in res");
                    RootPanel.get("content").add(new Label(response.getText()));    

                public void onError(Request request, Throwable exception) {
                    // TODO Auto-generated method stub

        }catch(RequestException e){

Any Help will be appreciated!

share|improve this question

1 Answer 1

I think you are violating SOP rules. To avoid them, I would recommend you using JsonpRequestBuilder not using RequestBuilders. And also take a look a very useful community wiki: Ways to circumvent the same-origin policy and How the Same Origin Policy does affect GWT?

share|improve this answer

Your Answer


