commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Cooper <mart...@apache.org>
Subject RE: Commons Upload Problems...
Date Wed, 04 Jun 2003 19:35:06 GMT


On Wed, 4 Jun 2003, Wilson, Allen wrote:

> Yes..I have...I checked over and over...I actually even tried un-jarring
> the jar file into the correct path...yet I still get errors

I see you're using Tomcat. Depending on the version of Tomcat, that may
have its own FileUpload jar in it somewhere, and that may be causing the
problem.

You won't be able to replace Tomcat's version with RC1 because of API
changes, but you should be able to ensure that your web app picks up your
copy of FileUpload instead of the one bundled with Tomcat.

--
Martin Cooper


>
> Allen
>
> -----Original Message-----
> From: Martin Cooper [mailto:martinc@apache.org]
> Sent: Wednesday, June 04, 2003 1:49 PM
> To: Jakarta Commons Developers List
> Subject: RE: Commons Upload Problems...
>
>
>
>
> On Wed, 4 Jun 2003, Wilson, Allen wrote:
>
> > Okay...
> >
> > I have change to the RC1 version and I am getting some of the same
> > things....here is the exception listings....
>
> Are you sure you don't still have an old jar in your classpath? I'm
> using
> the RC1 build without problems.
>
> --
> Martin Cooper
>
>
> >
> > message
> >
> > description The server encountered an internal error () that prevented
> > it from fulfilling this request.
> >
> > exception
> >
> > javax.servlet.ServletException: Servlet execution threw an exception
> > 	at java.lang.Throwable.fillInStackTrace(Native Method)
> > 	at java.lang.Throwable.fillInStackTrace(Compiled Code)
> > 	at java.lang.Throwable.(Compiled Code)
> > 	at java.lang.Exception.(Compiled Code)
> > 	at javax.servlet.ServletException.(Compiled Code)
> > 	at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Compile
> > d Code)
> > 	at
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(Compiled
> Code)
> > 	at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
> > 	at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Compile
> > d Code)
> > 	at
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(Compiled
> Code)
> > 	at org.apache.catalina.core.StandardWrapperValve.invoke(Compiled
> > Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at org.apache.catalina.core.StandardPipeline.invoke(Compiled
> > Code)
> > 	at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
> > 	at org.apache.catalina.core.StandardContextValve.invoke(Compiled
> > Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at
> >
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
> > Base.java:493)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at org.apache.catalina.core.StandardPipeline.invoke(Compiled
> > Code)
> > 	at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
> > 	at org.apache.catalina.core.StandardContext.invoke(Compiled
> > Code)
> > 	at org.apache.catalina.core.StandardHostValve.invoke(Compiled
> > Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at
> > org.apache.catalina.valves.ErrorDispatcherValve.invoke(Compiled Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at org.apache.catalina.valves.ErrorReportValve.invoke(Compiled
> > Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at org.apache.catalina.valves.AccessLogValve.invoke(Compiled
> > Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at org.apache.catalina.core.StandardPipeline.invoke(Compiled
> > Code)
> > 	at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
> > 	at org.apache.catalina.core.StandardEngineValve.invoke(Compiled
> > Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at org.apache.catalina.core.StandardPipeline.invoke(Compiled
> > Code)
> > 	at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
> > 	at org.apache.coyote.tomcat4.CoyoteAdapter.service(Compiled
> > Code)
> > 	at org.apache.coyote.http11.Http11Processor.process(Compiled
> > Code)
> > 	at
> >
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
> > onnection(Compiled Code)
> > 	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Compiled
> > Code)
> > 	at
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Compiled
> > Code)
> > 	at java.lang.Thread.run(Thread.java:479)
> >
> >
> > root cause
> >
> > java.lang.NoSuchMethodError:
> > org.apache.commons.fileupload.MultipartStream: method
> > setHeaderEncoding(Ljava/lang/String;)V not found
> > 	at
> > org.apache.commons.fileupload.FileUploadBase.parseRequest(Compiled
> Code)
> > 	at FileTransfer.doPost(FileTransfer.java:37)
> > 	at javax.servlet.http.HttpServlet.service(Compiled Code)
> > 	at javax.servlet.http.HttpServlet.service(Compiled Code)
> > 	at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Compile
> > d Code)
> > 	at
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(Compiled
> Code)
> > 	at filters.ExampleFilter.doFilter(ExampleFilter.java:149)
> > 	at
> >
> org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Compile
> > d Code)
> > 	at
> > org.apache.catalina.core.ApplicationFilterChain.doFilter(Compiled
> Code)
> > 	at org.apache.catalina.core.StandardWrapperValve.invoke(Compiled
> > Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at org.apache.catalina.core.StandardPipeline.invoke(Compiled
> > Code)
> > 	at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
> > 	at org.apache.catalina.core.StandardContextValve.invoke(Compiled
> > Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at
> >
> org.apache.catalina.authenticator.AuthenticatorBase.invoke(Authenticator
> > Base.java:493)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at org.apache.catalina.core.StandardPipeline.invoke(Compiled
> > Code)
> > 	at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
> > 	at org.apache.catalina.core.StandardContext.invoke(Compiled
> > Code)
> > 	at org.apache.catalina.core.StandardHostValve.invoke(Compiled
> > Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at
> > org.apache.catalina.valves.ErrorDispatcherValve.invoke(Compiled Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at org.apache.catalina.valves.ErrorReportValve.invoke(Compiled
> > Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at org.apache.catalina.valves.AccessLogValve.invoke(Compiled
> > Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at org.apache.catalina.core.StandardPipeline.invoke(Compiled
> > Code)
> > 	at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
> > 	at org.apache.catalina.core.StandardEngineValve.invoke(Compiled
> > Code)
> > 	at
> >
> org.apache.catalina.core.StandardPipeline$StandardPipelineValveContext.i
> > nvokeNext(Compiled Code)
> > 	at org.apache.catalina.core.StandardPipeline.invoke(Compiled
> > Code)
> > 	at org.apache.catalina.core.ContainerBase.invoke(Compiled Code)
> > 	at org.apache.coyote.tomcat4.CoyoteAdapter.service(Compiled
> > Code)
> > 	at org.apache.coyote.http11.Http11Processor.process(Compiled
> > Code)
> > 	at
> >
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processC
> > onnection(Compiled Code)
> > 	at org.apache.tomcat.util.net.TcpWorkerThread.runIt(Compiled
> > Code)
> > 	at
> > org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(Compiled
> > Code)
> > 	at java.lang.Thread.run(Thread.java:479)
> >
> >
> > -----Original Message-----
> > From: Martin Cooper [mailto:martinc@apache.org]
> > Sent: Wednesday, June 04, 2003 12:53 PM
> > To: Jakarta Commons Developers List
> > Subject: Re: Commons Upload Problems...
> >
> >
> > It seems that the version of FileUpload you are using is inconsistent
> > with
> > the code you are writing. You are writing to the new API (good!), but
> > the
> > version of FileUpload you are using has the old API (bad). If you grab
> > the
> > latest version of FileUpload, you should be fine. (The RC1 version is
> > up,
> > it's just not announced yet.)
> >
> > --
> > Martin Cooper
> >
> >
> > On Wed, 4 Jun 2003, Wilson, Allen wrote:
> >
> > > Hello...
> > >
> > >
> > > I've posted messages in reference to using the FileUpload and it
> seems
> > > that I am still having problems. I am now trying to put the class
> > > together line by line so that if I run into problems I can
> > successfully
> > > identify the line and try to fix the problem/exception error. Here
> is
> > > the code I have so far and it gives me the following error:
> > >
> > > javax.servlet.ServletException: Servlet execution threw an exception
> > >
> > > With the root cause information of:
> > >
> > > java.lang.NoSuchMethodError:
> > > org.apache.commons.fileupload.DefaultFileItem: method
> > >
> >
> (Ljava/lang/String;Ljava/lang/String;ZLjava/lang/String;ILjava/io/File;)
> > > V not found
> > > 	at
> > >
> >
> org.apache.commons.fileupload.DefaultFileItemFactory.createItem(DefaultF
> > > ileItemFactory.java:231)
> > > 	at
> > > org.apache.commons.fileupload.FileUploadBase.createItem(Compiled
> Code)
> > > 	at
> > > org.apache.commons.fileupload.FileUploadBase.parseRequest(Compiled
> > Code)
> > > 	at FileTransfer.doPost(FileTransfer.java:37)
> > >
> > >
> > > The code:
> > >
> > > import java.io.*;
> > > import java.util.*;
> > > import javax.servlet.*;
> > > import java.sql.*;
> > > import javax.servlet.http.*;
> > >
> > > import org.apache.commons.fileupload.*;
> > >
> > > public class FileTransfer extends HttpServlet
> > > {
> > > 	private String strSQLStart = "Insert into tblPortal Files (";
> > > 	private String strSQLMid   = " rec_id, dateupload) values (";
> > > 	private String strSQLEnd   = " Null, curdate())";
> > >
> > > 	private String fieldnames =  "";
> > > 	private String fieldvalues = "";
> > >
> > > 	public void doPost(HttpServletRequest req, HttpServletResponse
> > > res)
> > > 	throws ServletException, IOException
> > > 	{
> > > 	res.setContentType("text/html");
> > > 	PrintWriter out = res.getWriter();
> > >
> > > 	DiskFileUpload upload = new DiskFileUpload();
> > >
> > > 	//set paramaters for files
> > > 	upload.setSizeMax(10000);
> > > 	upload.setRepositoryPath("/tmp");
> > >
> > > 	out.println("<html>");
> > > 	out.println("<head><title>MARC Research File
> > > Upload</title></head>");
> > > 	out.println("<body>");
> > > 	out.println("File Upload Parameters:");
> > >
> > > 	try
> > > 	{
> > > 	List uploadItems = upload.parseRequest(req);
> > > <-------- This is line 37
> > > 	}
> > >
> > > 	catch (FileUploadException fue)
> > > 	{
> > > 	fue.printStackTrace(out);
> > > 	}
> > >
> > > 	out.println("</body></html>");
> > > 	}
> > > }
> > >
> > >
> > > I am trying to figure my way through it and any help would be
> > > appreciated.....
> > >
> > >
> > > Thanks....Allen
> > >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-dev-help@jakarta.apache.org
> >
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-dev-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message