Hi,

do you have RemoteServiceCallAsync.java in your project?


On 1 Feb., 05:48, Tan Jia Bao <jayjia...@gmail.com> wrote:
> Hi, Previously I had posted about retrieving ArrayList using RPC Service but
> I've met with some errors and I decided to take it step by step and then
> slowly build my application but currently I'm having an error using even
> most basic RPC Service. Can anyone help? I'm  getting the following error
> from *NETBEANS 6.8.*
> **
> Thanks in advance
>
> Scanning for additional dependencies:
> file:/C:/Users/Jiabao/Desktop/Assignment/Jan%2025%202010/SnagIT/src/java/or 
> g/snagit/client/RemoteServiceMain.java
>       Computing all possible rebind results for
> 'org.snagit.client.RemoteServiceCall'
>          Rebinding org.snagit.client.RemoteServiceCall
>             Invoking <generate-with
> class='com.google.gwt.user.rebind.rpc.ServiceInterfaceProxyGenerator'/>
>                Generating client proxy for remote service interface
> 'org.snagit.client.RemoteServiceCall'
>                   [ERROR] Could not find an asynchronous version for the
> service interface org.snagit.client.RemoteServiceCall
>                   A valid definition for the asynchronous version of
> interface 'org.snagit.client.RemoteServiceCall' would be:
>                      [ERROR]
> package org.snagit.client;
> public interface RemoteServiceCallAsync {
>         void retrieveProducts(java.lang.String s,
> com.google.gwt.user.client.rpc.AsyncCallback<java.lang.String> arg2);}
>
>    [ERROR] Errors in
> 'file:/C:/Users/Jiabao/Desktop/Assignment/Jan%2025%202010/SnagIT/src/java/o 
> rg/snagit/client/RemoteServiceMain.java'
>       [ERROR] Line 67:  Failed to resolve
> 'org.snagit.client.RemoteServiceCall' via deferred binding
>    [ERROR] Cannot proceed due to previous errors
> C:\Users\Jiabao\Desktop\Assignment\Jan 25
> 2010\SnagIT\nbproject\build-gwt.xml:88: The following error occurred while
> executing this line:
> C:\Users\Jiabao\Desktop\Assignment\Jan 25
> 2010\SnagIT\nbproject\build-gwt.xml:140: Java returned: 1
> BUILD FAILED (total time: 9 seconds)
>
> Here are my code snippets.
>
> public class MainEntryPoint implements EntryPoint {
>     /**
>      * Creates a new instance of MainEntryPoint
>      */
>     private ArrayList itemList;
>     public MainEntryPoint() {
>     }
>     /**
>      * The entry point method, called automatically by loading a module
>      * that declares an implementing class as an entry-point
>      */
>     public void onModuleLoad() {
>         RootPanel rootPanel = RootPanel.get();
>         AbsolutePanel productPanel = new AbsolutePanel();
>         productPanel.setWidth("880px");
>         Button btn = new Button();
>         btn.setText("Hello");
>         productPanel.add(btn);
>         RemoteServiceMain createBtn = new RemoteServiceMain();
>         productPanel.add(createBtn);
>         rootPanel.add(productPanel);
>     }
>
> }
>
> /////////////////////////////////////////////////////////////////////////// 
> ///////////////////////////////////////////////////////////////
>
> public class RemoteServiceMain extends VerticalPanel {
>
>     PushButton pushButton = new PushButton();
>     public RemoteServiceMain() {
>         pushButton.setText("Click Me!");
>         add(pushButton);
>         final AsyncCallback<String> callback = new AsyncCallback<String>() {
>             public void onSuccess(String result) {
>                 System.out.println("Works");
>             }
>             public void onFailure(Throwable caught) {
>                 System.out.println("Communication failed");
>             }
>         };
>         pushButton.addClickHandler(new ClickHandler() {
>             public void onClick(ClickEvent event) {
>                 ArrayList list = new ArrayList();
>                 getService().retrieveProducts("electronics", callback);
>             }
>         });
>     }
>     public static RemoteServiceController getService() {
>         // Create the client proxy. Note that although you are creating the
>         // service interface proper, you cast the result to the asynchronous
>         // version of the interface. The cast is always safe because the
>         // generated proxy implements the asynchronous interface
> automatically.
>         return GWT.create(RemoteServiceCall.class);
>     }
>
> }
>
> /////////////////////////////////////////////////////////////////////////// 
> ///////////////////////////////////////////////////////////////
>
> @RemoteServiceRelativePath("remoteservicecall")
> public interface RemoteServiceCall extends RemoteService {
>     public String retrieveProducts(String s);
>
> }
>
> /////////////////////////////////////////////////////////////////////////// 
> ///////////////////////////////////////////////////////////////
>
> public interface RemoteServiceController {
>     public void retrieveProducts(String s, AsyncCallback<String> callback);
>
> }
>
> /////////////////////////////////////////////////////////////////////////// 
> ///////////////////////////////////////////////////////////////
>
> public class RemoteServiceServer extends RemoteServiceServlet implements
> RemoteServiceCall {
>     public String retrieveProducts(String s) {
>         return s + " This works!";
>     }
>
>
>
> }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-tool...@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to