GWT 2.9 upload file error

67 views
Skip to first unread message

Yibin Li

unread,
Aug 2, 2021, 3:39:30 AMAug 2
to GWT Users
I upgrade a project from GWT 2.5.1+Java 8 to GWT 2.9 +Java 11

I got (TYpeError): Cannot read property 'Xe' of null when I 

IUploader currentUploader = new Uploader(fileInputType, autoSubmit);//autosubmit = true
IUploadStatus statusWidget = new IUploadStatus();
try{
currentUploader.setStatusWidget(statusWidget);
}catch(Exception e){
   //print error here
   // (TYpeError): Cannot read property 'Xe' of null got printed here
}

This code does not have any problems when I use GWT 2.5+Java 8

//Symptom 
The upload file GWT File control is shown. I can clicked the control and select a file to upload

The control shows the selected file name but it does not call http servlet that is on server side.

Web.xml
<servlet>     
<servlet-name>uploadServlet</servlet-name>          
<servlet-class>
             edu.vanderbilt.mc.aries.server.rpc.control.AttachmentUploaderService
        </servlet-class>   
</servlet>   

<servlet-mapping>     
<servlet-name>uploadServlet</servlet-name>     
<url-pattern>*.gupld</url-pattern>   
</servlet-mapping>


I ggogled the erro rmessage. It seems that this is a JQuery error

Any suggestions or comments are really appreciated

Yibin Li 

lofid...@gmail.com

unread,
Aug 5, 2021, 8:55:17 AMAug 5
to GWT Users
What kind of "Uploader" component do you use?

Thanks,
Lofi

Yibin Li

unread,
Aug 5, 2021, 12:39:50 PMAug 5
to GWT Users
import gwtupload.client.IFileInput.FileInputType;
import gwtupload.client.IUploadStatus.Status;
import gwtupload.client.IUploader;
import gwtupload.client.IUploader.OnChangeUploaderHandler;
import gwtupload.client.IUploader.OnFinishUploaderHandler;
import gwtupload.client.MultiUploader;
import gwtupload.client.Utils;

This is what I use in project

The Jar is gwtupload-1.03.jar

Only this version is compliable for GWT 2.9

Yibin Li

unread,
Aug 5, 2021, 12:51:28 PMAug 5
to GWT Users
I have made upload file working. We have custom statuswidget that is using  IUploadStatus interface. This caused prblem
in Web.xml

<servlet-mapping>     
<servlet-name>uploadServlet</servlet-name>     
<url-pattern>*.gupld</url-pattern>   
</servlet-mapping>


What I did is 
1. DO not use  *.gupld  -- replaced by real servlet 
2.  Do not set status Widget -- >  //commented out currentUploader.setStatusWidget(statusWidget);

Oleg Ravun

unread,
Aug 5, 2021, 1:22:33 PMAug 5
to google-we...@googlegroups.com
I use gwtupload.client.MultiUploader . Do you set servlet path - setServletPath()?
I don't call setStatusWidget. 

Thanks,
Oleg



--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-tool...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/64b40421-3e27-4c92-88f6-fc839f51fd6bn%40googlegroups.com.

Yibin Li

unread,
Aug 9, 2021, 12:08:12 PMAug 9
to GWT Users
Yes.
setServletPath() to call upload servlet 
Reply all
Reply to author
Forward
0 new messages