Hi All,

I am using the file upload features in a web application. Basically the app
has three components. Application.jsp has a html form, the form is captured
in JobApplicationActionForm,  the action of the form is to apply.do. 

The application runs well at most of the time, but when the resume file that
is to be uploaded is locked by another process(meaning the file can't be
read.), the application blows up.

Following is the code:

Application.jsp
....
<html:form  method="POST" action="/career/apply"
enctype="multipart/form-data">
<html:file property="resumeFile"  style="font-size:9pt;color:#666600"/>
</html:form>
....

Apply.do requires a JobApplicationActionForm. Here is
JobApplicationActionForm.java
public class JobApplicationForm extends ActionForm {
....
        private FormFile resumeFile;
        public FormFile getResumeFile() {return resumeFile;}
        public void setResumeFile(FormFile file){resumeFile = file;}
...
}

Apply.do is ApplyForJobAction. Here is ApplyForJobAction.java
public class ApplyForJobAction extends Action {
        public ApplyForJobAction() {}
        public ActionForward execute(ActionMapping mapping, ActionForm
form,HttpServletRequest request, HttpServletResponse response)throws
IOException,ServletException{
                .....
        }
}

The application runs well at most of the time, but when the resume file that
is to be uploaded is locked by another process(the file can't be read.), the
application blows up. Following can be found in log file:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++
[4/19/04 23:57:55:069 EDT] 5cacbbb2 CommonsMultip E
org.apache.struts.upload.CommonsMultipartRequestHandler  Failed to parse
multipart request
[4/19/04 23:57:55:069 EDT] 5cacbbb2 CommonsMultip E
org.apache.struts.upload.CommonsMultipartRequestHandler  TRAS0014I: The
following exception was logged
org.apache.commons.fileupload.FileUploadException: Processing of
multipart/form-data request failed. Read timed out
        at
org.apache.commons.fileupload.FileUpload.parseRequest(FileUpload.java:462)
        at
org.apache.commons.fileupload.FileUpload.parseRequest(FileUpload.java:304)
        at
org.apache.struts.upload.CommonsMultipartRequestHandler.handleRequest(Common
sMultipartRequestHandler.java:234)
        at
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:934)
        at
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.j
ava:779)
        at
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:246)
        at
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1292)
        at
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:510)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:760)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
        at
com.ibm.ws.webcontainer.servlet.StrictServletInstance.doService(StrictServle
tInstance.java:110)
        at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet._service(StrictLifecy
cleServlet.java:174)
        at
com.ibm.ws.webcontainer.servlet.IdleServletState.service(StrictLifecycleServ
let.java:313)
        at
com.ibm.ws.webcontainer.servlet.StrictLifecycleServlet.service(StrictLifecyc
leServlet.java:116)
        at
com.ibm.ws.webcontainer.servlet.ServletInstance.service(ServletInstance.java
:283)
        at
com.ibm.ws.webcontainer.servlet.ValidServletReferenceState.dispatch(ValidSer
vletReferenceState.java:42)
        at
com.ibm.ws.webcontainer.servlet.ServletInstanceReference.dispatch(ServletIns
tanceReference.java:40)
        at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.handleWebAppDispatch(
WebAppRequestDispatcher.java:948)
        at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.dispatch(WebAppReques
tDispatcher.java:530)
        at
com.ibm.ws.webcontainer.webapp.WebAppRequestDispatcher.forward(WebAppRequest
Dispatcher.java:176)
        at
com.ibm.ws.webcontainer.srt.WebAppInvoker.doForward(WebAppInvoker.java:79)
        at
com.ibm.ws.webcontainer.srt.WebAppInvoker.handleInvocationHook(WebAppInvoker
.java:201)
        at
com.ibm.ws.webcontainer.cache.invocation.CachedInvocation.handleInvocation(C
achedInvocation.java:71)
        at
com.ibm.ws.webcontainer.srp.ServletRequestProcessor.dispatchByURI(ServletReq
uestProcessor.java:182)
        at
com.ibm.ws.webcontainer.oselistener.OSEListenerDispatcher.service(OSEListene
r.java:334)
        at
com.ibm.ws.webcontainer.http.HttpConnection.handleRequest(HttpConnection.jav
a:56)
        at
com.ibm.ws.http.HttpConnection.readAndHandleRequest(HttpConnection.java:610)
        at com.ibm.ws.http.HttpConnection.run(HttpConnection.java:431)
        at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:593)

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++++++++++++++++++++++++

I inserted the debug code in the constructor and execute() method of
ApplyForJobAction, I found that ApplyForJobAction is actually not called. I
tried to catch the exception in process() method of my overriden
ActionServlet, had no luck. 

Where else can I try to catch the exception? 

Thanks
Jing


DISCLAIMER: This message contains information which may be confidential
and/or privileged, and is intended only for the use of the addressee(s).
Any use, disclosure or copying of this message or any part thereof by any
person other than such addressee(s) is unauthorized and strictly prohibited.
If you have received this message in error, please notify the sender by
return e-mail and delete the message.  Thank you for your cooperation. 



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to