Strange. But it seems that I have got it working with the Streaming approach
to parse uploaded files as mentioned on the commons page.

On 5/24/07, Askar Zaidi <[EMAIL PROTECTED]> wrote:

Hi Folks,

Can someone help me with this exception. I am trying to upload a file from
a html form.

Heres the full stack trace: (in tomcat logs)

May 21, 2007 3:35:51 AM org.apache.catalina.core.StandardWrapperValveinvoke
SEVERE: Servlet.service() for servlet addItem threw exception
javax.servlet.ServletException: Servlet execution threw an exception
        at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter (
ApplicationFilterChain.java:313)
        at org.apache.catalina.core.ApplicationFilterChain.doFilter(
ApplicationFilterChain.java:206)
        at org.apache.catalina.core.StandardWrapperValve.invoke(
StandardWrapperValve.java :230)
        at org.apache.catalina.core.StandardContextValve.invoke(
StandardContextValve.java:175)
        at org.apache.catalina.core.StandardHostValve.invoke(
StandardHostValve.java:128)
        at org.apache.catalina.valves.ErrorReportValve.invoke (
ErrorReportValve.java:104)
        at org.apache.catalina.core.StandardEngineValve.invoke(
StandardEngineValve.java:109)
        at org.apache.catalina.connector.CoyoteAdapter.service(
CoyoteAdapter.java:261)
        at org.apache.coyote.http11.Http11Processor.process(
Http11Processor.java:844)
        at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(
Http11Protocol.java:581)
        at org.apache.tomcat.util.net.JIoEndpoint$Worker.run (
JIoEndpoint.java:447)
        at java.lang.Thread.run(Thread.java:619)


It seems that the exception occurs when I try to parse the request with :

List items = upload.parseRequest(request);
in my servlet code.

Heres my html page:

<html>
<head>
   <title>NeedTuNo Developer Index</title>
</head>
<body>
    <div id="main">
          <div id="sec_additem">
            <h1>Add Item</h1>
            <form action="/addItem" method="post"
enctype="multipart/form-data">
                Title: <input name="meta_title" />
                <br />
                Tags: <input name="tags" />
                <br />
                Summary: <input name="summary" type="text" />
                <br />
                File: <input name="filename" type="file" />
                <br />
                <input type="submit" value="Add Item!" />
            </form>
        </div>
    </div>

    <div id="footer">
        <p id="versionNum"></p>
    </div>
</body>
</html>


I am clueless, any help would be great !

thanks
Askar


Reply via email to