Hello i try integrated Google file service and Struts 1
i'm using lib: common-fileupload 1.2.1 and common-io 1.4
This is my Action:
--------------------------------------------------------------------------------------------------------------------------------------------------------------
<code>public class AddProductAction extends Action {
@Override
public ActionForward execute(ActionMapping mapping, ActionForm
form, HttpServletRequest request, HttpServletResponse response)
throws Exception {
//private static final long serialVersionUID = 8367618433138027430L;
AddProductFormBean myForm= (AddProductFormBean) form;
String fileId = "";
String fileOwner = "";
int fileSize;
FormFile File = myForm.getUpFile();
String contentType = File.getContentType();
String fileName = File.getFileName();
fileOwner = myForm.getFileOwner();
fileId = myForm.getFileId();
InputStream stream = File.getInputStream();
stream.close();
fileSize = DatastoreUtils.insertGoogleFile(fileId, fileOwner,
fileName, contentType, stream);
return (mapping.findForward("success-addproduct"));
}
}</code>
---------------------------------------------------------------------------------------------------------------------------------------------------------
And this is my FORM FILE:
public class AddProductFormBean extends ActionForm
{
private FormFile upfile;
private String fileOwner;
private String fileId;
public String getFileId() {
return fileId;
}
public void setFileId(String fileId) {
this.fileId = fileId;
}
public String getFileOwner() {
return fileOwner;
}
public void setFileOwner(String fileOwner) {
this.fileOwner = fileOwner;
}
public FormFile getUpFile() {
return upfile;
}
public void setUpFile(FormFile upFile) {
this.upfile = upFile;
}
}
--------------------------------------------------------------------------------------------------------------------------------------
the rest file i have from page of project hosting:
http://code.google.com/p/google-file-service/
-DatastoreUtils.java
-GoogleFile.java
-GoogleUnit.java
-PMF.java
This is very simple application but i have problem
Problem accessing /addProductAction.do. Reason:
java.rmi.server.UID is a restricted class. Please see the Google
App Engine developer's guide for more details.
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.<clinit>(DiskFileItem.java:
103)
at
org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultFileItemFactory.java:
103)
at
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:
358)
at
org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadBase.java:
310)
...................................................
I don't know what i do wrong and why its not working. I reading a post
http://groups.google.com/group/google-appengine-java/browse_thread/thread/184ab968ca8c184c/da930f956601df7f#da930f956601df7f
So integrated struts 1 and google file service is posible. Please give
me sobe example or advice. Thanks
--
You received this message because you are subscribed to the Google Groups
"Google App Engine for Java" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine-java?hl=en.