【发布时间】:2016-12-21 06:30:29
【问题描述】:
我正在使用 localhost:8080/_ah/api/explorer 谷歌探索: 我不断得到
{
"error": {
"message": "com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException: Can not construct instance of javax.servlet.http.HttpServletResponse, problem: abstract types can only be instantiated with additional type information\n at [Source: N/A; line: -1, column: -1]",
"code": 400,
"errors": [
{
"domain": "global",
"reason": "badRequest",
"message": "com.google.appengine.repackaged.org.codehaus.jackson.map.JsonMappingException: Can not construct instance of javax.servlet.http.HttpServletResponse, problem: abstract types can only be instantiated with additional type information\n at [Source: N/A; line: -1, column: -1]"
}
]
}
我的 Google SPI 代码是:
@ApiMethod(name = "findBillImage", httpMethod = ApiMethod.HttpMethod.GET )
public void findImage(HttpServletResponse httpServletResponse , @Named("blobkey") String blobKeyValue) throws IOException {
BlobKey blobKey = new BlobKey( blobKeyValue );
BlobstoreService blobstoreService = BlobstoreServiceFactory.getBlobstoreService();
blobstoreService.serve(blobKey, httpServletResponse);
}
每当我尝试向 HttpServletResponse 写入任何内容时,我都会收到此错误。我不知道为什么我无法写入 httpServletResponse
【问题讨论】:
标签: java google-app-engine blobstore