gpt4 book ai didi

java - Google App Engine/Java : blobstore. 服务返回 500 服务器错误

转载 作者:行者123 更新时间:2023-11-29 09:12:12 24 4
gpt4 key购买 nike

我在 Google App Engine 上有一个 Java 应用程序,它带有一个从 Google Cloud Storage 加载大图像的 servlet。这段代码确实有效(就像......昨天)并且由于某种原因它不再有效,但我没有编辑它!在刷新几次时,它曾经返回大约一半它应该加载的图像,然后停止。

这是 servlet:

@SuppressWarnings("serial")
public class SomeServlet extends HttpServlet
{
public void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException
{
BlobstoreService blobstore = BlobstoreServiceFactory.getBlobstoreService();
String file = req.getParameter("file");
String folder = req.getParameter("folder");

BlobKey blobkey = blobstore.createGsBlobKey("/gs/bucket/" + folder + "/" + file + ".jpg");

blobstore.serve(blobkey, resp);
}
}

这是日志的内容,没有任何警告/错误/严重标志:

2012-07-26 19:44:54.635 /servlet?folder=SomeFolder&file=SomeFile 200 96ms 0kb Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20100101 Firefox/14.0.1 [26/Jul/2012:10:44:54 -0700] "GET /servlet?folder=SomeFolder&file=SomeFile HTTP/1.1" 200 334 - "Mozilla/5.0 (Windows NT 5.1; rv:14.0) Gecko/20100101 Firefox/14.0.1" "myapp.appspot.com" ms=97 cpu_ms=103 api_cpu_ms=33 cpm_usd=0.002957 instance=00c61b117cef9993f79be3c568c0cbda0f14

这是http://myapp.appspot.com/servlet?folder=SomeFolder&file=SomeFile显示:

Error: Server Error The server encountered an error and could not complete your request. If the problem persists, please report your problem and mention this error message and the query that caused it.

有什么想法吗?

谢谢!

最佳答案

我建议使用以下方法来找出确切的问题:

  • 在您的 doGet 和 catch 异常处理程序中放置一个 try/catch,记录错误消息或将其写在屏幕上。

关于java - Google App Engine/Java : blobstore. 服务返回 500 服务器错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11675294/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com