谷歌应用程序中的rmi错误 [英] rmi error in google app

查看:149
本文介绍了谷歌应用程序中的rmi错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



  FileItemIterator it = servletFileUpload.getItemIterator(request);我没有得到错误信息。 

当我使用以下行时获得它

  List fileItemsList = servletFileUpload.parseRequest(request); 

它们有什么不同,以及rmi与servletFileUpload.parseRequest(request);?



错误:
导致:

  java.lang.NoClassDefFoundError :java.rmi.server.UID是一个受限制的类。有关更多详细信息,请参阅Google App Engine开发人员指南。 
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)

上下文:
在Google应用上使用Apache commons lib的文件上传应用程序。

GAE和对Java框架的支持



以下是 streaming API的使用情况。


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);?

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.

解决方案

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.

See the section under Apache Commons FileUpload at GAE and support for Java frameworks

Here's the streaming API usage.

这篇关于谷歌应用程序中的rmi错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆