gonuldas / gwtupload

Automatically exported from code.google.com/p/gwtupload
Other
0 stars 0 forks source link

Gwt upload file issue #189

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Using gwtupload.client.SingleUploader
2.fileUploader.addOnStartUploadHandler(new IUploader.OnStartUploaderHandler() {
                @Override
                public void onStart(IUploader uploader) {
                    String uploadType = "application/pdf";

                    uploader.setServletPath(servletPath + "?uploadType=" + uploadType);
                }
            });
3.

What is the expected output? What do you see instead?
Expected output : Getting object in session on server

Getting below error
Caused by: java.lang.NullPointerException: null     at 
gwtupload.client.Uploader.update(Uploader.java:1041)    at 
gwtupload.client.UpdateTimer.run(UpdateTimer.java:73)   at 
gwtupload.client.Uploader$9.onSubmitComplete(Uploader.java:440)     at 
com.google.gwt.user.client.ui.FormPanel$SubmitCompleteEvent.dispatch(FormPanel.j
ava:117)    at 
com.google.gwt.user.client.ui.FormPanel$SubmitCompleteEvent.dispatch(FormPanel.j
ava:1)  at com.google.gwt.event.shared.GwtEvent.dispatch(GwtEvent.java:1)   at 
com.google.web.bindery.event.shared.EventBus.dispatchEvent(EventBus.java:40) 
    at 
com.google.web.bindery.event.shared.SimpleEventBus.doFire(SimpleEventBus.java:19
3)  at 
com.google.web.bindery.event.shared.SimpleEventBus.fireEvent(SimpleEventBus.java
:88)    at 
com.google.gwt.event.shared.HandlerManager.fireEvent(HandlerManager.java:127) 
    at com.google.gwt.user.client.ui.Widget.fireEvent(Widget.java:129)  at 
com.google.gwt.user.client.ui.FormPanel$1.execute(FormPanel.java:649)   at 
com.google.gwt.core.client.impl.SchedulerImpl$Task$.executeScheduled$(SchedulerI
mpl.java:50)    at 
com.google.gwt.core.client.impl.SchedulerImpl.runScheduledTasks(SchedulerImpl.ja
va:180)     at 
com.google.gwt.core.client.impl.SchedulerImpl.flushPostEventPumpCommands(Schedul
erImpl.java:345)    at 
com.google.gwt.core.client.impl.SchedulerImpl$Flusher.execute(SchedulerImpl.java
:78)    at 
com.google.gwt.core.client.impl.SchedulerImpl.execute(SchedulerImpl.java:138) 
    at sun.reflect.GeneratedMethodAccessor122.invoke(Unknown Source)    at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)   at java.lang.reflect.Method.invoke(Method.java:597)     at 
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)   at 
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)  at 
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172
)   at 
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessagesWhileWaitingForRetu
rn(BrowserChannelServer.java:338)   at 
com.google.gwt.dev.shell.BrowserChannelServer.invokeJavascript(BrowserChannelSer
ver.java:219)   at 
com.google.gwt.dev.shell.ModuleSpaceOOPHM.doInvoke(ModuleSpaceOOPHM.java:136) 
    at com.google.gwt.dev.shell.ModuleSpace.invokeNative(ModuleSpace.java:576)  at 
com.google.gwt.dev.shell.ModuleSpace.invokeNativeObject(ModuleSpace.java:284) 
    at 
com.google.gwt.dev.shell.JavaScriptHost.invokeNativeObject(JavaScriptHost.java:9
1)  at com.google.gwt.core.client.impl.Impl.apply(Impl.java)    at 
com.google.gwt.core.client.impl.Impl.entry0(Impl.java:347)  at 
sun.reflect.GeneratedMethodAccessor110.invoke(Unknown Source)   at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.jav
a:25)   at java.lang.reflect.Method.invoke(Method.java:597)     at 
com.google.gwt.dev.shell.MethodAdaptor.invoke(MethodAdaptor.java:103)   at 
com.google.gwt.dev.shell.MethodDispatch.invoke(MethodDispatch.java:71)  at 
com.google.gwt.dev.shell.OophmSessionHandler.invoke(OophmSessionHandler.java:172
)   at 
com.google.gwt.dev.shell.BrowserChannelServer.reactToMessages(BrowserChannelServ
er.java:293)    at 
com.google.gwt.dev.shell.BrowserChannelServer.processConnection(BrowserChannelSe
rver.java:547)  at 
com.google.gwt.dev.shell.BrowserChannelServer.run(BrowserChannelServer.java:364)
    at java.lang.Thread.run(Thread.java:619)

What version of the product are you using? On what operating system?
GWT 2.6 jar, gwtupload 1.0.0 jar and Operating system : Window 7

Please provide any additional information below.

Original issue reported on code.google.com by nirajc2...@gmail.com on 17 Feb 2014 at 2:31

Attachments:

GoogleCodeExporter commented 8 years ago
This problem still exist with version 1.0.1 of gwt-upload. Has anyone looked 
into this issue since february? Seems like gwtupload is useless with gwt 
version 2.6+

Original comment by mur...@gmail.com on 14 May 2014 at 1:20

GoogleCodeExporter commented 8 years ago
Looking into this issue, I believe this is not such a problem, you must not 
change the request url during the time the file is being uploaded, otherwise 
the session breaks.

The normal way is to change it when the input file changes, so this code works 
to me:

    uploader.addOnChangeUploadHandler(new OnChangeUploaderHandler() {
      public void onChange(IUploader uploader) {
        String uploadType = "application/pdf";
        uploader.setServletPath(whatever + "?uploadType=" + uploadType);
      }
    });

Original comment by manuel.carrasco.m on 7 Jan 2015 at 5:49