I tested the sample code, with no issues at all...
JSP > Upload > Serve, image submitted, uploaded, displayed

2010/5/11 Jaroslav Záruba <jaroslav.zar...@gmail.com>

> OK, I'm on it...
>
>
> On Tue, May 11, 2010 at 12:13 PM, Perugini 
> <wilson.ferreira...@gmail.com>wrote:
>
>> Hi Jaroslav,
>>
>> Could you try the sample code? I believe I have a CLASSPATH issue but
>> I ran out of options. Should I rebuild the whole project?
>>
>> Thanks,
>>
>> Wilson
>>
>> On May 10, 6:02 am, Perugini <wilson.ferreira...@gmail.com> wrote:
>> > Hi Jaroslav,
>> >
>> > Feel free to do it. It's a eclipse project. Also, I got the same error
>> > if I simply run the GAE sample code unchanged:
>> >
>> > http://code.google.com/appengine/docs/java/blobstore/overview.html.
>> >
>> > For some reason eclipse at run time can't find the Blobstore classes.
>> >
>> > On May 9, 7:17 pm, Jaroslav Záruba <jaroslav.zar...@gmail.com> wrote:
>> >
>> >
>> >
>> > > If you have this app as an Eclipse project I might try to run it on my
>> > > machine. I mean if you ran out of other options...
>> >
>> > > On Sun, May 9, 2010 at 5:48 PM, Perugini <
>> wilson.ferreira...@gmail.com>wrote:
>> >
>> > > > Anyone?
>> >
>> > > > On May 5, 9:49 pm, Perugini <wilson.ferreira...@gmail.com> wrote:
>> > > > > I am trying to use GAEBlobstorewith GWT. I have changed the sample
>> > > > > they have online:
>> >
>> > > > >http://code.google.com/appengine/docs/java/blobstore/overview.html
>> >
>> > > > > I replaced the jsp page with a GWT page (below). I replaced the
>> call
>> > > > > to "<%= blobstoreService.createUploadUrl("/upload") %>" with a RPC
>> > > > > call which is initiated by "controller.getUploadURL("/index").
>> >
>> > > > > However I am getting the following error:
>> >
>> > > > > SEVERE: [1273002680440000] javax.servlet.ServletContext log:
>> Exception
>> > > > > while dispatching incoming RPC call
>> > > > > com.google.gwt.user.server.rpc.UnexpectedException: Service method
>> > > > > 'public abstract java.lang.String
>> >
>> > > >
>> net.compuroad.cerrado.client.data.DataAccessService.getUploadURL(java.lang.
>> > > > String)'
>> > > > > threw an unexpected exception: java.lang.NoClassDefFoundError:
>> com/
>> > > > > google/appengine/api/blobstore/BlobstoreServiceFactory
>> >
>> > > > >         at
>> > > > >
>> com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:
>> > > > > 360)
>> > > > >         at
>> > > > >
>> com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:
>> > > > > 546)
>> > > > >         at
>> >
>> > > >
>> com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServi
>> > > > ceServlet.java:
>> > > > > 166)
>> >
>> > > > > I have installed GAE SDK 1.3.3.1. Any ideas will be appreciated.
>> >
>> > > > > Thanks,
>> >
>> > > > > Wilson
>> >
>> > > > > //GWT page to upload the images:
>> >
>> > > > > public class ImagePage2 extends Page {
>> >
>> > > > >         private String[] mediaList = {"Select
>> > > > > media","picture","video"};
>> > > > >         private FileUpload upload = null;
>> >
>> > > > >         private Controller controller = null;
>> > > > >         private static CerradoConstants constants = null;
>> >
>> > > > >         private  final FormPanel form = new FormPanel();
>> > > > >         private VerticalPanel panel = new VerticalPanel();
>> > > > >     private FlexTable table = new FlexTable();
>> >
>> > > > >     private Button btnAddImage = new Button("Add Image");
>> >
>> > > > >     private Button btnUpload = new Button("Upload");
>> >
>> > > > >     private TextBox txtPropertyID = new TextBox();
>> > > > >     private TextBox txtPropertyName = new TextBox();
>> >
>> > > > >     /**
>> > > > >          * Constructor
>> > > > >          */
>> > > > >         public ImagePage2(final Controller controller, final
>> > > > > CerradoConstants constants) {
>> >
>> > > > >                 this.constants = constants;
>> > > > >                 this.controller = controller;
>> >
>> > > > >                 // Create a FormPanel and point it at a service.
>> > > > >                 //form.setAction(GWT.getModuleBaseURL() +"Image");
>> >
>> > > > >             // Because we're going to add a FileUpload widget,
>> we'll
>> > > > > need to set the
>> > > > >             // form to use the POST method, and multipart MIME
>> > > > > encoding.
>> > > > >             form.setEncoding(FormPanel.ENCODING_MULTIPART);
>> > > > >             form.setMethod(FormPanel.METHOD_POST);
>> > > > >             form.setWidget(panel);
>> >
>> > > > >             btnAddImage.addClickHandler( new ClickHandler(){
>> >
>> > > > >                         @Override
>> > > > >                         public void onClick(ClickEvent event) {
>> > > > >                                       upload = new FileUpload();
>> > > > >                                   upload.setName("uploadForm");
>> > > > >                                     upload.setSize("450px",
>> "25px");
>> > > > >                                     panel.add(upload);
>> > > > >                         }
>> >
>> > > > >                 });
>> >
>> > > > >             btnUpload.addClickHandler( new ClickHandler(){
>> >
>> > > > >                         @Override
>> > > > >                         public void onClick(ClickEvent event) {
>> > > > >                        /***This call initiates the RPC and
>> generates
>> > > > > the error **/
>> > > > >
>>  controller.getUploadURL("/index");
>> > > > >                         }
>> >
>> > > > >                 });
>> >
>> > > > >            //the upload URL should come back from the RPC call
>> > > > > controller.getUploadURL("/index") using this listener
>> >
>> > > > > controller.getData().addPropertyChangeListener("uploadURL", new
>> > > > > PropertyChangeListener(){
>> >
>> > > > >                         @Override
>> > > > >                         public void
>> propertyChange(PropertyChangeEvent
>> > > > > event) {
>> > > > >                                         String path = null;
>> > > > >                                 if (event.getNewValue()!= null){
>> > > > >                                         path = (String )
>> > > > > event.getNewValue();
>> >
>> > > > >                                         Window.alert("Upload URL:
>> > > > > "+path);
>> > > > >                                         form.setAction(path);
>> > > > >                                         form.submit();
>> >
>> > > > >                                 }
>> >
>> > > > >                         }
>> >
>> > > > >             });
>> >
>> > > > >             panel.add(btnAddImage);
>> > > > >             panel.add(btnUpload);
>> >
>> > > > >             // Add an event handler to the form.
>> > > > >            form.addFormHandler(new FormHandler() {
>> >
>> > > > >               @Override
>> > > > >               public void onSubmit(FormSubmitEvent event) {
>> >
>> > > > >               }
>> >
>> > > > >               public void onSubmitComplete(SubmitCompleteEvent
>> event)
>> > > > > {
>> >
>> > > > >                 Window.alert(event.getResults());
>> > > > >               }
>> >
>> > > > >                 @Override
>> > > > >                 public void
>> onSubmitComplete(FormSubmitCompleteEvent
>> > > > > event) {
>> > > > >                         // TODO Auto-generated method stub
>> >
>> > > > >                         Window.alert(event.getResults());
>> >
>> > > > >                 }
>> >
>> > > > >             });
>> >
>> > > > >            // Add a 'submit' button.
>> > > > >             panel.add(new Button( "Submit", new ClickListener() {
>> >
>> > > > >               public void onClick(Widget sender) {
>> >
>> > > > >                 form.submit();
>> >
>> > > > >               }
>> > > > >             }));
>> >
>> > > > >         }//end constructor
>> >
>> > > > >         @Override
>> > > > >         public void hide() {
>> > > > >                 RootPanel.get("content").clear();
>> >
>> > > > >         }
>> >
>> > > > >         @Override
>> > > > >         public void propertyChange(PropertyChangeEvent event) {
>> > > > >                 // TODO Auto-generated method stub
>> >
>> > > > >         }
>> >
>> > > > >         @Override
>> > > > >         public void show() {
>> > > > >                 // TODO Auto-generated method stub
>> >
>> > > > >                 //String text =
>> >
>> > > > >                 String title = null;
>> > > > >                 HTML htmlTitle = new HTML();
>> >
>> > > > >                 if (controller.getData().getProperty() != null){
>> > > > >                         title = "<p class='accTitle'>Add Images to
>> the
>> > > > > Property</p>";
>> >
>> > > > >                         //set the value inside Name like
>> "propertyID:
>> > > > > 12345";
>> > > > >                         txtPropertyID.setName("propertyID");
>> > > > >                         txtPropertyName.setName("propertyName");
>> >
>> > > > >
>> txtPropertyID.setText(controller.getData().getProperty().getId()+"");
>> >
>> > > > >
>> txtPropertyName.setText(controller.getData().getProperty().getName());
>> >
>> > > > >                         txtPropertyID.setVisible(false);
>> > > > >                         txtPropertyName.setVisible(false);
>> >
>> > > > >                         panel.add(txtPropertyID);
>> > > > >                         panel.add(txtPropertyName);
>> >
>> > > > >                 }
>> >
>> > > > >                 htmlTitle.setHTML(title);
>> >
>> > > > >                 RootPanel.get("content").clear();
>> > > > >                 RootPanel.get("content").add(htmlTitle);
>> > > > >         //      RootPanel.get("content").add(description);
>> > > > >                 RootPanel.get("content").add(form);
>> >
>> > > > >                 Cerrado.getInstance().getTopLinks().show();
>> >
>> > > > >         }
>> >
>> > > > >         private String getUploadURL(){
>> >
>> > > > >                 return null;
>> > > > >         }
>> >
>> > > > > }
>> >
>> > > > > //Client Controller class:
>> >
>> > > > > public class Controller {
>> >
>> > > > >         private CerradoData data = null;
>> >
>> > > > >         private  DataAccessServiceAsync service = null;
>> >
>> > > > >         private String source = null;
>> >
>> > > > >         public Controller (CerradoData data){
>> >
>> > > > >                 this.data = data;
>> > > > >                 this.service =
>>  GWT.create(DataAccessService.class);
>> >
>> > > > >         }
>> >
>> > > > > //some
>> >
>> > ...
>> >
>> > read more »
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Google App Engine" group.
>> To post to this group, send email to google-appeng...@googlegroups.com.
>> To unsubscribe from this group, send email to
>> google-appengine+unsubscr...@googlegroups.com<google-appengine%2bunsubscr...@googlegroups.com>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/google-appengine?hl=en.
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appeng...@googlegroups.com.
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en.

Reply via email to