FileUploader missing file?

79 views
Skip to first unread message

strawman

unread,
May 19, 2009, 6:50:04 PM5/19/09
to SmartGWT Extensions
PBoysen,

Thanks for the fileuploader. However, a file seems missing
"FileUploader.java" . Please clarify.


Strawman

Boysen, Pete [ITACD]

unread,
May 20, 2009, 10:28:46 AM5/20/09
to smartgwt-...@googlegroups.com
My code (Upload.java) doesn't use fileuploader but Anthony Yuan's does.
You might check with him.


Pete Boysen (pbo...@iastate.edu)
Information Technology Services
209 Durham
(515)294-6663

Sanjiv Jivan

unread,
May 25, 2009, 4:43:09 PM5/25/09
to smartgwt-...@googlegroups.com
Anthony,
Could you please look into this? It appears that you have overlooked adding FileUploader.java to SVN and as a result SVN is not in a compilable state. Can you either add this file, of if you're having other issues, kindly remove the related file temporarily till you have things in a consistent state.

Thanks,
Sanjiv

sjachym

unread,
Jun 9, 2009, 7:54:20 AM6/9/09
to SmartGWT Extensions
Hy, i try FileUploaderExample, but i'have an error :
"edu.iastate.its.thinkspace.gwt.client.util.files.Upload could not be
resolved to a type" in Upload.java :

private native void initComplete(Upload upload) /*-{
$wnd.uploadComplete = function (fileName) {

upload.@edu.iastate.its.thinkspace.gwt.client.util.files.Upload::uploadComplete
(Ljava/lang/String;)(fileName);
};
}-*/;

On 25 mai, 22:43, Sanjiv Jivan <sanjiv.ji...@gmail.com> wrote:
> Anthony,Could you please look into this? It appears that you have overlooked

Boysen, Pete [ITACD]

unread,
Jun 10, 2009, 8:02:52 AM6/10/09
to smartgwt-...@googlegroups.com
My fault. I failed to change the Javascript package name to extensions. Give it a try now.


Pete Boysen
Information Technology Services
pbo...@iastate.edu
(515)294-6663
winmail.dat
Message has been deleted

sjachym

unread,
Jun 11, 2009, 6:05:06 AM6/11/09
to SmartGWT Extensions
I have update from SVN, but it's stay errors :
Description Resource Path Location Type
edu.iastate.its.thinkspace.gwt.client.util.files.Upload could not be
resolved to a type Upload.java
SmartGwtSvnExtensions/src/main/java/com/smartgwt/extensions/client/
filemanager line 186 Java Problem
The method filename(String) is undefined for the type FileUtils
TestServiceImpl.java SmartGwtSvnExtensions/src/main/java/com/smartgwt/
extensions/server/servlets line 120 Java Problem
The method setMax(Integer) in the type LengthRangeValidator is not
applicable for the arguments (String) ResourceEditor.java
SmartGwtSvnExtensions/src/main/java/com/smartgwt/extensions/client/
resources line 69 Java Problem
The method setMin(Integer) in the type LengthRangeValidator is not
applicable for the arguments (String) ResourceEditor.java
SmartGwtSvnExtensions/src/main/java/com/smartgwt/extensions/client/
resources line 68 Java Problem

Some error including JS has removed, like in HTMLEditor, but for
Upload file :
edu.iastate.its.thinkspace.gwt.client.util.files.Upload could not be
resolved to a type

It's seems normal while you have only change
/trunk/src/main/java/com/smartgwt/extensions/client/htmleditor/
HTMLEditor.j ava
and not
/trunk/src/main/java/com/smartgwt/extensions/client/filemanager/
Upload.java

To resolve, i'have change :

/src/main/java/com/smartgwt/extensions/client/filemanager/
Upload.java :
$wnd.uploadComplete = function (fileName) {
//
upload.@edu.iastate.its.thinkspace.gwt.client.util.files.Upload::uploadComplete
(Ljava/lang/String;)(fileName);

upload.@com.smartgwt.extensions.client.filemanager.Upload::uploadComplete
(Ljava/lang/String;)(fileName);


/src/main/java/com/smartgwt/extensions/client/resources/
ResourceEditor.java :
// valLen.setMin("1");
// valLen.setMax("100");
valLen.setMin(1);
valLen.setMax(100);

/src/main/java/com/smartgwt/extensions/server/servlets/
TestServiceImpl.java :
// args.put("fileName", FileUtils.filename(fileItem.getName
()));
args.put("fileName", fileItem.getName());



But, another question, how to send reponse, and doesn't we add class
(like edu.iastate.its.thinkspace.core.*) to run you servlet exemple ?
http://forums.smartclient.com/showthread.php?t=5477


On 10 juin, 14:02, "Boysen, Pete [ITACD]" <pboy...@iastate.edu> wrote:
> My fault. I failed to change the Javascript package name to extensions.  Give it a try now.
>
> Pete Boysen
> Information Technology Services
> pboy...@iastate.edu
> (515)294-6663
>
>
>
> -----Original Message-----
> From: smartgwt-...@googlegroups.com on behalf of sjachym
> Sent: Tue 6/9/2009 6:54 AM
> To: SmartGWT Extensions
> Subject: Re: FileUploader missing file?
>
> Hy, i try FileUploaderExample, but i'have an error :
> "edu.iastate.its.thinkspace.gwt.client.util.files.Upload could not be
> resolved to a type" in Upload.java :
>
>         private native void initComplete(Upload upload) /*-{
>            $wnd.uploadComplete = function (fileName) {
>
> uplo...@edu.iastate.its.thinkspace.gwt.client.util.files.Upload::uploadComplete
> (Ljava/lang/String;)(fileName);
>            };
>         }-*/;
>
> On 25 mai, 22:43, Sanjiv Jivan <sanjiv.ji...@gmail.com> wrote:
> > Anthony,Could you please look into this? It appears that you have overlooked
> > adding FileUploader.java to SVN and as a result SVN is not in a compilable
> > state. Can you either add this file, of if you're having other issues,
> > kindly remove the related file temporarily till you have things in a
> > consistent state.
>
> > Thanks,
> > Sanjiv
>
> > On Tue, May 19, 2009 at 6:50 PM, strawman <prase...@gmail.com> wrote:
>
> > > PBoysen,
>
> > > Thanks for the fileuploader. However, a file seems missing
> > > "FileUploader.java" . Please clarify.
>
> > > Strawman
>
>
>
>  winmail.dat
> 4KAfficherTélécharger

Boysen, Pete [ITACD]

unread,
Jun 11, 2009, 7:18:16 AM6/11/09
to smartgwt-...@googlegroups.com
The file utils problem occurred because a recent change. I will see if I can correct.

Pete Boysen
Information Technology Services
pbo...@iastate.edu
(515)294-6663




-----Original Message-----
From: smartgwt-...@googlegroups.com on behalf of sebastien jachym
Sent: Thu 6/11/2009 2:38 AM
To: smartgwt-...@googlegroups.com
Subject: Re: FileUploader missing file?

I have update from SVN, but it's stay errors :
Description Resource Path Location Type
edu.iastate.its.thinkspace.gwt.client.util.files.Upload could not be
resolved to a type Upload.java
SmartGwtSvnExtensions/src/main/java/com/smartgwt/extensions/client/filemanager
line
186 Java Problem
The method filename(String) is undefined for the type FileUtils
TestServiceImpl.java
SmartGwtSvnExtensions/src/main/java/com/smartgwt/extensions/server/servlets
line
120 Java Problem
The method setMax(Integer) in the type LengthRangeValidator is not
applicable for the arguments (String) ResourceEditor.java
SmartGwtSvnExtensions/src/main/java/com/smartgwt/extensions/client/resources
line
69 Java Problem
The method setMin(Integer) in the type LengthRangeValidator is not
applicable for the arguments (String) ResourceEditor.java
SmartGwtSvnExtensions/src/main/java/com/smartgwt/extensions/client/resources
line
68 Java Problem

Some error including JS has removed, like in HTMLEditor, but for Upload file
:
edu.iastate.its.thinkspace.gwt.client.util.files.Upload could not be
resolved to a type

It's seems normal while you have only change
/trunk/src/main/java/com/smartgwt/extensions/client/htmleditor/HTMLEditor.java
and not
/trunk/src/main/java/com/smartgwt/extensions/client/filemanager/Upload.java


2009/6/10 Boysen, Pete [ITACD] <pbo...@iastate.edu>
--
Cordialement,
----------------------
L'équipe Placeoweb
http://www.placeoweb.com/



winmail.dat

Boysen, Pete [ITACD]

unread,
Jun 11, 2009, 7:34:30 AM6/11/09
to smartgwt-...@googlegroups.com
I fixed the JS error and changed the signature for setMin and setMax. Strings were used in 1.0b3 but changed in 1.2. I wonder if we should upgrade?

The commons-io I have in the POM has the filename parameter. Are you conflicting with another commons-io version?

What compile steps are you taking to generate these errors? I would like to follow the same steps.


Pete Boysen
Information Technology Services
pbo...@iastate.edu
(515)294-6663




-----Original Message-----
From: smartgwt-...@googlegroups.com on behalf of sebastien jachym
Sent: Thu 6/11/2009 2:38 AM
To: smartgwt-...@googlegroups.com
Subject: Re: FileUploader missing file?

I have update from SVN, but it's stay errors :
Description Resource Path Location Type
edu.iastate.its.thinkspace.gwt.client.util.files.Upload could not be
resolved to a type Upload.java
SmartGwtSvnExtensions/src/main/java/com/smartgwt/extensions/client/filemanager
line
186 Java Problem
The method filename(String) is undefined for the type FileUtils
TestServiceImpl.java
SmartGwtSvnExtensions/src/main/java/com/smartgwt/extensions/server/servlets
line
120 Java Problem
The method setMax(Integer) in the type LengthRangeValidator is not
applicable for the arguments (String) ResourceEditor.java
SmartGwtSvnExtensions/src/main/java/com/smartgwt/extensions/client/resources
line
69 Java Problem
The method setMin(Integer) in the type LengthRangeValidator is not
applicable for the arguments (String) ResourceEditor.java
SmartGwtSvnExtensions/src/main/java/com/smartgwt/extensions/client/resources
line
68 Java Problem

Some error including JS has removed, like in HTMLEditor, but for Upload file
:
edu.iastate.its.thinkspace.gwt.client.util.files.Upload could not be
resolved to a type

It's seems normal while you have only change
/trunk/src/main/java/com/smartgwt/extensions/client/htmleditor/HTMLEditor.java
and not
/trunk/src/main/java/com/smartgwt/extensions/client/filemanager/Upload.java


2009/6/10 Boysen, Pete [ITACD] <pbo...@iastate.edu>

winmail.dat

sebastien jachym

unread,
Jun 11, 2009, 7:59:32 AM6/11/09
to smartgwt-...@googlegroups.com
I import smartgwt-extensions SVN on Eclipse (Project type : Google Eclipse Web Project with GWT 1.6.4)
Add (lasts) libs :
commons-fileupload-1.2.1.jar
commons-io-1.4.jar
junit-4.6.jar

And nothing else, by defaut, at this step, there is the previous errors what i'have say.


2009/6/11 Boysen, Pete [ITACD] <pbo...@iastate.edu>

Boysen, Pete [ITACD]

unread,
Jun 11, 2009, 8:05:07 AM6/11/09
to smartgwt-...@googlegroups.com
the commons-io version you have is later than the one I am using (commons-io-20030203.000550). It is defined in the pom. I assumed you were using Maven.

What version of SmartGWT are you using?

Pete Boysen
Information Technology Services
pbo...@iastate.edu
(515)294-6663




-----Original Message-----
From: smartgwt-...@googlegroups.com on behalf of sebastien jachym
Sent: Thu 6/11/2009 6:59 AM
To: smartgwt-...@googlegroups.com
Subject: Re: FileUploader missing file?

I import smartgwt-extensions SVN on Eclipse (Project type : Google Eclipse
Web Project with GWT 1.6.4)Add (lasts) libs :
winmail.dat

sebastien jachym

unread,
Jun 11, 2009, 9:25:48 AM6/11/09
to smartgwt-...@googlegroups.com
Strange, 
* last commons-io : commons-io-1.4.jar is date : 20-Jan-2008
* last SmartGWT from SVN. (today r577)

Not using Maven.

Boysen, Pete [ITACD]

unread,
Jun 11, 2009, 9:45:16 AM6/11/09
to smartgwt-...@googlegroups.com

Not strange.  My code compiles with commons-io-20030203.000550.jar, not commons-io-1.4.jar.

 

 

Pete Boysen (pbo...@iastate.edu)
Information Technology Services
209 Durham
(515)294-6663

sebastien jachym

unread,
Jun 11, 2009, 9:54:27 AM6/11/09
to smartgwt-...@googlegroups.com
Ok, with changing files as i had say, i can run your great FileUploaderExample.

After i have search the uncommented JSON returns :

JSON Returns :
"{success:true}"
"{reason:\"Error in uploading file\",success:false}"

sebastien jachym

unread,
Jun 11, 2009, 11:14:27 AM6/11/09
to smartgwt-...@googlegroups.com
In fact, upload file isn't working, in servlet i never had items.

ServletFileUpload.isMultipartContent : YES

// Parse the request
List /* FileItem */ items = upload.parseRequest(request);
// Process the uploaded items
Iterator iter = items.iterator();
while (iter.hasNext()) {
System.out.println("processFiles hasNext ?");            // NEVER DISPLAY

[DEBUG] Content-Type: multipart/form-data; boundary=---------------------------7d91a518111316
[DEBUG] Content-Length: 49

If y a use a simple html files form with action = myServlet, there is a file and the file is correctly store :

[DEBUG] Content-Type: multipart/form-data; boundary=---------------------------2752977812316
[DEBUG] Content-Length: 55046

An idea why the client not send file ? (with your Uploader)

Full trace of my POST File : 

Content-Type: multipart/form-data; boundary=---------------------------9040894219264
Content-Length: 46

-----------------------------9040894219264--


2009/6/11 sebastien jachym <sja...@gmail.com>

Boysen, Pete [ITACD]

unread,
Jun 11, 2009, 11:20:17 AM6/11/09
to smartgwt-...@googlegroups.com

I think the problem is that we have two upload classes.  Anthony wrote FileUploader and I wrote Upload and the servlet.  You might try my Upload class and the servlet because I know that works.

His should work with the servlet since the servlet is generic but I haven’t tested that.

sebastien jachym

unread,
Jun 11, 2009, 11:43:14 AM6/11/09
to smartgwt-...@googlegroups.com
Now, as you say, y try only your project, client and servlet (TestServiceImpl), but same result :

I add debug and result is :

processFiles START
processFiles TRY START
fileItem == null
processFiles TRY STOP
processFiles STOP

FileItem must be not null, but there are no :
while (iter.hasNext()) {
System.out.println("processFiles while (iter.hasNext()) {");
...
fileItem = item

sebastien jachym

unread,
Jun 11, 2009, 11:51:13 AM6/11/09
to smartgwt-...@googlegroups.com
I check your servlet with my hard coded html client, and the result is fine.

processFiles START
processFiles TRY START
processFiles while (iter.hasNext()) {
fileItem != null
processFiles, fileName:2848_2847.diff
uploading args {fileName=2848_2847.diff, contentType=application/octet-stream}
null,null,null
C:\workspaceEclipse\SmartGwtSvnExtensions\2848_2847.diff
processFiles TRY STOP
processFiles STOP

The problem is locate on the client.
Have you try it with GWT 1.6.4 ? and last SmartGwt ?

2009/6/11 sebastien jachym <sja...@gmail.com>

Boysen, Pete [ITACD]

unread,
Jun 11, 2009, 11:56:30 AM6/11/09
to smartgwt-...@googlegroups.com

You might look at the server access logs to see if there is a difference. All SmartGWT is doing is submitting a form.

sebastien jachym

unread,
Jun 11, 2009, 12:38:40 PM6/11/09
to smartgwt-...@googlegroups.com
Not side servlet, problem is client side.

I try the GWT FileUpload :

Form is submiting to your servlet, and the result is good : 
processFiles START
processFiles TRY START
processFiles while (iter.hasNext()) {
fileItem != null
processFiles, fileName:Y:\photos\281006 022.jpg
uploading args {fileName=Y:\photos\281006 022.jpg, contentType=image/pjpeg}
null,null,null
Y:\photos\281006 022.jpg
processFiles STOP

Boysen, Pete [ITACD]

unread,
Jun 11, 2009, 12:40:03 PM6/11/09
to smartgwt-...@googlegroups.com

No, but you want to see what the uploader is sending to the server.  It is clearly calling the servlet but with what parameters?

Reply all
Reply to author
Forward
0 new messages