0 Replies Latest reply on Jun 24, 2008 6:12 PM by 666705

    File Upload issue with weblogic

    666705
      Hi,
                We have a web application (using struts 1.1) which works fine on Sun application server. while migrating the application to weblogic 9.2, this file upload issue is coming.
                java.lang.ClassCastException: org.apache.struts.upload.MultipartRequestWrapper
                
                The error occurs in the perform method of the org.apache.struts.tiles.UrlController class, when its trying to call requestDispatcher.include.
                
                I think the problem is that UrlController is not unwrapping the Request from the MultipartRequestWrapper . RequestProcessor does something like
                // Unwrap the multipart request, if there is one.
                if (request instanceof MultipartRequestWrapper) {
                request = ((MultipartRequestWrapper) request).getRequest();
                }
                
                When I change the UrlController (which is part of the struts1.1 jar ) to add the above lines ,the fileupload works fine. Is this a bug in struts 1.1 , or has something to do with weblogic [ since the same code without changes works in sun application server)
                
                stack trace :
                java.lang.ClassCastException: org.apache.struts.upload.MultipartRequestWrapper
                at weblogic.servlet.internal.ServletRequestImpl.getOriginalRequest(ServletRequestImpl.java:1313)
                at weblogic.servlet.internal.RequestDispatcherImpl.include(RequestDispatcherImpl.java:328)
                at org.apache.struts.tiles.UrlController.perform(UrlController.java:111)
                at org.apache.struts.tiles.TilesRequestProcessor.processTilesDefinition(TilesRequestProcessor.java:243)
                at org.apache.struts.tiles.TilesRequestProcessor.processForwardConfig(TilesRequestProcessor.java:309)
                at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:279)
                at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
                at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
                at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)