Results 1 to 3 of 3

Thread: Spring MVC :: Stack Over Flow error :: Need help finding the root cause

  1. #1
    Join Date
    Nov 2012
    Posts
    2

    Default Spring MVC :: Stack Over Flow error :: Need help finding the root cause

    HI Team,

    We are facing an issue with stack over flow exception in our application . we are not sure why its happening in the code.

    I am attaching the complete stack trace for this.

    Here is our dispatcher configuration xml

    HTML Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <beans xmlns="http://www.springframework.org/schema/beans"
    	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
    	xmlns:context="http://www.springframework.org/schema/context"
    	xmlns:mvc="http://www.springframework.org/schema/mvc"
    	xmlns:jee="http://www.springframework.org/schema/jee"
    	xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
    		http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
    		http://www.springframework.org/schema/mvc
           http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
           http://www.springframework.org/schema/jee
           http://www.springframework.org/schema/jee/spring-jee-3.0.xsd">
    
    	<context:component-scan base-package="com.applications" />
    	
    	<mvc:annotation-driven/>
    	<bean id="application" class="org.springframework.context.support.ClassPathXmlApplicationContext">
    		<constructor-arg>
    			<list>				
    				<value>shared/spring-util.xml</value>
    				<value>shared/spring-dao.xml</value>
    			</list>
    		</constructor-arg>
    	</bean>
    	
    	
        
    	<!-- Declare a view resolver -->
    	<bean id="viewResolver"
    		class="org.springframework.web.servlet.view.InternalResourceViewResolver"
    		p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" p:order="2"/>	
    		
    	<bean id="contentNegotiatingViewResolver"
    		class="org.springframework.web.servlet.view.ContentNegotiatingViewResolver"
    		p:order="1">
    		<property name="mediaTypes">
    			<map>				
    				<entry key="json" value="application/json" />
    			</map>
    		</property>
    	</bean>		
    	
    	 <!-- Default to DefaultController -->
    	 <bean
    		class="org.springframework.web.servlet.mvc.annotation.DefaultAnnotationHandlerMapping">
    		<property name="defaultHandler" ref="defaultController" />
    	</bean>
    	
    	<!-- Mappings for Interceptors -->
    	<mvc:interceptors>
    		<mvc:interceptor>
    			<mvc:mapping path="/*"/>
    			<bean id="allUsersInterceptor" class="com.applications.interceptor.AllUsersInterceptor"/>
    		</mvc:interceptor>
    		
    		<!-- Interceptor to intercept all requests to profile pages. -->
    		<mvc:interceptor>
    			<mvc:mapping path="/my-profile/**"/>
    			<bean id="profileAuthInterceptor" class="com.applications.interceptor.ProfileAuthInterceptor"/>
    		</mvc:interceptor>
    	</mvc:interceptors>
    	<!-- Mappings for Interceptors ends -->
    	
    	<!-- Mapping for Exception Handling -->
    	<bean class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver">
    		<property name="exceptionMappings">
    			<props>
    				<!-- For all exceptions Generic error page is shown.
    				     Add a "prop" element in case any particular exception requires a specific error page.
    				     Key - Fully qualified exception class
    				     Value - Relative JSP path.(full path using configured InternalResourceViewResolver)
    				-->				
    				<prop key="java.lang.Throwable">error</prop>
    			</props>
    		</property>
    	</bean>
    	<!-- Mapping for Exception Handling ends -->
    	
    </beans>
    Thank you
    Madhav

  2. #2
    Join Date
    Nov 2012
    Posts
    2

    Default

    Here is the web.xml that we are using.

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app id="WebApp_ID" version="2.4" xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd">
      <display-name>WEB</display-name>
      <welcome-file-list>   
        <welcome-file>index.jsp</welcome-file>   
      </welcome-file-list>
      <servlet>
        <servlet-name>MVC_Dispatcher</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>/WEB-INF/dispatcher-config.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
      </servlet>
      <servlet-mapping>
        <servlet-name>MVC_Dispatcher</servlet-name>
        <url-pattern>/*</url-pattern>
      </servlet-mapping>  
      
    </web-app>

  3. #3
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,624

    Default

    No stacktrace hard to tell.

    I'm curious as to why are you constructing an ApplicationContext in your configuration file?!
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •