问题描述
我在使用以下行时没有收到错误
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);
它们有何不同以及 rmi 与 servletFileUpload.parseRequest(request); 有何关系?
How are they different and How is rmi related to servletFileUpload.parseRequest(request);?
错误:原因:
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)
上下文:在谷歌应用程序上使用 Apache 公共库的文件上传应用程序.
Context:A file upload application using Apache commons lib on google apps.
推荐答案
Commons FileUpload (1.2.1) 仅与 GAE 半兼容.仅支持流 API,但不支持传统 API,因为 GAE 不提供本地文件系统.在stacktace中看到了DiskFileItem的用法,基本上就是把上传的文件写到本地,稍后再删除.
Commons FileUpload (1.2.1) is only semi-compatible with GAE. Only streaming API is supported but not the traditional API beacuse a local filesystem is not made available by GAE. In the stacktace, I see usage of DiskFileItem, which basically writes the uploaded file locally and deletes it later.
请参阅位于 GAE 和对 Java 框架的支持
这篇关于谷歌应用程序中的rmi错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!