简体   繁体   English

Google应用中的RMI错误

[英]rmi error in google app

I dont get the error when I use the following line 使用以下行时我没有收到错误

    FileItemIterator it = servletFileUpload.getItemIterator(request);

I get it when I use following line 当我使用以下行时我明白了

    List fileItemsList = servletFileUpload.parseRequest(request);

How are they different and How is rmi related to servletFileUpload.parseRequest(request);? 它们有何不同?rmi与servletFileUpload.parseRequest(request);有何关系?

Error: Caused by: 错误:造成原因:

java.lang.NoClassDefFoundError: java.rmi.server.UID 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 org.apache.commons.fileupload.disk.DiskFileItem.(DiskFileItem.java:103)
    at org.apache.commons.fileupload.disk.DiskFileItemFactory.createItem(DiskFileItemFactory.java:196)
    at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:358)
    at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:126)
    at morefile.CopyOfUploadApp.doPost(CopyOfUploadApp.java:147)

Context: A file upload application using Apache commons lib on google apps. 上下文:一种在Google Apps上使用Apache commons lib的文件上传应用程序。

Commons FileUpload (1.2.1) is only semi-compatible with GAE. Commons FileUpload(1.2.1)仅与GAE半兼容。 Only streaming API is supported but not the traditional API beacuse a local filesystem is not made available by GAE. 仅支持流式API,而不支持传统API,因为GAE不提供本地文件系统。 In the stacktace, I see usage of DiskFileItem, which basically writes the uploaded file locally and deletes it later. 在堆栈中,我看到了DiskFileItem的用法,它基本上是在本地写入上载的文件,然后将其删除。

See the section under Apache Commons FileUpload at GAE and support for Java frameworks 请参阅GAE的 Apache Commons FileUpload下的部分以及对Java框架的支持

Here's the streaming API usage. 这是流API的用法。

The DiskFileItem class from the Commons FileUpload library uses java.rmi.server.UID internally and usage of this class is forbidden by the Google Apps runtime environment. Commons FileUpload库中的DiskFileItem类在内部使用java.rmi.server.UID,并且Google Apps运行时环境禁止使用此类。 Since DiskFileItem is caching the uploaded file on the server file system and disk access is forbidden by Google Apps anyway, removing the dependency on the RMI specific UID class won't solve your problem. 由于DiskFileItem在服务器文件系统上缓存上载的文件,并且Google Apps仍然禁止磁盘访问,因此删除对RMI特定的UID类的依赖将无法解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM