Ali*_*aka 7 google-app-engine amazon-s3 amazon-web-services
我正在尝试从Google应用引擎访问S3存储桶,并且我在尝试初始化AmazonS3Client客户端的受限类时遇到异常.请参阅下面的代码和例外.
知道如何使这项工作?
码:
AmazonS3 s3 = new AmazonS3Client(new ClasspathPropertiesFileCredentialsProvider());
Run Code Online (Sandbox Code Playgroud)
例外:
Caused by: java.lang.NoClassDefFoundError: javax.management.MBeanServerFactory is a restricted class. Please see the Google App Engine developer's guide for more details.
at com.google.appengine.tools.development.agent.runtime.Runtime.reject(Runtime.java:51)
at com.amazonaws.jmx.MBeans.getMBeanServer(MBeans.java:111)
at com.amazonaws.jmx.MBeans.registerMBean(MBeans.java:50)
at com.amazonaws.jmx.SdkMBeanRegistrySupport.registerMetricAdminMBean(SdkMBeanRegistrySupport.java:27)
at com.amazonaws.metrics.AwsSdkMetrics.registerMetricAdminMBean(AwsSdkMetrics.java:330)
at com.amazonaws.metrics.AwsSdkMetrics.<clinit>(AwsSdkMetrics.java:308)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:188)
at com.google.appengine.tools.development.agent.runtime.RuntimeHelper.checkRestricted(RuntimeHelper.java:70)
at com.google.appengine.tools.development.agent.runtime.Runtime.checkRestricted(Runtime.java:64)
at com.amazonaws.services.s3.AmazonS3Client.<clinit>(AmazonS3Client.java:231)
Run Code Online (Sandbox Code Playgroud)
您遇到的错误意味着 App Engine 中不允许使用 AWS 开发工具包使用的类(由于某些不明原因)。
即使您设法绕过此错误,AWS 开发工具包也无法在 GAE 上运行,因为它使用 HttpClient 而不是 URLFetch。
欲了解更多信息,您可以阅读:
| 归档时间: |
|
| 查看次数: |
667 次 |
| 最近记录: |