嗨,这个错误无法追踪 - 需要帮助。
我正在使用谷歌应用引擎并编写 rpc servlet,如下所示
<!-- Servlets -->
<servlet>
<servlet-name>RealEstate_Service</servlet-name>
<servlet-class>com.app.realestate.navi.client.RealEstateService</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>RealEstate_Service</servlet-name>
<url-pattern>/real_estate/realEstateService/</url-pattern>
</servlet-mapping>
房地产服务
@RemoteServiceRelativePath("realEstateService")
public interface RealEstateService extends RemoteService {
ArrayList<ProjectDetails> getProjectDetails();
}
public interface RealEstateServiceAsync {
public void getProjectDetails(AsyncCallback<ArrayList<ProjectDetails>> callback);
}
RealEstateServiceImpl
@SuppressWarnings("serial")
public class RealEstateServiceImpl extends RemoteServiceServlet implements RealEstateService{
private static final String[] contactsFirstNameData = new String[] {
"Hollie", "Emerson", "Healy", "Brigitte", "Elba", "Claudio",
"Dena", "Christina", "Gail", "Orville", "Rae", "Mildred",
"Candice", "Louise", "Emilio", "Geneva", "Heriberto", "Bulrush",
"Abigail", "Chad", "Terry", "Bell"};
private final String[] contactsLastNameData = new String[] {
"Voss", "Milton", "Colette", "Cobb", "Lockhart", "Engle",
"Pacheco", "Blake", "Horton", "Daniel", "Childers", "Starnes",
"Carson", "Kelchner", "Hutchinson", "Underwood", "Rush", "Bouchard",
"Louis", "Andrews", "English", "Snedden"};
private final String[] contactsEmailData = new String[] {
"mark@example.com", "hollie@example.com", "boticario@example.com",
"emerson@example.com", "healy@example.com", "brigitte@example.com",
"elba@example.com", "claudio@example.com", "dena@example.com",
"brasilsp@example.com", "parker@example.com", "derbvktqsr@example.com",
"qetlyxxogg@example.com", "antenas_sul@example.com",
"cblake@example.com", "gailh@example.com", "orville@example.com",
"post_master@example.com", "rchilders@example.com", "buster@example.com",
"user31065@example.com", "ftsgeolbx@example.com"};
private final HashMap<String, Project> projects = new HashMap<String, Project>();
public RealEstateServiceImpl() {
initProjects();
}
private void initProjects() {
// TODO: Create a real UID for each contact
//
for (int i = 0; i < contactsFirstNameData.length && i < contactsLastNameData.length && i < contactsEmailData.length; ++i) {
Project project = new Project(String.valueOf(i), contactsFirstNameData[i], contactsLastNameData[i], contactsEmailData[i]);
projects.put(project.getId(), project);
}
}
public Project addProject(Project project) {
project.setId(String.valueOf(projects.size()));
projects.put(project.getId(), project);
return project;
}
public Project updateProject(Project project) {
projects.remove(project.getId());
projects.put(project.getId(), project);
return project;
}
public Boolean deleteProject(String id) {
projects.remove(id);
return true;
}
public ArrayList<ProjectDetails> deleteProjects(ArrayList<String> ids) {
for (int i = 0; i < ids.size(); ++i) {
deleteProject(ids.get(i));
}
return getProjectDetails();
}
public ArrayList<ProjectDetails> getProjectDetails() {
ArrayList<ProjectDetails> projectDetails = new ArrayList<ProjectDetails>();
Iterator<String> it = projects.keySet().iterator();
while(it.hasNext()) {
Project contact = projects.get(it.next());
projectDetails.add(contact.getLightWeightContact());
}
return projectDetails;
}
public Project getProject(String id) {
return projects.get(id);
}
}
RPC 调用出现以下错误
Apr 13, 2013 4:19:02 AM com.google.appengine.tools.development.ApiProxyLocalImpl log
SEVERE: javax.servlet.ServletContext log: unavailable
javax.servlet.UnavailableException: Servlet interface com.app.realestate.navi.client.RealEstateService is not a javax.servlet.Servlet
at org.mortbay.jetty.servlet.ServletHolder.checkServletType(ServletHolder.java:362)
at org.mortbay.jetty.servlet.ServletHolder.doStart(ServletHolder.java:243)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.servlet.ServletHandler.initialize(ServletHandler.java:685)
at org.mortbay.jetty.servlet.Context.startContext(Context.java:140)
at org.mortbay.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1250)
at org.mortbay.jetty.handler.ContextHandler.doStart(ContextHandler.java:517)
at org.mortbay.jetty.webapp.WebAppContext.doStart(WebAppContext.java:467)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.handler.HandlerWrapper.doStart(HandlerWrapper.java:130)
at org.mortbay.jetty.Server.doStart(Server.java:224)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.google.appengine.tools.development.JettyContainerService.startContainer(JettyContainerService.java:228)
at com.google.appengine.tools.development.AbstractContainerService.startup(AbstractContainerService.java:255)
at com.google.appengine.tools.development.AbstractServer.startup(AbstractServer.java:79)
at com.google.appengine.tools.development.DevAppServerImpl$Servers.startup(DevAppServerImpl.java:451)
at com.google.appengine.tools.development.DevAppServerImpl.start(DevAppServerImpl.java:198)
at com.google.appengine.tools.development.gwt.AppEngineLauncher.start(AppEngineLauncher.java:97)
at com.google.gwt.dev.DevMode.doStartUpServer(DevMode.java:509)
at com.google.gwt.dev.DevModeBase.startUp(DevModeBase.java:1093)
at com.google.gwt.dev.DevModeBase.run(DevModeBase.java:836)
at com.google.gwt.dev.DevMode.main(DevMode.java:311)