- 浏览: 166213 次
- 性别:
- 来自: 北京
最新评论
-
bzhao:
我调试好像没起作用啊!
java正则表达式的中的问号 -
老汉学编程:
这两天被一个问题折磨,
//引入的类
import ...
HttpURLConnection用法详解 -
channel238:
看完以后不得不登陆来顶楼主,写得很详细,。以后忘了当资料查
HttpURLConnection用法详解 -
511754646:
兄弟你这个问题解决了么?我现在也遇到类似问题,如果搞掂了请联系 ...
Failed to parse multipart request -
ksmjava:
太给力啦,赞啊~~~~~~~~~~谢谢您啊,恩人哪,呵呵 ,开 ...
HTML map标签
> -----Original Message-----
> From: Sharma, Kamlesh [RA] [mailto:KAMLESH.SHARMA@saic.com]
> Sent: Wednesday, April 28, 2004 1:37 PM
> To: commons-user@jakarta.apache.org
> Subject: Re:File upload exception
>
>
> Hi, All
>
> I am receiving following exception, while uploading the file
> using struts. I
> am
> using Weblogic 8.1 server. However, I am able to process the file and the
> server is throwing this exception. Kindly help, thanks in advance.
You cannot use the getParameter() family of calls if you're using FileUpload
to parse the request. It would appear that you are trying to use both to
process the same request, which isn't going to work. If you're using
FileUpload to parse a multipart request, you'll need to make sure you don't
call any of the getParameter() family of methods.--
Martin Cooper
>
> <Apr 27, 2004 10:05:41 AM EDT> <Warning> <HTTP> <BEA-101138>
> <ServletContext(id=
> 4404549,name=R1,context-path=/R1) One of the getParameter family
> of methods
> call
> ed after reading from the ServletInputStream. Not merging post
> parameters.>
> <2004-04-27 09:46:31,972> [ERROR] - Failed to parse multipart request
> (CommonsM
> ultipartRequestHandler.java:241)
> org.apache.commons.fileupload.FileUploadException: Processing of
> multipart/form-
> data request failed. EOF after reading only: '0' of: '1230'
> promised bytes,
> out
> of which at least: '0' were already buffered
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadB
> ase.java:429)
> at
> org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
> (CommonsMultipartRequestHandler.java:233)
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1209)
> at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
> essor.java:821)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:254)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
> (ServletStubImpl.java:1053)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:387)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:305)
> at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
> n.run(WebAppServletContext.java:6291)
> at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
> dSubject.java:317)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
> 97)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> rvletContext.java:3575)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> pl.java:2573)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
> <2004-04-27 09:46:31,972> [ERROR] - Failed to parse multipart request
> (CommonsM
> ultipartRequestHandler.java:241)
> org.apache.commons.fileupload.FileUploadException: Processing of
> multipart/form-
> data request failed. EOF after reading only: '0' of: '1230'
> promised bytes,
> out
> of which at least: '0' were already buffered
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadB
> ase.java:429)
> at
> org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
> (CommonsMultipartRequestHandler.java:233)
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1209)
> at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
> essor.java:821)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:254)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
> (ServletStubImpl.java:1053)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:387)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:305)
> at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
> n.run(WebAppServletContext.java:6291)
> at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
> dSubject.java:317)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
> 97)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> rvletContext.java:3575)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> pl.java:2573)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
> <Apr 27, 2004 9:46:31 AM EDT> <Error> <HTTP> <BEA-101017>
> <[ServletContext(id=44
> 04549,name=R1,context-path=/R1)] Root cause of ServletException.
> org.apache.commons.fileupload.FileUploadException: Processing of
> multipart/form-
> data request failed. EOF after reading only: '0' of: '1230'
> promised bytes,
> out
> of which at least: '0' were already buffered
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadB
> ase.java:429)
> at
> org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
> (CommonsMultipartRequestHandler.java:233)
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1209)
> at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
> essor.java:821)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:254)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
> (ServletStubImpl.java:1053)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:387)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:305)
> at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
> n.run(WebAppServletContext.java:6291)
> at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
> dSubject.java:317)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
> 97)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> rvletContext.java:3575)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> pl.java:2573)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
> >
> <2004-04-27 10:05:18,974> [INFO ] - Find SQL:SELECT orgID,
> orgContactInfoID, ah
> aID, cmsID, compFollowed, deactReason, denialCmt, enrollNum, exemptOrg,
> facility
> , facType, groupType, groupTypeOth, holdCmt, jPasswrd, medID, modifyUser,
> name,
> orgAdmUsername, status FROM Organization
> (OrganizationDAOImpl.java:311)
> <Apr 27, 2004 10:05:41 AM EDT> <Warning> <HTTP> <BEA-101138>
> <ServletContext(id=
> 4404549,name=R1,context-path=/R1) One of the getParameter family
> of methods
> call
> ed after reading from the ServletInputStream. Not merging post
> parameters.>
> <2004-04-27 10:05:42,207> [ERROR] - Failed to parse multipart request
> (CommonsM
> ultipartRequestHandler.java:241)
> org.apache.commons.fileupload.FileUploadException: Processing of
> multipart/form-
> data request failed. EOF after reading only: '0' of: '1412'
> promised bytes,
> out
> of which at least: '0' were already buffered
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadB
> ase.java:429)
> at
> org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
> (CommonsMultipartRequestHandler.java:233)
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1209)
> at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
> essor.java:821)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:254)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
> (ServletStubImpl.java:1053)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:387)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:305)
> at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
> n.run(WebAppServletContext.java:6291)
> at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
> dSubject.java:317)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
> 97)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> rvletContext.java:3575)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> pl.java:2573)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
> <2004-04-27 10:05:42,207> [ERROR] - Failed to parse multipart request
> (CommonsM
> ultipartRequestHandler.java:241)
> org.apache.commons.fileupload.FileUploadException: Processing of
> multipart/form-
> data request failed. EOF after reading only: '0' of: '1412'
> promised bytes,
> out
> of which at least: '0' were already buffered
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadB
> ase.java:429)
> at
> org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
> (CommonsMultipartRequestHandler.java:233)
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1209)
> at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
> essor.java:821)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:254)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
> (ServletStubImpl.java:1053)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:387)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:305)
> at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
> n.run(WebAppServletContext.java:6291)
> at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
> dSubject.java:317)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
> 97)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> rvletContext.java:3575)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> pl.java:2573)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
>
> Regards
> Kam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
> From: Sharma, Kamlesh [RA] [mailto:KAMLESH.SHARMA@saic.com]
> Sent: Wednesday, April 28, 2004 1:37 PM
> To: commons-user@jakarta.apache.org
> Subject: Re:File upload exception
>
>
> Hi, All
>
> I am receiving following exception, while uploading the file
> using struts. I
> am
> using Weblogic 8.1 server. However, I am able to process the file and the
> server is throwing this exception. Kindly help, thanks in advance.
You cannot use the getParameter() family of calls if you're using FileUpload
to parse the request. It would appear that you are trying to use both to
process the same request, which isn't going to work. If you're using
FileUpload to parse a multipart request, you'll need to make sure you don't
call any of the getParameter() family of methods.--
Martin Cooper
>
> <Apr 27, 2004 10:05:41 AM EDT> <Warning> <HTTP> <BEA-101138>
> <ServletContext(id=
> 4404549,name=R1,context-path=/R1) One of the getParameter family
> of methods
> call
> ed after reading from the ServletInputStream. Not merging post
> parameters.>
> <2004-04-27 09:46:31,972> [ERROR] - Failed to parse multipart request
> (CommonsM
> ultipartRequestHandler.java:241)
> org.apache.commons.fileupload.FileUploadException: Processing of
> multipart/form-
> data request failed. EOF after reading only: '0' of: '1230'
> promised bytes,
> out
> of which at least: '0' were already buffered
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadB
> ase.java:429)
> at
> org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
> (CommonsMultipartRequestHandler.java:233)
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1209)
> at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
> essor.java:821)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:254)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
> (ServletStubImpl.java:1053)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:387)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:305)
> at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
> n.run(WebAppServletContext.java:6291)
> at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
> dSubject.java:317)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
> 97)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> rvletContext.java:3575)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> pl.java:2573)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
> <2004-04-27 09:46:31,972> [ERROR] - Failed to parse multipart request
> (CommonsM
> ultipartRequestHandler.java:241)
> org.apache.commons.fileupload.FileUploadException: Processing of
> multipart/form-
> data request failed. EOF after reading only: '0' of: '1230'
> promised bytes,
> out
> of which at least: '0' were already buffered
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadB
> ase.java:429)
> at
> org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
> (CommonsMultipartRequestHandler.java:233)
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1209)
> at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
> essor.java:821)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:254)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
> (ServletStubImpl.java:1053)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:387)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:305)
> at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
> n.run(WebAppServletContext.java:6291)
> at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
> dSubject.java:317)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
> 97)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> rvletContext.java:3575)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> pl.java:2573)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
> <Apr 27, 2004 9:46:31 AM EDT> <Error> <HTTP> <BEA-101017>
> <[ServletContext(id=44
> 04549,name=R1,context-path=/R1)] Root cause of ServletException.
> org.apache.commons.fileupload.FileUploadException: Processing of
> multipart/form-
> data request failed. EOF after reading only: '0' of: '1230'
> promised bytes,
> out
> of which at least: '0' were already buffered
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadB
> ase.java:429)
> at
> org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
> (CommonsMultipartRequestHandler.java:233)
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1209)
> at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
> essor.java:821)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:254)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
> (ServletStubImpl.java:1053)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:387)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:305)
> at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
> n.run(WebAppServletContext.java:6291)
> at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
> dSubject.java:317)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
> 97)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> rvletContext.java:3575)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> pl.java:2573)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
> >
> <2004-04-27 10:05:18,974> [INFO ] - Find SQL:SELECT orgID,
> orgContactInfoID, ah
> aID, cmsID, compFollowed, deactReason, denialCmt, enrollNum, exemptOrg,
> facility
> , facType, groupType, groupTypeOth, holdCmt, jPasswrd, medID, modifyUser,
> name,
> orgAdmUsername, status FROM Organization
> (OrganizationDAOImpl.java:311)
> <Apr 27, 2004 10:05:41 AM EDT> <Warning> <HTTP> <BEA-101138>
> <ServletContext(id=
> 4404549,name=R1,context-path=/R1) One of the getParameter family
> of methods
> call
> ed after reading from the ServletInputStream. Not merging post
> parameters.>
> <2004-04-27 10:05:42,207> [ERROR] - Failed to parse multipart request
> (CommonsM
> ultipartRequestHandler.java:241)
> org.apache.commons.fileupload.FileUploadException: Processing of
> multipart/form-
> data request failed. EOF after reading only: '0' of: '1412'
> promised bytes,
> out
> of which at least: '0' were already buffered
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadB
> ase.java:429)
> at
> org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
> (CommonsMultipartRequestHandler.java:233)
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1209)
> at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
> essor.java:821)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:254)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
> (ServletStubImpl.java:1053)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:387)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:305)
> at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
> n.run(WebAppServletContext.java:6291)
> at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
> dSubject.java:317)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
> 97)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> rvletContext.java:3575)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> pl.java:2573)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
> <2004-04-27 10:05:42,207> [ERROR] - Failed to parse multipart request
> (CommonsM
> ultipartRequestHandler.java:241)
> org.apache.commons.fileupload.FileUploadException: Processing of
> multipart/form-
> data request failed. EOF after reading only: '0' of: '1412'
> promised bytes,
> out
> of which at least: '0' were already buffered
> at
> org.apache.commons.fileupload.FileUploadBase.parseRequest(FileUploadB
> ase.java:429)
> at
> org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest
> (CommonsMultipartRequestHandler.java:233)
> at
> org.apache.struts.util.RequestUtils.populate(RequestUtils.java:1209)
> at
> org.apache.struts.action.RequestProcessor.processPopulate(RequestProc
> essor.java:821)
> at
> org.apache.struts.action.RequestProcessor.process(RequestProcessor.ja
> va:254)
> at
> org.apache.struts.action.ActionServlet.process(ActionServlet.java:148
> 2)
> at
> org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
> at
> weblogic.servlet.internal.ServletStubImpl$ServletInvocationAction.run
> (ServletStubImpl.java:1053)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:387)
> at
> weblogic.servlet.internal.ServletStubImpl.invokeServlet(ServletStubIm
> pl.java:305)
> at
> weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
> n.run(WebAppServletContext.java:6291)
> at
> weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
> dSubject.java:317)
> at
> weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
> 97)
> at
> weblogic.servlet.internal.WebAppServletContext.invokeServlet(WebAppSe
> rvletContext.java:3575)
> at
> weblogic.servlet.internal.ServletRequestImpl.execute(ServletRequestIm
> pl.java:2573)
> at weblogic.kernel.ExecuteThread.execute(ExecuteThread.java:178)
> at weblogic.kernel.ExecuteThread.run(ExecuteThread.java:151)
>
> Regards
> Kam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@struts.apache.org
> For additional commands, e-mail: user-help@struts.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org
评论
2 楼
511754646
2011-04-24
兄弟你这个问题解决了么?我现在也遇到类似问题,如果搞掂了请联系联系,谢谢了!!!QQ:511754646
本人问题:web项目,tomcat上上传功能OK的,项目迁移到weblogic10中以后,文件能上传,但是会报类似你帖的那个问题。请求帮助ing!!!!
本人问题:web项目,tomcat上上传功能OK的,项目迁移到weblogic10中以后,文件能上传,但是会报类似你帖的那个问题。请求帮助ing!!!!
1 楼
blgaici1
2010-11-09
发表评论
-
SmartUpload
2010-10-02 13:54 1977回到了北京,过的第一 ... -
DOM解析XML
2010-05-19 14:50 1262To manipulate an XML document, ... -
Cannot find message resources under key org.apache.struts.action.MESSAGE
2010-05-19 10:30 1118转自:http://www.cnblogs.com/tjsqu ... -
JSP 中 pageEncoding charset 的区别
2010-05-16 17:21 1270首先,说说JSP/Servlet中 ... -
Eclipse工程编码设置
2010-05-16 17:10 1865转自:http://lj6684.iteye.com/blog ... -
JAVA调用DB2存储过程
2010-03-12 14:19 1938搜索java 调用db2(版本为8.2)存储过程 没几个文章能 ... -
tomcat配置数据源
2010-01-22 16:08 1890今天配属tomcat数据源,搞了一天,很是郁闷! 因为上 ... -
java.lang.NoSuchMethodException: Unknown property 'Content'
2009-11-10 15:54 6100今天在用<bean>标签写JSP的时候,报了如下的 ... -
Action的配置属性及其含义
2009-09-17 09:08 823引用原文地址:http://www ...
相关推荐
throw new ServletException("Failed to parse multipart request.", e); } } else { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "Request does not contain multipart content."); } } } ``` ...
org.springframework.web.multipart.MultipartException: Failed to parse multipart servlet request; nested exception is java.io.IOException: org.apache.tomcat.util....
@RequestMapping(value = "/upload", method = {RequestMethod.GET, RequestMethod.POST}) public void upload(HttpServletRequest request) { MultipartHttpServletRequest multipartRequest = ...
throw new MultipartException("Failed to parse multipart servlet request", e); } } } 第四步:配置 CustomMultipartResolver 最后,我们需要将 CustomMultipartResolver 配置到SpringBoot应用程序中。在...
log.error("Failed to parse upload request", e); } } ``` 在这个例子中,我们创建了一个`ServletFileUpload`实例,然后遍历每个文件项,处理文件流,并保存文件。 **3. 文件上传的最佳实践** - **错误处理**...
List<FileItem> items = upload.parseRequest(request); Iterator<FileItem> iter = items.iterator(); while (iter.hasNext()) { FileItem item = iter.next(); if (item.isFormField()) { // 处理普通表单...
log.error("Failed to parse upload request", e); return mapping.findForward("error"); } for (FileItem item : items) { if (!item.isFormField()) { // 处理文件项 String fileName = item.getName(); ...
throw new ServletException("Failed to parse upload request", e); } } } ``` 这段代码中,我们首先检查请求是否为多部分/表单类型,然后使用`ServletFileUpload`解析请求并获取文件项。每个`FileItem`代表一...
throw new ServletException("Failed to parse request", e); } } ``` 上述代码中,我们首先创建了`DiskFileItemFactory`实例来处理文件项,然后使用`ServletFileUpload`解析请求中的所有文件项。对于每个非...
在Servlet规范中,`HttpServletRequest`对象提供了处理多部分请求(Multipart Request)的能力,这是文件上传的基础。首先,需要在`doPost`方法中解析请求,然后获取上传的文件。以下是一个简单的示例: ```java //...
throw new ServletException("Failed to parse upload request", e); } } } ``` 在这个例子中,我们首先检查请求的内容类型是否为multipart/form-data,然后使用`ServletFileUpload`解析请求并获取每个文件项。...
List<FileItem> items = upload.parseRequest(request); for (FileItem item : items) { if (!item.isFormField()) { String fileName = item.getName(); File storeLocation = new File(uploadDirectory, ...
throw new ServletException("Failed to process file upload", e); } } else { response.sendError(HttpServletResponse.SC_BAD_REQUEST, "File upload not supported"); } } } ``` 以上就是使用Apache ...
return "You failed to upload file because it was empty!"; } return "You successfully uploaded file!"; } ``` ### 4. **安全性** - **文件大小限制**:为了防止DoS攻击,应限制上传文件的大小。可以在...
MediaType MEDIA_TYPE_PNG = MediaType.parse("image/png"); // 构建multipart请求体 RequestBody body = new MultipartBody.Builder() .setType(MultipartBody.FORM) .addFormDataPart("parms", parms) ....