commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rhino" <rhi...@sympatico.ca>
Subject [FileUpload] Very Basic Question
Date Sun, 19 Dec 2004 17:38:57 GMT
Could someone kindly tell me where I should be putting the
commons-fileupload-1.0-jar when I deploy my Tomcat servlet to Tomcat? I've
searched high and low through mailing lists and FileUpload docs and I can't
find any mention of this.

My servlet compiles fine but when I deploy it to Tomcat (5.0.28) Tomcat
can't find the jar so that it can do the uploading and I get this:

---
type Exception report

message

description The server encountered an internal error () that prevented it
from fulfilling this request.

exception

javax.servlet.ServletException: Error instantiating servlet class
upload.FileUploadHandlerServlet

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118
)
	org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:705)
	org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:683)
	java.lang.Thread.run(Unknown Source)

root cause

java.lang.NoClassDefFoundError:
org/apache/commons/fileupload/FileUploadException
	java.lang.Class.getDeclaredConstructors0(Native Method)
	java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
	java.lang.Class.getConstructor0(Unknown Source)
	java.lang.Class.newInstance0(Unknown Source)
	java.lang.Class.newInstance(Unknown Source)

org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118
)
	org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
	org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)

org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConne
ction(Http11Protocol.java:705)
	org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)

org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.jav
a:683)
	java.lang.Thread.run(Unknown Source)

note The full stack trace of the root cause is available in the Apache
Tomcat/5.0.28 logs.

---

I think this is nature's way of telling me that I haven't got the FileUpload
jar in the right place. Apparently, Tomcat can't use the copy of the jar
that is in server/lib; as I understand it, this directory is only for
uploads done by the server, not by the applications. I would have tried it
in common/lib but I have specific instructions from Martin Cooper that say
"keep the FileUpload jar within your own web app, and don't try to share it
by putting it in common/lib".

So where DO I put the jar??? I suppose the answer should be obvious since I
can't find any evidence of anyone else ever asking it but it's eluding me.

Do I just drop the jar in the webapps/[MyAppName] folder? Won't that ensure
that I have to put it back there manually every time I redeploy the servlet?
Should I put the jar in the WAR file itself?

Any guidance would be appreciated!

Rhino
---
rhino1 AT sympatico DOT ca
"There are two ways of constructing a software design. One way is to make it
so simple that there are obviously no deficiencies. And the other way is to
make it so complicated that there are no obvious deficiencies." - C.A.R.
Hoare


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


Mime
View raw message