You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by Robert Christian <ro...@gmail.com> on 2008/12/12 07:44:56 UTC
error with "boolean isMultipart = ServletFileUpload.isMultipartContent(req);"
exception occurs at ApplicationFilterChain.internalDoFilter(ServletRequest,
ServletResponse) line: 310
using tomcat 6
commons-fileupload-1.2.1
commons-io-1.3.2
code looks like:
public void doPost(HttpServletRequest req, HttpServletResponse res)
throws ServletException, IOException {
try {
// Check that we have a file upload request
boolean isMultipart = ServletFileUpload.isMultipartContent(req);
// Create a new file upload handler
ServletFileUpload upload = new ServletFileUpload();
Re: error with "boolean isMultipart = ServletFileUpload.isMultipartContent(req);"
Posted by sebb <se...@gmail.com>.
On 18/12/2008, Robert Christian <ro...@gmail.com> wrote:
> I fixed the issue by adding servlet-api.jar to the jre/lib/ext directory,
> but this does not seem like the best solution. Shouldn't Tomcat load its
> own libs before running the web app?
That question is best asked on the Tomcat user list...
> On Wed, Dec 17, 2008 at 7:42 PM, Robert Christian <
>
> robertjchristian@gmail.com> wrote:
>
> > I found someone else with the same issue (using fileupload):
> > http://forums.sun.com/thread.jspa?threadID=5352575. They didn't have a
> > clear resolution, just reported that they "cleaned up."
> >
> > I reinstalled tomcat6 from scratch and ran the app in standalone (deployed
> > to tomcat, no eclipse), and the issue persisted.
> >
> > I verified that $TOMCAT_HOME/lib contains the servlet-api.jar, which
> > contains the javax/servlet/http/HttpServletRequest class.
> >
> > Here's the response:
> >
> > HTTP Status 500 -
> >
> > type Exception report
> >
> > message
> >
> > description The server encountered an internal error () that prevented
> > it from fulfilling this request.
> >
> > exception
> >
> > javax.servlet.ServletException: Servlet execution threw an exception
> >
> > root cause
> >
> > java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
> >
> > org.apache.commons.fileupload.servlet.ServletFileUpload.isMultipartContent(ServletFileUpload.java:68)
> > com.iojunky.core.UploadServlet.doPost(UploadServlet.java:54)
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> > javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
> >
> > note The full stack trace of the root cause is available in the Apache
> > Tomcat/6.0.14 logs.
> >
> > So, Tomcat says it can't find a class that is clearly in the path. Any
> > ideas would be helpful.
> >
> > On Fri, Dec 12, 2008 at 6:26 PM, Martin Cooper <ma...@apache.org> wrote:
> >
> >> On Fri, Dec 12, 2008 at 6:21 PM, Robert Christian <
> >> robertjchristian@gmail.com> wrote:
> >>
> >> > The stack output is from the Tomcat layer:
> >>
> >>
> >> I see nothing in that stack trace that suggests any connection to
> >> FileUpload. What makes you think there's a connection?
> >>
> >> --
> >> Martin Cooper
> >>
> >>
> >>
> >> > SEVERE: Servlet.service() for servlet hello 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:233)
> >> > 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:102)
> >> > at
> >> >
> >> >
> >> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> >> > at
> >> >
> >> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
> >> > at
> >> >
> >> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> >> > at
> >> >
> >> >
> >> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
> >> > at
> >> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> >> > at java.lang.Thread.run(Thread.java:619)
> >> >
> >> > The root exception is a java.security.AccessControlException. I am
> >> using
> >> > the out-of-the-box catalina.policy.
> >> >
> >> > On Thu, Dec 11, 2008 at 10:44 PM, Robert Christian <
> >> > robertjchristian@gmail.com> wrote:
> >> >
> >> > > exception occurs at
> >> > ApplicationFilterChain.internalDoFilter(ServletRequest,
> >> > > ServletResponse) line: 310
> >> > >
> >> > > using tomcat 6
> >> > > commons-fileupload-1.2.1
> >> > > commons-io-1.3.2
> >> > >
> >> > > code looks like:
> >> > >
> >> > > public void doPost(HttpServletRequest req, HttpServletResponse res)
> >> > > throws ServletException, IOException {
> >> > >
> >> > > try {
> >> > > // Check that we have a file upload request
> >> > > boolean isMultipart =
> >> > > ServletFileUpload.isMultipartContent(req);
> >> > >
> >> > > // Create a new file upload handler
> >> > > ServletFileUpload upload = new ServletFileUpload();
> >> > >
> >> >
> >>
> >
> >
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org
Re: error with "boolean isMultipart = ServletFileUpload.isMultipartContent(req);"
Posted by Robert Christian <ro...@gmail.com>.
I fixed the issue by adding servlet-api.jar to the jre/lib/ext directory,
but this does not seem like the best solution. Shouldn't Tomcat load its
own libs before running the web app?
On Wed, Dec 17, 2008 at 7:42 PM, Robert Christian <
robertjchristian@gmail.com> wrote:
> I found someone else with the same issue (using fileupload):
> http://forums.sun.com/thread.jspa?threadID=5352575. They didn't have a
> clear resolution, just reported that they "cleaned up."
>
> I reinstalled tomcat6 from scratch and ran the app in standalone (deployed
> to tomcat, no eclipse), and the issue persisted.
>
> I verified that $TOMCAT_HOME/lib contains the servlet-api.jar, which
> contains the javax/servlet/http/HttpServletRequest class.
>
> Here's the response:
>
> HTTP Status 500 -
>
> type Exception report
>
> message
>
> description The server encountered an internal error () that prevented
> it from fulfilling this request.
>
> exception
>
> javax.servlet.ServletException: Servlet execution threw an exception
>
> root cause
>
> java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
>
> org.apache.commons.fileupload.servlet.ServletFileUpload.isMultipartContent(ServletFileUpload.java:68)
> com.iojunky.core.UploadServlet.doPost(UploadServlet.java:54)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
> javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
>
> note The full stack trace of the root cause is available in the Apache
> Tomcat/6.0.14 logs.
>
> So, Tomcat says it can't find a class that is clearly in the path. Any
> ideas would be helpful.
>
> On Fri, Dec 12, 2008 at 6:26 PM, Martin Cooper <ma...@apache.org> wrote:
>
>> On Fri, Dec 12, 2008 at 6:21 PM, Robert Christian <
>> robertjchristian@gmail.com> wrote:
>>
>> > The stack output is from the Tomcat layer:
>>
>>
>> I see nothing in that stack trace that suggests any connection to
>> FileUpload. What makes you think there's a connection?
>>
>> --
>> Martin Cooper
>>
>>
>>
>> > SEVERE: Servlet.service() for servlet hello 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:233)
>> > 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:102)
>> > at
>> >
>> >
>> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
>> > at
>> >
>> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
>> > at
>> >
>> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
>> > at
>> >
>> >
>> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
>> > at
>> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
>> > at java.lang.Thread.run(Thread.java:619)
>> >
>> > The root exception is a java.security.AccessControlException. I am
>> using
>> > the out-of-the-box catalina.policy.
>> >
>> > On Thu, Dec 11, 2008 at 10:44 PM, Robert Christian <
>> > robertjchristian@gmail.com> wrote:
>> >
>> > > exception occurs at
>> > ApplicationFilterChain.internalDoFilter(ServletRequest,
>> > > ServletResponse) line: 310
>> > >
>> > > using tomcat 6
>> > > commons-fileupload-1.2.1
>> > > commons-io-1.3.2
>> > >
>> > > code looks like:
>> > >
>> > > public void doPost(HttpServletRequest req, HttpServletResponse res)
>> > > throws ServletException, IOException {
>> > >
>> > > try {
>> > > // Check that we have a file upload request
>> > > boolean isMultipart =
>> > > ServletFileUpload.isMultipartContent(req);
>> > >
>> > > // Create a new file upload handler
>> > > ServletFileUpload upload = new ServletFileUpload();
>> > >
>> >
>>
>
>
Re: error with "boolean isMultipart = ServletFileUpload.isMultipartContent(req);"
Posted by Robert Christian <ro...@gmail.com>.
I found someone else with the same issue (using fileupload):
http://forums.sun.com/thread.jspa?threadID=5352575. They didn't have a
clear resolution, just reported that they "cleaned up."
I reinstalled tomcat6 from scratch and ran the app in standalone (deployed
to tomcat, no eclipse), and the issue persisted.
I verified that $TOMCAT_HOME/lib contains the servlet-api.jar, which
contains the javax/servlet/http/HttpServletRequest class.
Here's the response:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented
it from fulfilling this request.
exception
javax.servlet.ServletException: Servlet execution threw an exception
root cause
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
org.apache.commons.fileupload.servlet.ServletFileUpload.isMultipartContent(ServletFileUpload.java:68)
com.iojunky.core.UploadServlet.doPost(UploadServlet.java:54)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
note The full stack trace of the root cause is available in the Apache
Tomcat/6.0.14 logs.
So, Tomcat says it can't find a class that is clearly in the path. Any
ideas would be helpful.
On Fri, Dec 12, 2008 at 6:26 PM, Martin Cooper <ma...@apache.org> wrote:
> On Fri, Dec 12, 2008 at 6:21 PM, Robert Christian <
> robertjchristian@gmail.com> wrote:
>
> > The stack output is from the Tomcat layer:
>
>
> I see nothing in that stack trace that suggests any connection to
> FileUpload. What makes you think there's a connection?
>
> --
> Martin Cooper
>
>
>
> > SEVERE: Servlet.service() for servlet hello 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:233)
> > 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:102)
> > at
> >
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> > at
> >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
> > at
> >
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> > at
> >
> >
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
> > at
> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> > at java.lang.Thread.run(Thread.java:619)
> >
> > The root exception is a java.security.AccessControlException. I am using
> > the out-of-the-box catalina.policy.
> >
> > On Thu, Dec 11, 2008 at 10:44 PM, Robert Christian <
> > robertjchristian@gmail.com> wrote:
> >
> > > exception occurs at
> > ApplicationFilterChain.internalDoFilter(ServletRequest,
> > > ServletResponse) line: 310
> > >
> > > using tomcat 6
> > > commons-fileupload-1.2.1
> > > commons-io-1.3.2
> > >
> > > code looks like:
> > >
> > > public void doPost(HttpServletRequest req, HttpServletResponse res)
> > > throws ServletException, IOException {
> > >
> > > try {
> > > // Check that we have a file upload request
> > > boolean isMultipart =
> > > ServletFileUpload.isMultipartContent(req);
> > >
> > > // Create a new file upload handler
> > > ServletFileUpload upload = new ServletFileUpload();
> > >
> >
>
Re: error with "boolean isMultipart = ServletFileUpload.isMultipartContent(req);"
Posted by Robert Christian <ro...@gmail.com>.
With the same configuration and servlet, I was able to stream the http
request to s3. Then I dropped in commons-fileupload and pasted the example,
and it broke on the first line of code. That made the fileupload code
suspect, so I thought I would air the issue in case it's common. Sounds
like the burden of proof is back on me, so I will dig deeper and let you
know what I find out.
Thanks.
On Fri, Dec 12, 2008 at 6:26 PM, Martin Cooper <ma...@apache.org> wrote:
> On Fri, Dec 12, 2008 at 6:21 PM, Robert Christian <
> robertjchristian@gmail.com> wrote:
>
> > The stack output is from the Tomcat layer:
>
>
> I see nothing in that stack trace that suggests any connection to
> FileUpload. What makes you think there's a connection?
>
> --
> Martin Cooper
>
>
>
> > SEVERE: Servlet.service() for servlet hello 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:233)
> > 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:102)
> > at
> >
> >
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> > at
> >
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
> > at
> >
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> > at
> >
> >
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
> > at
> > org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> > at java.lang.Thread.run(Thread.java:619)
> >
> > The root exception is a java.security.AccessControlException. I am using
> > the out-of-the-box catalina.policy.
> >
> > On Thu, Dec 11, 2008 at 10:44 PM, Robert Christian <
> > robertjchristian@gmail.com> wrote:
> >
> > > exception occurs at
> > ApplicationFilterChain.internalDoFilter(ServletRequest,
> > > ServletResponse) line: 310
> > >
> > > using tomcat 6
> > > commons-fileupload-1.2.1
> > > commons-io-1.3.2
> > >
> > > code looks like:
> > >
> > > public void doPost(HttpServletRequest req, HttpServletResponse res)
> > > throws ServletException, IOException {
> > >
> > > try {
> > > // Check that we have a file upload request
> > > boolean isMultipart =
> > > ServletFileUpload.isMultipartContent(req);
> > >
> > > // Create a new file upload handler
> > > ServletFileUpload upload = new ServletFileUpload();
> > >
> >
>
Re: error with "boolean isMultipart = ServletFileUpload.isMultipartContent(req);"
Posted by Martin Cooper <ma...@apache.org>.
On Fri, Dec 12, 2008 at 6:21 PM, Robert Christian <
robertjchristian@gmail.com> wrote:
> The stack output is from the Tomcat layer:
I see nothing in that stack trace that suggests any connection to
FileUpload. What makes you think there's a connection?
--
Martin Cooper
> SEVERE: Servlet.service() for servlet hello 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:233)
> 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:102)
> at
>
> org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
> at
> org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
> at
> org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
> at
>
> org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
> at
> org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
> at java.lang.Thread.run(Thread.java:619)
>
> The root exception is a java.security.AccessControlException. I am using
> the out-of-the-box catalina.policy.
>
> On Thu, Dec 11, 2008 at 10:44 PM, Robert Christian <
> robertjchristian@gmail.com> wrote:
>
> > exception occurs at
> ApplicationFilterChain.internalDoFilter(ServletRequest,
> > ServletResponse) line: 310
> >
> > using tomcat 6
> > commons-fileupload-1.2.1
> > commons-io-1.3.2
> >
> > code looks like:
> >
> > public void doPost(HttpServletRequest req, HttpServletResponse res)
> > throws ServletException, IOException {
> >
> > try {
> > // Check that we have a file upload request
> > boolean isMultipart =
> > ServletFileUpload.isMultipartContent(req);
> >
> > // Create a new file upload handler
> > ServletFileUpload upload = new ServletFileUpload();
> >
>
Re: error with "boolean isMultipart = ServletFileUpload.isMultipartContent(req);"
Posted by Robert Christian <ro...@gmail.com>.
The stack output is from the Tomcat layer:
SEVERE: Servlet.service() for servlet hello 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:233)
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:102)
at
org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
at
org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
at
org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
at
org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
at java.lang.Thread.run(Thread.java:619)
The root exception is a java.security.AccessControlException. I am using
the out-of-the-box catalina.policy.
On Thu, Dec 11, 2008 at 10:44 PM, Robert Christian <
robertjchristian@gmail.com> wrote:
> exception occurs at ApplicationFilterChain.internalDoFilter(ServletRequest,
> ServletResponse) line: 310
>
> using tomcat 6
> commons-fileupload-1.2.1
> commons-io-1.3.2
>
> code looks like:
>
> public void doPost(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException {
>
> try {
> // Check that we have a file upload request
> boolean isMultipart =
> ServletFileUpload.isMultipartContent(req);
>
> // Create a new file upload handler
> ServletFileUpload upload = new ServletFileUpload();
>
Re: error with "boolean isMultipart = ServletFileUpload.isMultipartContent(req);"
Posted by sebb <se...@gmail.com>.
On 12/12/2008, Robert Christian <ro...@gmail.com> wrote:
> exception occurs at ApplicationFilterChain.internalDoFilter(ServletRequest,
> ServletResponse) line: 310
and what are the exception details?
> using tomcat 6
> commons-fileupload-1.2.1
> commons-io-1.3.2
>
> code looks like:
>
> public void doPost(HttpServletRequest req, HttpServletResponse res)
> throws ServletException, IOException {
>
> try {
> // Check that we have a file upload request
> boolean isMultipart = ServletFileUpload.isMultipartContent(req);
>
> // Create a new file upload handler
> ServletFileUpload upload = new ServletFileUpload();
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@commons.apache.org
For additional commands, e-mail: user-help@commons.apache.org