fileUpload redirect problem - Weblogic

This is a discussion on fileUpload redirect problem - Weblogic ; I am trying to run the Struts 1.1 fileUpload example code in WebLogic 8.1.2, but am getting an error. All is fine until I try to return from the upload action class. I do a return mapping.findForward("Success"); Which should send ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: fileUpload redirect problem

  1. fileUpload redirect problem

    I am trying to run the Struts 1.1 fileUpload example code in WebLogic 8.1.2, but am getting an error.

    All is fine until I try to return from the upload action class. I do a

    return mapping.findForward("Success");

    Which should send it back through struts to where this is present:

    path="/html/upload-success.jsp" />

    Sadly, the jsp is never invoked. Instead, I get this:

    13:07:17,653 [ExecuteThread: '199' for queue:
    'default'] DEBUG action.RequestProcessor -
    processForwardConfig(ForwardConfig[name=Success,path=/html/upload-success.js
    p,redirect=false,contextRelative=false])


    [ServletContext(id=27649252,name=enames,context-path=/enames)]
    Servlet failed with ServletException
    javax.servlet.ServletException: Original request not available at

    weblogic.servlet.internal.RequestDispatcherImpl.fo rward(RequestDispatcherImp
    l.java:111)

    Any suggestions? This error only happens when enctype="multipart/form-data" in the .jsp.

    Thanks,

    Scott Nesbitt

  2. Re: fileUpload redirect problem

    Hey Scott,

    It looks like the request (coming into requestdispatcher.forward() ) doesnt
    implement ServletRequestWrapper. Is that possible in your case. Can you post
    the entire stacktrace?

    -- Nagesh

    "Scott Nesbitt" wrote in message
    news:408807a1$1@newsgroups.bea.com...
    > I am trying to run the Struts 1.1 fileUpload example code in WebLogic

    8.1.2, but am getting an error.
    >
    > All is fine until I try to return from the upload action class. I do a
    >
    > return mapping.findForward("Success");
    >
    > Which should send it back through struts to where this is present:
    >
    > > path="/html/upload-success.jsp" />
    >
    > Sadly, the jsp is never invoked. Instead, I get this:
    >
    > 13:07:17,653 [ExecuteThread: '199' for queue:
    > 'default'] DEBUG action.RequestProcessor -
    >

    processForwardConfig(ForwardConfig[name=Success,path=/html/upload-success.js
    > p,redirect=false,contextRelative=false])
    >
    >
    > [ServletContext(id=27649252,name=enames,context-path=/enames)]
    > Servlet failed with ServletException
    > javax.servlet.ServletException: Original request not available at
    >
    >

    weblogic.servlet.internal.RequestDispatcherImpl.fo rward(RequestDispatcherImp
    > l.java:111)
    >
    > Any suggestions? This error only happens when

    enctype="multipart/form-data" in the .jsp.
    >
    > Thanks,
    >
    > Scott Nesbitt




  3. RE: Re: fileUpload redirect problem

    Sure, here is the stack trace:

    <[ServletContext(id=18641557,name=enames,context-path=/enames)] Servlet failed with ServletException
    javax.servlet.ServletException: Original request not available
    at weblogic.servlet.internal.RequestDispatcherImpl.fo rward(RequestDispatcherImpl.java:111)
    at org.apache.struts.action.RequestProcessor.doForwar d(RequestProcessor.java:1069)
    at org.apache.struts.action.RequestProcessor.processF orwardConfig(RequestProcessor.java:455)
    at org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:279)
    at org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1482)
    at com.nielsenmedia.lrs.enames.common.LRSeNamesAction Servlet.process(Unknown Source)
    at org.apache.struts.action.ActionServlet.doPost(Acti onServlet.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$ServletI nvocationAction.run(ServletStubImpl.java:971)
    at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:402)
    at weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java:305)
    at weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(WebAppServletContext.java :6350)
    at weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubject.java:317)
    at weblogic.security.service.SecurityManager.runAs(Se curityManager.java:118)
    at weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletContext.java:3635)
    at weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java:2585)
    at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)

    Scott Nesbitt

  4. Re: Re: fileUpload redirect problem

    It looks like the forward() method is not getting the correct instance of
    ServletRequestImpl. You can either pass in a ServletRequestWrapper which
    wraps over the original request (ServletRequestImpl in the weblogic case) or
    pass in the original request which came into the service() method. Strangely
    in this case, it seems like struts is sending in a instance which is
    neither. This could very well be a struts bug.

    "Scott Nesbitt" wrote in message
    news:40882cf6@newsgroups.bea.com...
    > Sure, here is the stack trace:
    >
    >

    <[ServletContext(id=18641557,name=enames,context-path=/enames)] Servlet
    failed with ServletException
    > javax.servlet.ServletException: Original request not available
    > at

    weblogic.servlet.internal.RequestDispatcherImpl.fo rward(RequestDispatcherImp
    l.java:111)
    > at

    org.apache.struts.action.RequestProcessor.doForwar d(RequestProcessor.java:10
    69)
    > at

    org.apache.struts.action.RequestProcessor.processF orwardConfig(RequestProces
    sor.java:455)
    > at

    org.apache.struts.action.RequestProcessor.process( RequestProcessor.java:279)
    > at

    org.apache.struts.action.ActionServlet.process(Act ionServlet.java:1482)
    > at

    com.nielsenmedia.lrs.enames.common.LRSeNamesAction Servlet.process(Unknown
    Source)
    > at

    org.apache.struts.action.ActionServlet.doPost(Acti onServlet.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$ServletI nvocationAction.run(Servle
    tStubImpl.java:971)
    > at

    weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java
    :402)
    > at

    weblogic.servlet.internal.ServletStubImpl.invokeSe rvlet(ServletStubImpl.java
    :305)
    > at

    weblogic.servlet.internal.WebAppServletContext$Ser vletInvocationAction.run(W
    ebAppServletContext.java:6350)
    > at

    weblogic.security.acl.internal.AuthenticatedSubjec t.doAs(AuthenticatedSubjec
    t.java:317)
    > at

    weblogic.security.service.SecurityManager.runAs(Se curityManager.java:118)
    > at

    weblogic.servlet.internal.WebAppServletContext.inv okeServlet(WebAppServletCo
    ntext.java:3635)
    > at

    weblogic.servlet.internal.ServletRequestImpl.execu te(ServletRequestImpl.java
    :2585)
    > at weblogic.kernel.ExecuteThread.execute(ExecuteThrea d.java:197)
    > at weblogic.kernel.ExecuteThread.run(ExecuteThread.ja va:170)
    >
    > Scott Nesbitt




  5. RE: fileUpload redirect problem

    Struts creates a special wrapper for HttpServetRequest if your page has file to upload. The class name of this wrapper is
    org.apache.struts.upload.MultipartRequestWrapper. Before you do the forward, you need to call MultipartRequestWrapper.getRequest() to the get the correct HttpServletRequest and use that in the forward method.

+ Reply to Thread