Hi, I'm using NetBeans 6.1 and GWT 1.5.0.
Whenever I try to make an asynchronous call to a service, I get the
message: - "com.google.gwt.user.client.rpc.StatusCodeException: The
call failed on the server; see server log for details"
In a desperate attempt to solve this issue, I even created a new
GWTService class and tested the original "myMethod" to see if there
was a problem in the lib. Well, it works. Then I pasted my code inside
the new function, and again it stopped working.
I have included the code below. Plz show me the right way ASAP. Thanks
in advance.
........................................................................................................................
code
........................................................................................................................
------------------------------------------------------
RegisterCabinetService
------------------------------------------------------
public interface RegisterCabinetService extends RemoteService{
public String getCabinets(String jtsIp, Integer jtsPort);
}
------------------------------------------------------
RegisterCabinetServiceAsync
------------------------------------------------------
public interface RegisterCabinetServiceAsync {
public void getCabinets(java.lang.String jtsIp, Integer jtsPort,
AsyncCallback asyncCallback);
}
------------------------------------------------------
RegisterCabinetServiceImpl
------------------------------------------------------
public class RegisterCabinetServiceImpl extends RemoteServiceServlet
implements
RegisterCabinetService {
public String getCabinets(String jtsIp, Integer jtsPort) {
//////////////////////// Some \\\\\\\\\\\\\\\\\\\\\\\\\\\\\
\\\\\\\\\\\\\\\\\\\\\\\\ Logic /////////////////////////////
return ret.toString();
}
}
------------------------------------------------------
Usage
------------------------------------------------------
... As a separate function inside current class :
public static RegisterCabinetServiceAsync 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.
RegisterCabinetServiceAsync service =
(RegisterCabinetServiceAsync)
GWT.create(RegisterCabinetService.class);
// Specify the URL at which our service implementation is
running.
// Note that the target URL must reside on the same domain and
port from
// which the host page was served.
//
ServiceDefTarget endpoint = (ServiceDefTarget) service;
String moduleRelativeURL = GWT.getModuleBaseURL() +
"registercabinetservice";
endpoint.setServiceEntryPoint(moduleRelativeURL);
return service;
}
... inside constructor of the current class
callBack = new AsyncCallback() {
public void onFailure(Throwable arg0) {
com.google.gwt.user.client.Window.alert(arg0.toString());
com.google.gwt.user.client.Window.alert("Could not
connect to server. Please try again.");
}
public void onSuccess(Object arg0) {
// whatever Actions
}
};
... In onClick event of a button :
getService().getCabinets(jtsIpTxt.getText(),
Integer.valueOf(jtsPortTxt.getText()), callBack);
...
The only server log I could find was:
"<ServiceName>.rpc.log" inside my "build\web folder\<package-name>-
aux" folder
The contents are as follows:
////////////////////////// Log \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
Reachable types computed on: Thu Aug 28 17:41:05 GMT+05:30 2008
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException
Serialization status
Instantiable
Path
Started from
'com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException'
java.lang.Exception
Serialization status
Field serializable
Path
Started from
'com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException'
java.lang.Integer
Serialization status
Instantiable
Path
Started from 'java.lang.Integer'
java.lang.Number
Serialization status
Field serializable
Path
Started from 'java.lang.Integer'
java.lang.Object
Serialization status
Not serializable
Path
Started from 'java.lang.String'
java.lang.RuntimeException
Serialization status
Field serializable
Path
Started from
'com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException'
java.lang.String
Serialization status
Instantiable
Path
Started from 'java.lang.String'
java.lang.Throwable
Serialization status
Field serializable
Path
Started from
'com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException'
\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ Log Ends
Here ////////////////////////////
Please offer some suggestions. Thanks a lot.
Regards,
Shishir
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---