views:

357

answers:

1

Hi ,

I am getting following Exception at the time of uploading the file using spring file upload functionality.

trying to uplaod 291 KB jpg file.

For less than 50 kb file it works properly. Following are bean entries

<bean id="fileUploadController" class="com.businesscaliber.controller.FileUploadController">
        <property name="commandClass" value="com.businesscaliber.bean.FileUploadBean"/>
        <property name="formView" value="admin.do"/>
        <property name="successView" value="admin.do"/>
    </bean>

<bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
        <!-- one of the properties available; the maximum file size in bytes -->
        <property name="maxUploadSize" value="100000"/>
    </bean> 

Please help

Hi i had updated spring 2.5 jar

After that getting same error

11:45:29,562 INFO  [STDOUT] 147375 [http-localhost%2F127.0.0.1-9090-3] ERROR org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/businesscaliber].[businesscaliber]  - Servlet.service() for servlet businesscaliber threw exception
javax.servlet.ServletException: Circular view path [exceptionController.do]: would dispatch back to the current handler URL [/businesscaliber/exceptionController.do] again. Check your ViewResolver setup! (Hint: This may be the result of an unspecified view, due to default view name generation.)

Privious Exception using Spring 2.0 jar

 1782687 [http-localhost%2F127.0.0.1-9090-3] ERROR org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/businesscaliber].[businesscaliber]  - Servlet.service() for servlet businesscaliber threw exception
java.lang.StackOverflowError
    at javax.servlet.http.HttpServletRequestWrapper.getSession(HttpServletRequestWrapper.java:215)
    at org.apache.catalina.core.ApplicationHttpRequest.getSession(ApplicationHttpRequest.java:544)    2010-02-04 16:43:31,406 INFO  [STDOUT] a:544)
+2  A: 

This StackOverflowError showing a trace with a recursive call on getSession() is recognizeable as result of a request incorrectly being dispatched through a servlet or filter which has already been called before in the request chain which causes that it is calling itself again and again.

Actually, I don't see how that's related to uploading files, maybe the Spring file upload functionality is internally forwarding the request to some special servlet or filter which by coincidence is also covered by the same url-pattern of the original request and is thus already called beforehand.

At least, you now know where to take a look to fix the particular problem. There is ambiguity and recursion in the servlet or filter mappings.

BalusC
hi i had replaced my old spring jar with new 2.5 jar getting same error with Circular path exception
Yashwant Chavan