HTTP STATUS 500 error

121 views
Skip to first unread message

Sudesna

unread,
May 21, 2007, 1:54:13 AM5/21/07
to Google Web Toolkit
Hi all,
I tried the Fancy File Upload program in GWT. The code is listed
in the following link:-
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/19ea5c6be6d47848/e54b83772445a91e?lnk=gst&q=fancy+file+upload&rnum=5#e54b83772445a91e

However, whenever i try to upload a XML file i am getting a HTTP
Status 500 error stating :
HTTP Status 500
type: exception
description: The server encountered an internal error which prevented
it from fulfilling the request.
Root cause:-
java.lang.NoClassDefFoundError: org/apache/commons/fileupload/
FileUploadException.

In other words, Window.alert(event.getResults()); gives me a HTTP
status 500 error and says operation failed.
uploadForm.addFormHandler(new FormHandler() {
public void onSubmitComplete(FormSubmitCompleteEvent
event) {
// Fire an onChange Event
fireChangeEvent();

// Ensure that the form encoding is set correctly.

uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART);

Window.alert(event.getResults()); //Gives HTTP
status 500 error!!!
.
.
}

I have used the following libraries:-
commons-fileupload-1.2.jar
commons-io-1.3.1.jar
and i have included them in my build path as well.

The error in the development shell states:-

StandardWrapperValve[shell]: Servlet.service() for servlet shell threw
exception
java.lang.NoClassDefFoundError: org/apache/commons/fileupload/
FileUploadException
at
com.google.gwt.dev.shell.GWTShellServlet.tryGetOrLoadServlet(GWTShellServlet.java:
745)
at
com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:
237)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:
237)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:
157)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:
214)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:
104)
at
org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
520)
at
org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:
198)
at
org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:
152)
at
org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:
104)

Can someone please tell me what could the possible problem be? Thanks
in advance.

Steiner Dominik, (QX59311)

unread,
May 21, 2007, 2:20:59 AM5/21/07
to Google-We...@googlegroups.com
Hi Sudesna,

Are you using an external Tomcat (so using -noserver) or the internal one shipped with GWT?

I guess that you are using the internal one. I would strongly recommend you using an external Tomcat. I think the error you get is because the internal Tomcat doesn't have the fileupload.jar in its classpath. I don't think that it takes the jars from the build path which you probably have configured in eclipse, but from the lib directory which you would have to add under tomcat\webapps\ROOT\WEB-INF\lib and place your jars in that folder.

If that doesn't work, try with an external server and tell us how it worked. :)

HTH

Dominik

-----Ursprüngliche Nachricht-----
Von: Google-We...@googlegroups.com [mailto:Google-We...@googlegroups.com] Im Auftrag von Sudesna
Gesendet: Montag, 21. Mai 2007 07:54
An: Google Web Toolkit
Betreff: HTTP STATUS 500 error

Sudesna

unread,
May 22, 2007, 12:22:56 AM5/22/07
to Google Web Toolkit
Thanks for the response. Actually i was using the internal tomcat
shipped with GWT. I tried creating a lib folder in internal tomcat and
copying jar files but it did not work. :-(
So now i am using an external tomcat server but whenever i try to
execute that FancyFileUpload example, i am getting the following
error:-
javax.servlet.ServletException : Servlet execution threw an exception
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
root cause
java.lang.UnsatisfiedLinkError : init
at com.google.gwt.user.client.Window.init(Native method)
at com.infosys.server.FileUploadServlet.doPost(FileUploadServlet:java
27)

Sometimes i also get this error:
java.lang.NoClassDefFoundError
at com.infosys.server.FileUploadServlet.doPost(FileUploadServlet:java
27)

I have used the following steps to configure the external tomcat
server.
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/4d14f7c8ddf4d4d0/54bf272baabd7d36?q=InvocationException&rnum=10#54bf272baabd7d36

Any inputs regarding the same are welcome.Thanks in advance.


On May 21, 11:20 am, "Steiner Dominik, \(QX59311\)"


<Dominik.Stei...@partner.bmw-motorsport.com> wrote:
> Hi Sudesna,
>
> Are you using an external Tomcat (so using -noserver) or the internal one shipped with GWT?
>
> I guess that you are using the internal one. I would strongly recommend you using an external Tomcat. I think the error you get is because the internal Tomcat doesn't have the fileupload.jar in its classpath. I don't think that it takes the jars from the build path which you probably have configured in eclipse, but from the lib directory which you would have to add under tomcat\webapps\ROOT\WEB-INF\lib and place your jars in that folder.
>
> If that doesn't work, try with an external server and tell us how it worked. :)
>
> HTH
>
> Dominik
>
> -----Ursprüngliche Nachricht-----
> Von: Google-We...@googlegroups.com [mailto:Google-We...@googlegroups.com] Im Auftrag von Sudesna
> Gesendet: Montag, 21. Mai 2007 07:54
> An: Google Web Toolkit
> Betreff: HTTP STATUS 500 error
>
> Hi all,
> I tried the Fancy File Upload program in GWT. The code is listed

> in the following link:-http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...

Reinier Zwitserloot

unread,
May 22, 2007, 1:02:49 AM5/22/07
to Google Web Toolkit
Check the stack trace. com.infosys.server.FUS is calling Window.init.

Window.init is GWT code. You cannot run GWT code in anything except
GWT.

Are you perchance calling GWT's Window.init straight from your own
doPost code in your FileUploadServlet?

You can't do that.

On May 22, 6:22 am, Sudesna <sudesna.mahara...@gmail.com> wrote:
> Thanks for the response. Actually i was using the internal tomcat
> shipped with GWT. I tried creating a lib folder in internal tomcat and
> copying jar files but it did not work. :-(
> So now i am using an external tomcat server but whenever i try to
> execute that FancyFileUpload example, i am getting the following
> error:-
> javax.servlet.ServletException : Servlet execution threw an exception
> at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter
> root cause
> java.lang.UnsatisfiedLinkError : init
> at com.google.gwt.user.client.Window.init(Native method)
> at com.infosys.server.FileUploadServlet.doPost(FileUploadServlet:java
> 27)
>
> Sometimes i also get this error:
> java.lang.NoClassDefFoundError
> at com.infosys.server.FileUploadServlet.doPost(FileUploadServlet:java
> 27)
>
> I have used the following steps to configure the external tomcat

> server.http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...

> > com.google.gwt.dev.shell.GWTShellServlet.tryGetOrLoadServlet(GWTShellServle­t.java:


> > 745)
> > at
> > com.google.gwt.dev.shell.GWTShellServlet.service(GWTShellServlet.java:
> > 237)
> > at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
> > at

> > org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Applicatio­nFilterChain.java:
> > 237)
> > at
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterC­hain.java:
> > 157)
> > at
> > org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.j­ava:
> > 214)
> > at
> > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveConte­xt.java:


> > 104)
> > at
> > org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:
> > 520)
> > at

> > org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContex­tValve.java:
> > 198)
> > at
> > org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.j­ava:
> > 152)
> > at
> > org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveConte­xt.java:

Sudesna

unread,
May 22, 2007, 1:22:48 AM5/22/07
to Google Web Toolkit
Thanks for the response Reinier. How else am i supposed to use an
external tom cat server. Actually i was repeatedly getting the HTTP
Status 500 error asking for the commons-fileupload jar file, so i
tried to use it with an external tom cat server. I have used the code
provided at
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/19ea5c6be6d47848/e54b83772445a91e?lnk=gst&q=fancy+file+upload&rnum=5#e54b83772445a91e
Can you please tell me what should i do so that i can upload the file
successfully to the server (you can read my first mail in this thread
to get an idea about my problem.)

Adam T

unread,
May 22, 2007, 1:44:11 AM5/22/07
to Google Web Toolkit
Sudesna,

Ignoring the whole internal/external tomcat for a second, what is the
error that Tomcat is reporting in the logs?

If I recall correctly, the FancyFileUpload need three jar files, of
which you have listed 2 (I can't remember now if it was an error in my
original description for FFUpload or if the Apache Commons packages
changed at a later date). You need the following three Jar files from
Apache Commons:

commons-fileupload
commons-io and
commons-codec

It could be the case that without commons-codec errors are being
raised on the server side that are reflected as the 500 error you see.

//Adam


On May 22, 7:22 am, Sudesna <sudesna.mahara...@gmail.com> wrote:
> Thanks for the response Reinier. How else am i supposed to use an
> external tom cat server. Actually i was repeatedly getting the HTTP
> Status 500 error asking for the commons-fileupload jar file, so i
> tried to use it with an external tom cat server. I have used the code

> provided athttp://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...

Steiner Dominik, (QX59311)

unread,
May 22, 2007, 2:21:07 AM5/22/07
to Google-We...@googlegroups.com
Hi Sudesna,

I tested it with an internal tomcat here and it works.

Add following to your gwt.xml

<servlet path="/myFileUpload" class="com.foo.server.MyFileUpload"/>

In your eclipse project add the three libs Adam mentioned to your eclipse classpath.

For testing purposes to see that the servlet is getting reached just do a call from the client

String url = GWT.getModuleBaseURL()+"/myFileUpload";
RequestBuilder builder = new RequestBuilder(RequestBuilder.POST, url);
try {
Request response = builder.sendRequest(null, new RequestCallback() {

public void onError(Request request, Throwable exception) {
// code omitted for clarity
GWT.log("onError", exception);
}

public void onResponseReceived(Request request, Response response) {
// code omitted for clarity
GWT.log("onResponse", null);
}
});
} catch (RequestException e) {
Window.alert("Failed to send the request: " + e.getMessage());
}


I still would recommend you using an external tomcat.

See

http://code.google.com/support/bin/answer.py?answer=55200

for a detailed instruction on how to do it.

Hope you can get it going soon. :)

Dominik
-----Ursprüngliche Nachricht-----
Von: Google-We...@googlegroups.com [mailto:Google-We...@googlegroups.com] Im Auftrag von Sudesna

Gesendet: Dienstag, 22. Mai 2007 07:23
An: Google Web Toolkit
Betreff: Re: External Tomcat server Error and HTTP STATUS 500 error


Thanks for the response Reinier. How else am i supposed to use an
external tom cat server. Actually i was repeatedly getting the HTTP
Status 500 error asking for the commons-fileupload jar file, so i
tried to use it with an external tom cat server. I have used the code
provided at

http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/19ea5c6be6d47848/e54b83772445a91e?lnk=gst&q=fancy+file+upload&rnum=5#e54b83772445a91e

Sudesna

unread,
May 22, 2007, 4:55:23 AM5/22/07
to Google Web Toolkit
Hi all,
1. My gwt.xml contains the servlet path <servlet path="/upload"
class="com.company.server.FileUploadServlet"/>
2. I have included all the 3 jar files mentionend by Adam in my
build path:-
commons-fileupload
commons-io
commons-codec
3.But still the Fancy File Upload is not working :-(
The exact error returned when i write
Window.alert(event.getResults()); in onSubmitComplete() method is:-

HTTP Status 500
type: exception
description: The server encountered an internal error which prevented
it from fulfilling the request.
Root cause:-
java.lang.NoClassDefFoundError: org/apache/commons/fileupload/
FileUploadException.

and the GWT development shell shows a similar warning.
[WARN] StandardWrapperValve[shell]: Servlet.service() for servlet


shell threw exception
java.lang.NoClassDefFoundError: org/apache/commons/fileupload/
FileUploadException

Please let me know how can i reslove this error :-(

On May 22, 11:21 am, "Steiner Dominik, \(QX59311\)"
<Dominik.Stei...@partner.bmw-motorsport.com> wrote:
> Hi Sudesna,
>

> provided athttp://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...

Steiner Dominik, (QX59311)

unread,
May 22, 2007, 5:11:43 AM5/22/07
to Google-We...@googlegroups.com
Hi Sudesna,

Are you using Eclipse? Can you check that the jars are also in the classpath of the running GWT Shell? (Go to the Debug Perspective and in the Debug view make a right click on the running or stopped process and select 'Properties'- this shows you the exact call with which the GWT Shell was started)

Did you try to access the FileUploadServlet with a simple HTTP Request as I posted it in the previous post? (so not using the FileUpload widget)

Tell us how it works. Hope we'll find the solution soon.

Dominik
-----Ursprüngliche Nachricht-----
Von: Google-We...@googlegroups.com [mailto:Google-We...@googlegroups.com] Im Auftrag von Sudesna

Gesendet: Dienstag, 22. Mai 2007 10:55

Sudesna

unread,
May 25, 2007, 1:58:48 AM5/25/07
to Google Web Toolkit
Hey thanks a lot people for helping me out. I have finally got the
Fancy File Upload working.(Did it 2 days ago, but forgot to post this
message :-)). I had to replace the commons-fileupload jar file and
after following the pointers which all of you provided, i finally got
it working. Thanks a lot fellas.

On May 22, 2:11 pm, "Steiner Dominik, \(QX59311\)"
<Dominik.Stei...@partner.bmw-motorsport.com> wrote:
> Hi Sudesna,
>


> Are you using Eclipse? Can you check that the jars are also in the classpath of the running GWT Shell? (Go to the Debug Perspective and in the Debug view make a right click on the running or stopped process and select 'Properties'- this shows you the exact call with which the GWT Shell was started)
>

> Did you try to access the FileUploadServlet with a simpleHTTPRequest as I posted it in the previous post? (so not using the FileUpload widget)


>
> Tell us how it works. Hope we'll find the solution soon.
>
> Dominik
> -----Ursprüngliche Nachricht-----
> Von: Google-We...@googlegroups.com [mailto:Google-We...@googlegroups.com] Im Auftrag von Sudesna
> Gesendet: Dienstag, 22. Mai 2007 10:55
> An: Google Web Toolkit
> Betreff: Re: External Tomcat serverErrorandHTTPSTATUS500error
>
> Hi all,
> 1. My gwt.xml contains the servlet path <servlet path="/upload"
> class="com.company.server.FileUploadServlet"/>
> 2. I have included all the 3 jar files mentionend by Adam in my
> build path:-
> commons-fileupload
> commons-io
> commons-codec
> 3.But still the Fancy File Upload is not working :-(

> The exacterrorreturned when i write


> Window.alert(event.getResults()); in onSubmitComplete() method is:-
>
> HTTPStatus500
> type: exception

> description: The server encountered an internalerrorwhich prevented


> it from fulfilling the request.
> Root cause:-
> java.lang.NoClassDefFoundError: org/apache/commons/fileupload/
> FileUploadException.
>
> and the GWT development shell shows a similar warning.
> [WARN] StandardWrapperValve[shell]: Servlet.service() for servlet
> shell threw exception
> java.lang.NoClassDefFoundError: org/apache/commons/fileupload/
> FileUploadException

> Please let me know how can i reslove thiserror:-(

> >Status500errorasking for the commons-fileupload jar file, so i

> > > > > I guess that you are using the internal one. I would strongly recommend you using an external Tomcat. I think theerroryou get is because the internal Tomcat doesn't have the fileupload.jar in its classpath. I don't think that it takes the jars from the build path which you probably have configured in eclipse, but from the lib directory which you would have to add under tomcat\webapps\ROOT\WEB-INF\lib and place your jars in that folder.


>
> > > > > If that doesn't work, try with an external server and tell us how it worked. :)
>
> > > > > HTH
>
> > > > > Dominik
>
> > > > > -----Ursprüngliche Nachricht-----
> > > > > Von: Google-We...@googlegroups.com [mailto:Google-We...@googlegroups.com] Im Auftrag von Sudesna
> > > > > Gesendet: Montag, 21. Mai 2007 07:54
> > > > > An: Google Web Toolkit
> > > > > Betreff:HTTPSTATUS500error
>
> > > > > Hi all,
> > > > > I tried the Fancy File Upload program in GWT. The code is listed
> > > > > in the following link:-http://groups.google.com/group/Google-Web-Toolkit/browse_thread/threa...
>
> > > > > However, whenever i try to upload a XML file i am getting aHTTP
> > > > >Status500errorstating :
> > > > >HTTPStatus500

> > > > > type: exception
> > > > > description: The server encountered an internalerrorwhich prevented


> > > > > it from fulfilling the request.
> > > > > Root cause:-
> > > > > java.lang.NoClassDefFoundError: org/apache/commons/fileupload/
> > > > > FileUploadException.
>
> > > > > In other words, Window.alert(event.getResults()); gives me aHTTP

> > > > >status500errorand says operation failed.


> > > > > uploadForm.addFormHandler(new FormHandler() {
> > > > > public void onSubmitComplete(FormSubmitCompleteEvent
> > > > > event) {
> > > > > // Fire an onChange Event
> > > > > fireChangeEvent();
>
> > > > > // Ensure that the form encoding is set correctly.
>
> > > > > uploadForm.setEncoding(FormPanel.ENCODING_MULTIPART);
>
> > > > > Window.alert(event.getResults()); //GivesHTTP
> > > > >status500error!!!
> > > > > .
> > > > > .
>
> > > > > }
>
> > > > > I have used the following libraries:-
> > > > > commons-fileupload-1.2.jar
> > > > > commons-io-1.3.1.jar
> > > > > and i have included them in my build path as well.
>

> > > > > Theerrorin the development shell states:-

geccg

unread,
Jun 13, 2007, 12:01:04 PM6/13/07
to Google Web Toolkit
Hi Sudesna,

Could you please post your .xml file code? I am getting an error
saying that its "unable to load module entry point class" and also
"Failure to load module"

Any comments?

Thanks!

geccg

On May 25, 12:58 am, Sudesna <sudesna.mahara...@gmail.com> wrote:
> Hey thanks a lot people for helping me out. I have finally got the
> Fancy File Upload working.(Did it 2 days ago, but forgot to post this

> message :-)). I had to replace the commons-fileuploadjar file and


> after following the pointers which all of you provided, i finally got
> it working. Thanks a lot fellas.
>

> > On May 22, 11:21 am, "SteinerDominik, \(QX59311\)"

> > >Status500errorasking for the commons-fileuploadjar file, so i

> > > > > On May 21, 11:20 am, "SteinerDominik, \(QX59311\)"


>
> > > > > <Dominik.Stei...@partner.bmw-motorsport.com> wrote:
> > > > > > Hi Sudesna,
>
> > > > > > Are you using an external Tomcat (so using -noserver) or the internal one shipped with GWT?
>

> > > > > > I guess that you are using the internal one. I would strongly recommend you using an external Tomcat. I think theerroryou get is because the internal Tomcat doesn't have thefileupload.jar in its classpath. I don't think that it takes the jars from the build path which you probably have configured in eclipse, but from the lib directory which you would have to add under tomcat\webapps\ROOT\WEB-INF\lib and place your jars in that folder.

Reply all
Reply to author
Forward
0 new messages