У меня есть проект веб-приложения с вызовом RPC.
Один RPC-асинхронный работает нормально. но другой выдает ошибку
Mar 21, 2012 1:34:51 PM com.google.appengine.tools.development.ApiProxyLocalImpl log
SEVERE: javax.servlet.ServletContext log: ObjectStore: An IncompatibleRemoteServiceException was thrown while processing this call.
com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException: This application is out of date, please click the refresh button on your browser. ( Blocked attempt to access interface 'com.client.RepositoryInterface', which is not implemented by 'com.server.ObjectStore'; this is either misconfiguration or a hack attempt )
at com.google.gwt.user.server.rpc.RPC.decodeRequest(RPC.java:252)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:206)
at com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
Рабочий RPC
public interface ConnectionInterface extends RemoteService{
String connection(String[] authentication);
}
public interface ConnectionInterfaceAsync {
void connection(String[] authentication, AsyncCallback<String> callback);
}
открытый класс ConnectionService реализует ConnectionInterfaceAsync {
ConnectionInterfaceAsync service = (ConnectionInterfaceAsync)GWT.create(ConnectionInterface.class);
ServiceDefTarget endpoint = (ServiceDefTarget) service;
public ConnectionService() {
endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "rpc");
}
public void connectionCMIS(String[] authentication,
AsyncCallback<String> callbackConnection) {
service.connectionCMIS(authentication, callbackConnection);
}
// Звонок клиента
public class Login extends Composite {
private ConnectionService connectionService = new ConnectionService();
// more code
public void onClick(ClickEvent event) {
AsyncCallback<String> callbackConnection = new AsyncCallback<String>() {
public void onSuccess(String result) {
// print Succuss
}
}
connectionService.connection(authentication, callbackConnection );
}
}
} * * тысяча двадцать-один
Не работает RPC
public interface RepositoryInterface extends RemoteService {
public FolderCollection getRepositories();
}
public interface RepositoryInterfaceAsync {
void getRepositories(AsyncCallback<FolderCollection> repositoryCallback);
}
public class RepositoryService implements RepositoryInterfaceAsync{
RepositoryInterfaceAsync async = (RepositoryInterfaceAsync)GWT.create(RepositoryInterface.class);
ServiceDefTarget endpoint = (ServiceDefTarget) async;
public CmisRepositoryService() {
endpoint.setServiceEntryPoint(GWT.getModuleBaseURL() + "repository");
}
public void getRepositories(
AsyncCallback<FolderCollection> repositoryCallback) {
async.getRepositories(repositoryCallback);
}
}
звонок клиента
public class Workplace {
private RepositoryService service = new RepositoryService();
// some more code
void doRepo(){
AsyncCallback<FolderCollection> repositoryCallback = new AsyncCallback<FolderCollection>() {
public void onSuccess(FolderCollection result) {
}
public void onFailure(Throwable caught) {
}
};
service.getRepositories(repositoryCallback);
}
}
XML-код
<servlet>
<servlet-name>ConnectionServlet</servlet-name>
<servlet-class>com.server.ConnectionServiceImpl</servlet-class>
</servlet>
<servlet>
<servlet-name>ObjectStore</servlet-name>
<servlet-class>com.server.ObjectStore</servlet-class>
<servlet-mapping>
<servlet-name>ConnectionServlet</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
<servlet-mapping>
<servlet-name>ObjectStore</servlet-name>
<url-pattern>/*</url-pattern>
</servlet-mapping>
Оба RPC спроектированы в одинаковом режиме, но все равно выдает ошибку.
Если кто-нибудь скажет мне, почему это поможет?
спасибо.