0

I am new to GWT and I have no result from my web application.

when I tried debugging, I got an error like "source not found"

and here is the code written in all the project

<---------------------------------------------------------------------------------------->

EntryPoint Class

package body.test.combo.client;

import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
import com.google.gwt.user.client.ui.VerticalPanel;


public class Combo implements EntryPoint {


    private final FileReaderServiceAsync serviceAsync = GWT
            .create(FileReaderService.class);

    String content;

    /**
     * This is the entry point method.
     */
    public void onModuleLoad() {

    VerticalPanel vPanel = new VerticalPanel();
        serviceAsync.readMyFilePlease(new AsyncCallback<String>() {

            @Override
            public void onSuccess(String result) {
                content = result;

            }

            @Override
            public void onFailure(Throwable caught) {
                System.out.println("Tezak");

            }
        });

        Label lb = new Label(content);
        vPanel.add(lb);
        RootPanel.get().add(vPanel);
    }
}

<---------------------------------------------------------------------------------------->

Service Interface

package body.test.combo.client;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

@RemoteServiceRelativePath("readmeplease")
public interface FileReaderService extends RemoteService {
    String readMyFilePlease();
}

<---------------------------------------------------------------------------------------->

Service Async

package body.test.combo.client;

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

public interface FileReaderServiceAsync {
    void readMyFilePlease(AsyncCallback<String> callbackVariable);
}

<---------------------------------------------------------------------------------------->

Server Implementation class

package body.test.combo.server;

import com.google.gwt.user.server.rpc.RemoteServiceServlet;

import body.test.combo.client.FileReaderService;

public class FileReaderServiceImplementation extends RemoteServiceServlet implements FileReaderService {

    @Override
    public String readMyFilePlease() {
        String allContent = "ezayak yad ya sayed";
        return allContent;
    }

}

<---------------------------------------------------------------------------------------->

Web.xml

<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://java.sun.com/xml/ns/javaee 
              http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
         version="2.5"
         xmlns="http://java.sun.com/xml/ns/javaee">

  <!-- Servlets -->
  <servlet>
    <servlet-name>readMyFilePlease</servlet-name>
    <servlet-class>body.test.combo.server.FileReaderServiceImplementation</servlet-class>
  </servlet>

  <servlet-mapping>
    <servlet-name>readMyFilePlease</servlet-name>
    <url-pattern>/combo/readmeplease</url-pattern>
  </servlet-mapping>

  <!-- Default page to serve -->
  <welcome-file-list>
    <welcome-file>Combo.html</welcome-file>
  </welcome-file-list>

</web-app>

Project name is 'combo'.

Swapnil
  • 8,201
  • 4
  • 38
  • 57
Body
  • 57
  • 1
  • 1
  • 8

1 Answers1

0

Does your project xml file (Combo.gwt.xml) contain the following:

<module rename-to='combo'>

You may also want to try some of the suggestions from this post.

it would be very useful for you to post that project xml file as well as the error itself.

Community
  • 1
  • 1
enrybo
  • 1,787
  • 1
  • 12
  • 20