0

I have the following web.xml file .The server config is JBOSS 6.1 and i use Spring STS for development.The issue is on server startup,sometimes(not always),I get the default "QbatLogin.jsp" page but the rest of the pages do not appear.I use Maven. It shows Mapping not found for URI error.

     <?xml version="1.0" encoding="UTF-8"?>
     <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee 
     http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
     version="3.1">
     <display-name>qbatPortal</display-name>
     <welcome-file-list>
     <welcome-file>QbatLogin.jsp</welcome-file>
      </welcome-file-list>

<listener>
     <listener-class>qbat.application.startup.QbatAppListener</listener-class>
</listener>

<servlet>
    <servlet-name>qbatPortal</servlet-name>
    <servlet-class>
        org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
    <init-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>/WEB-INF/qbatPortal-servlet.xml</param-value>
    </init-param>
    <load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
    <servlet-name>qbatPortal</servlet-name>
    <url-pattern>/welcome.jsp</url-pattern>
    <url-pattern>/welcome.html</url-pattern>
    <url-pattern>/home.html</url-pattern>
    <url-pattern>/create</url-pattern>
    <url-pattern>/market</url-pattern>

    <url-pattern>*.html</url-pattern>

    <!--save button-->
    <url-pattern>/saveaction</url-pattern>
</servlet-mapping>

The error is as follows

12:27:15,961 WARN
[org.springframework.web.servlet.PageNotFound] (http- localhost/127.0.0.1:8080-2) No mapping found for HTTP request with URI [/qbatPortal/market] in DispatcherServlet with name 'qbatPortal' 12:27:15,961 INFO [stdout] (http-localhost/127.0.0.1:8080-2) WARN 2017-03-01 12:27:15,961 (::) [org.springframework.web.servlet.PageNotFound]: No mapping found for HTTP request with URI [/qbatPortal/market] in DispatcherServlet with name 'qbatPortal'

Random
  • 23
  • 3
  • So, have you defined such a mapping? I.e. doyou have a controller that is mapped to /market, using `@RequestMapping`? – JB Nizet Mar 01 '17 at 07:08
  • Yes i do.Please find below the controller and the dispatcher servlet. – Random Mar 01 '17 at 09:52
  • Yes i did do the mapping using url based encoding and @Controller is also present.Btw,this issue happens intermittently,not always on server startup. – Random Mar 01 '17 at 09:55

0 Answers0