2017-04-05 73 views
0

我正在開發一個在java中的谷歌應用程序,但是我收到這個錯誤:java.io.FileOutputStream is a restricted class只有 當我嘗試上傳比其他人更大的csv文件時。 所有工作正常,當我上傳文件像5-6kb,我得到30kb文件的錯誤。 我導入了所有庫,當然還有一些教程/問題,但我不知道要解決這個問題。在servlet的NoClassDefFoundError:java.io.FileOutputStream是一個受限制的類

代碼:

FileItemFactory factory = new DiskFileItemFactory(); 
     ServletFileUpload upload = new ServletFileUpload(factory); 
     upload.setFileSizeMax(50000); 
     upload.setSizeMax(50000); 
     List<FileItem> items = upload.parseRequest(req); // <-- error line (48) 

java.lang.NoClassDefFoundError: java.io.FileOutputStream 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:50) 
at org.apache.commons.io.output.DeferredFileOutputStream.thresholdReached(DeferredFileOutputStream.java:178) 
at org.apache.commons.io.output.ThresholdingOutputStream.checkThreshold(ThresholdingOutputStream.java:224) 
at org.apache.commons.io.output.ThresholdingOutputStream.write(ThresholdingOutputStream.java:128) 
at org.apache.commons.fileupload.util.Streams.copy(Streams.java:108) 
at org.apache.commons.fileupload.util.Streams.copy(Streams.java:70) 
at org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:347) 
at org.apache.commons.fileupload.servlet.ServletFileUpload.parseRequest(ServletFileUpload.java:115) 
at it.injenia.gestionefirme.servlet.uploadkind.UploadKind.doPost(UploadKind.java:48) 

回答

相關問題