Announcement Announcement Module
Collapse
No announcement yet.
No mapping found for HTTP request with MVC requests Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • No mapping found for HTTP request with MVC requests

    I am receiving the following error:

    WARN org.springframework.web.servlet.PageNotFound 2008-06-17 13:37:30,140 - No mapping found for HTTP request with URI [/spring-security/WEB-INF/views/help.jsp] in DispatcherServlet with name 'mvc-dispatcher'
    WARN org.springframework.web.servlet.PageNotFound 2008-06-17 13:37:30,307 - No mapping found for HTTP request with URI [/spring-security/WEB-INF/views/help.jsp] in DispatcherServlet with name 'mvc-dispatcher'
    WARN org.springframework.web.servlet.PageNotFound 2008-06-17 13:37:30,473 - No mapping found for HTTP request with URI [/spring-security/WEB-INF/views/help.jsp] in DispatcherServlet with name 'mvc-dispatcher'


    In my logs every time I try to request the url localhost/spring-security/something/help

    It does hit the Controller. The controller returns a ModelAndView and then I receive the error.

    app-controllers-config.xml looks like this

    Code:
        <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
            <property name="viewClass" value="org.springframework.web.servlet.view.JstlView" />
            <property name="prefix" value="/WEB-INF/views/" />
            <property name="suffix" value=".jsp" />
        </bean>
    
        <bean class="org.springframework.web.servlet.handler.SimpleUrlHandlerMapping">
            <property name="mappings">
                <value>
                    /login**=loginController
                    /**/help=helpController
                </value>
            </property>
        </bean>
    
        <bean name="loginController" class="au.edu.une.tlc.web.controllers.DirectLoginController" />
        <bean name="helpController" class="au.edu.une.tlc.web.controllers.HelpController" />

    and the web.xml looks like

    Code:
        <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/app-config.xml</param-value>
            </init-param>
        </servlet>
    
        <servlet-mapping>
            <servlet-name>mvc-dispatcher</servlet-name>
            <url-pattern>/*</url-pattern>
        </servlet-mapping>
    app-config.xml looks like
    Code:
         <import resource="app-controllers-config.xml" />
        <!--<import resource="basic-security-config.xml"/>-->
    Any suggestions would be nice. It looks to me like the viewResolver is having issues but I can't find any information on why.

  • #2
    Fixed

    Alright so the problem is the DispatcherServlet is picking up requests to WEB-INF/views/ etc and trying to process them.

    Does this mean that the dispatcher servlet does a redirect to that page or is it catching the request some other way?

    Also...

    Is there a way to exclude that path from the mapping?

    Comment


    • #3
      Solved

      And again never mind.

      setting the servlet mapping to
      Code:
          <servlet-mapping>
              <servlet-name>mvc-dispatcher</servlet-name>
              <url-pattern>/</url-pattern>
          </servlet-mapping>
      instead of
      Code:
          <servlet-mapping>
              <servlet-name>mvc-dispatcher</servlet-name>
              <url-pattern>/*</url-pattern>
          </servlet-mapping>
      solves this problem.

      Comment


      • #4
        Thanks for your answer.

        Comment


        • #5
          i also facing the same problem, could you please help me

          please find the below error

          Code:
          [DEBUG:http-8080-1] [2011-09-15 11:38:53,201] (SimpleUrlHandlerMapping:161) - Looking up handler for [/webservice]
          [DEBUG:http-8080-1] [2011-09-15 11:38:53,201] (DispatcherServlet:1045) - Testing handler 
          map [[email protected]fdca5] in DispatcherServlet with name 'PrepaidBasics'
          [DEBUG:http-8080-1] [2011-09-15 11:38:53,201] (SimpleUrlHandlerMapping:161) - Looking up handler for [/webservice]
          [ WARN:http-8080-1] [2011-09-15 11:38:53,201] (PageNotFound:1068) - No mapping found for HTTP request 
          with URI [/PrepaidBasics/webservice] in DispatcherServlet with name 'PrepaidBasics'
          [DEBUG:http-8080-1] [2011-09-15 11:38:53,201] (DispatcherServlet:939) - Cleared thread-bound request 
          context: org.apache.catalina.connector.RequestFacade@bdd2e7
          [DEBUG:http-8080-1] [2011-09-15 11:38:53,201] (DispatcherServlet:591) - Successfully completed request
          [DEBUG:http-8080-1] [2011-09-15 11:38:53,201] (XmlWebApplicationContext:273) - Publishing event in context
          Code:
          Running dk.telia.prepaid.services.GetApplicationStatusIT
          --connectURL-------http://localhost:8080/PrepaidBasics/webservice
          [INFO] [talledLocalContainer] Sep 15, 2011 12:11:44 PM org.apache.catalina.core.ApplicationContext log
          [INFO] [talledLocalContainer] INFO: Initializing Spring FrameworkServlet 'PrepaidBasics'
          java.io.FileNotFoundException: http://localhost:8080/PrepaidBasics/webservice
                  at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1288)
                  at dk.telia.prepaid.services.URLDispatcher.post(URLDispatcher.java:30)
                  at dk.telia.prepaid.services.GetApplicationStatusIT.serviceTest(GetApplicationStatusIT.java:20)
                  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
                  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
                  at java.lang.reflect.Method.invoke(Method.java:597)
                  at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
                  at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
                  at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
                  at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
                  at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
                  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
                  at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
                  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
                  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)

          Comment


          • #6
            Hi,

            I am trying to change the dispatcher servlet from spring/* to /*

            My initial configurations were as follows
            web.xml
            Code:
            <servlet-mapping>
                <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
                <url-pattern>/spring/*</url-pattern>   
              </servlet-mapping>
            
              <filter-mapping>
                <filter-name>springSecurityFilterChain</filter-name>
                <url-pattern>/*</url-pattern>
              </filter-mapping>
              <filter-mapping>
                <filter-name>springSecurityFilterChain</filter-name>
                <servlet-name>/CVT/*</servlet-name>
              </filter-mapping>
            appcontext.xml
            Code:
             <security:http auto-config="true" use-expressions="true" >
             		<security:form-login login-page="/index.html" authentication-failure-url="/index.html" />
            		<security:intercept-url pattern="spring/login" access="permitAll"/>
            		<security:intercept-url pattern="spring/**" access="isAuthenticated()"/>
            		<security:logout invalidate-session="true"  logout-url="/j_spring_security_logout" logout-success-url="/index.html" />
            		<security:session-management invalid-session-url="/index.html" session-fixation-protection="migrateSession" >
            			<security:concurrency-control max-sessions="1" error-if-maximum-exceeded="true" expired-url="/index.html"/>
            		</security:session-management>
            index.html
            Code:
            <html>
            <head>
              <meta http-equiv="Refresh" content="0; URL=spring/login">
            </head>
            </html>
            index.html is the welcome page and will redirect the request to login.xml flow
            I have removed all the references to spring in all the configuration files.

            the changes files are as follows
            web.xml
            Code:
            <servlet-mapping>
                <servlet-name>Spring MVC Dispatcher Servlet</servlet-name>
                <url-pattern>/*</url-pattern>   
              </servlet-mapping>
            
              <filter-mapping>
                <filter-name>springSecurityFilterChain</filter-name>
                <url-pattern>/*</url-pattern>
              </filter-mapping>
            appcontext.xml
            Code:
             <security:http auto-config="true" use-expressions="true" >
             		<security:form-login login-page="/index.html" authentication-failure-url="/index.html" />
            		<security:intercept-url pattern="/login" access="permitAll"/>
            		<security:intercept-url pattern="/**" access="isAuthenticated()"/>
            		<security:logout invalidate-session="true"  logout-url="/j_spring_security_logout" logout-success-url="/index.html" />
            		<security:session-management invalid-session-url="/index.html" session-fixation-protection="migrateSession" >
            			<security:concurrency-control max-sessions="1" error-if-maximum-exceeded="true" expired-url="/index.html"/>
            		</security:session-management>
            index.html
            Code:
            <html>
            <head>
              <meta http-equiv="Refresh" content="0; URL=/login">
            </head>
            </html>
            These configurations are not working and the application is not recognized when I type in http://localhost:8080/App

            Please advice what am I missing

            Thanks
            Vinaya

            Comment

            Working...
            X