2

我正在开发 gwt2.4、jre7 和 GAE 1.7.3。在开发模式下我的代码工作正常,但是当我在应用引擎上上传我的应用程序时,我收到以下错误

 java.lang.ExceptionInInitializerError
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:277)
at com.wa.gwtamazon.server.UploadServiceImpl.amazonConfig(UploadServiceImpl.java:124)
at com.wa.gwtamazon.server.UploadServiceImpl.doPost(UploadServiceImpl.java:76)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:100)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:266)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:447)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:454)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:461)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:703)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:338)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:330)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:458)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:679)


Nested in java.lang.ExceptionInInitializerError:
java.lang.NullPointerException
at com.amazonaws.util.VersionInfoUtils.initializeUserAgent(VersionInfoUtils.java:124)
at com.amazonaws.util.VersionInfoUtils.getUserAgent(VersionInfoUtils.java:86)
at com.amazonaws.ClientConfiguration.<clinit>(ClientConfiguration.java:31)
at com.amazonaws.services.s3.AmazonS3Client.<init>(AmazonS3Client.java:277)
at com.wa.gwtamazon.server.AmazonService.uploadFileToAmazone(AmazonService.java:50)
at com.wa.gwtamazon.server.AmazonService.doPost(AmazonService.java:36)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:511)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1166)
at com.google.apphosting.utils.servlet.ParseBlobUploadFilter.doFilter(ParseBlobUploadFilter.java:100)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.runtime.jetty.SaveSessionFilter.doFilter(SaveSessionFilter.java:35)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at com.google.apphosting.utils.servlet.TransactionCleanupFilter.doFilter(TransactionCleanupFilter.java:43)
at org.mortbay.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1157)
at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:388)
at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:182)
at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:765)
at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:418)
at com.google.apphosting.runtime.jetty.AppVersionHandlerMap.handle(AppVersionHandlerMap.java:266)
at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
at org.mortbay.jetty.Server.handle(Server.java:326)
at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:542)
at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:923)
at com.google.apphosting.runtime.jetty.RpcRequestParser.parseAvailable(RpcRequestParser.java:76)
at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:404)
at com.google.apphosting.runtime.jetty.JettyServletEngineAdapter.serviceRequest(JettyServletEngineAdapter.java:146)
at com.google.apphosting.runtime.JavaRuntime$RequestRunnable.run(JavaRuntime.java:447)
at com.google.tracing.TraceContext$TraceContextRunnable.runInContext(TraceContext.java:454)
at com.google.tracing.TraceContext$TraceContextRunnable$1.run(TraceContext.java:461)
at com.google.tracing.TraceContext.runInContext(TraceContext.java:703)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContextNoUnref(TraceContext.java:338)
at com.google.tracing.TraceContext$AbstractTraceContextCallback.runInInheritedContext(TraceContext.java:330)
at com.google.tracing.TraceContext$TraceContextRunnable.run(TraceContext.java:458)
at com.google.apphosting.runtime.ThreadGroupPool$PoolEntry.run(ThreadGroupPool.java:251)
at java.lang.Thread.run(Thread.java:679)

我也在以下链接上找到了解决方案,但仍然没有用

http://code.google.com/p/googleappengine/issues/detail?id=8166

4

2 回答 2

3

//编辑:他将以下 XML 添加到他appengine-web.xml的工作中:

<system-properties> 
    <property name="java.util.logging.config.file" value="WEB-INF/logging.properties"/> 
    <property name="os.name" value="Linux" /> 
    <property name="os.version" value="6.1" /> 
    <property name="java.vm.name" value="Java HotSpot(TM) Client VM" /> 
    <property name="java.vm.version" value="23.5-b02" /> 
    <property name="user.language" value="en" /> 
    <property name="user.region" value="us" /> 
</system-properties>

由于 Google App Engine 的限制(没有线程,...),您不能使用 Amazon Libs。但是很少有解决方案可以帮助您:

[1] http://socialappdev.com/using-amazon-s3-with-google-app-engine-02-2011

[2] https://github.com/handstandtech/s3-simple-appengine

为什么不将Google Cloud StorageGAE Java SDK一起使用?GCS API 与 S3 API 几乎相同。

于 2013-02-06T12:09:36.503 回答
2

有时应用引擎没有获得 os.name、os.version、java.vm.name 等的值,所以我们必须在 appengine-web.xml 文件中手动指定

<system-properties>

<property name="os.name" value="Linux" />
<property name="os.version" value="6.1" />

<property name="java.vm.name" value="Java HotSpot(TM) Client VM" />
<property name="java.vm.version" value="23.5-b02" />

<property name="user.language" value="en" />
<property name="user.region" value="us" />

于 2013-02-09T10:49:07.030 回答