GWT序列化策略文件

时间:2015-01-15 11:10:46

标签: gwt-rpc

我有一个GWT2.6.1应用程序。我使用RPC调用。我定义了service,serviceAsync,serviceImpl。但我一直有以下错误:

INFO:javax.servlet.ServletContext log:logLevelServlet:错误:找不到序列化策略文件'/analytics/E4322B1E292CEFFC5E147EAE677D2BFF.gwt.rpc';你忘了把它包含在这个部署中吗?

com.google.appengine.tools.development.ApiProxyLocalImpl日志 信息:javax.servlet.ServletContext日志:logLevelServlet:错误:找不到序列化策略文件'/analytics/E4322B1E292CEFFC5E147EAE677D2BFF.gwt.rpc';你忘了把它包含在这个部署中吗?

com.google.appengine.tools.development.ApiProxyLocalImpl日志 INFO:javax.servlet.ServletContext log:logLevelServlet:从http://localhost:9876/policies/E4322B1E292CEFFC5E147EAE677D2BFF.gwt.rpc下载的序列化策略

EPARecord.java

public class EPARecord implements Serializable {
private static final long serialVersionUID = -6723643433565890894L;
private String timeStamp;
private String logLevel;
private String event;
private String comment;

public EPARecord(){}

public String getTimeStamp() {
    return timeStamp;
}

public void setTimeStamp(String timeStamp) {
    this.timeStamp = timeStamp;
}

public String getLogLevel() {
    return logLevel;
}

public void setLogLevel(String logLevel) {
    this.logLevel = logLevel;
}

public String getEvent() {
    return event;
}

public void setEvent(String event) {
    this.event = event;
}

public String getComment() {
    return comment;
}

public void setComment(String comment) {
    this.comment = comment;
}

}

LogLevelService.java

@RemoteServiceRelativePath("loglevel")
public interface LogLevelService extends RemoteService {
    EPARecord[] getEAPRecords(String level) throws IllegalArgumentException;
}

LogLevelServiceAysnc.java

public interface LogLevelServiceAsync {
void getEAPRecords(String level, AsyncCallback<EPARecord[]> callback) throws IllegalArgumentException;
}

我清除浏览器缓存,然后清除项目并重建它。它总是给出同样的错误。我认为EPARecord文件具有所有String属性,并且可以序列化。并且在远程接口中,它传输EPARecord的数组,没有可定制的可定制的实现,它应该没问题。

2 个答案:

答案 0 :(得分:1)

我遇到了一些问题。如果您将“name ='com.google.gwt.user.theme.clean.Clean'”代码行继承到* .gwt.xml中,则可以将其删除并再次运行您的应用文件。

答案 1 :(得分:1)

当我想用GAE应用程序连接到本地数据库时遇到了这个问题。当我在没有GAE的情况下重新创建我的应用程序时,问题就消失了。