What is the reason why the onFailure(...) method is called when I do a async method call? The console output says always "ERROR!!!!".
MyEntryPoint.java:
package com.example.smartgwtproject.client;
import com.google.gwt.core.client.EntryPoint;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
//...
public class MyEntryPoint implements EntryPoint {
public void onModuleLoad() {
GreetingServiceAsync service = (GreetingServiceAsync) GWT.create(GreetingService.class);
//...
service.getFileList(new AsyncCallback<List<String>>(){
@Override
public void onFailure(Throwable caught) {
System.out.println("ERROR!!!!");
}
@Override
public void onSuccess(List<String> result) {
System.out.println("OK!");
}
});
//...
}
}
.gwt.xml:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.5.1//EN"
"http://google-web-toolkit.googlecode.com/svn/tags/2.5.1/distro-source/core/src/gwt-module.dtd">
<module rename-to='dlaconfigcenter'>
<inherits name='com.google.gwt.user.User'/>
<inherits name="com.smartgwt.SmartGwt"/>
<entry-point class='com.example.smartgwtproject.client.MyEntryPoint'/>
<source path='client' />
<source path='shared' >
<include name="GreetingServiceImpl.java"/>
</source>
</module>
GreetingService:
package com.example.smartgwtproject.client;
//...
@RemoteServiceRelativePath("greet")
public interface GreetingService extends RemoteService {
List<String> getFileList();
}
GreetingServiceAsync:
//...
public interface GreetingServiceAsync {
void getFileList(AsyncCallback<List<String>> callback);
}