Announcement Announcement Module
Collapse
No announcement yet.
error:No WebApplicationContext found Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • error:No WebApplicationContext found

    Hi every body,
    i am working on eclipse, Jboss
    i am getting following error when trying to access index page

    my web.xml code is as follows
    please inform wher i am going wrong::
    right now i am having only springapp-servlet.xml

    //web.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>

    <web-app>
    <servlet>
    <servlet-name>springapp</servlet-name>
    <servlet-class>
    org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>


    <servlet-name>springapp</servlet-name>
    <url-pattern>*.htm</url-pattern>
    </servlet-mapping>

    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>

    <taglib>
    <taglib-uri>/spring</taglib-uri>
    <taglib-location>/WEB-INF/spring.tld</taglib-location>
    </taglib>

    </web-app>


    java.lang.IllegalStateException: No WebApplicationContext found: not in a DispatcherServlet request?
    org.springframework.web.servlet.support.RequestCon textUtils.getWebApplicationContext(RequestContextU tils.java:79)
    org.springframework.web.servlet.support.RequestCon textUtils.getWebApplicationContext(RequestContextU tils.java:56)
    org.springframework.web.servlet.support.RequestCon text.<init>(RequestContext.java:92)
    org.springframework.web.servlet.support.RequestCon text.<init>(RequestContext.java:78)
    org.springframework.web.servlet.tags.RequestContex tAwareTag.doStartTag(RequestContextAwareTag.java:8 5)
    org.apache.jsp.jsp.index_jsp._jspService(org.apach e.jsp.jsp.index_jsp:96)
    org.apache.jasper.runtime.HttpJspBase.service(Http JspBase.java:97)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:810)
    org.apache.jasper.servlet.JspServletWrapper.servic e(JspServletWrapper.java:322)
    org.apache.jasper.servlet.JspServlet.serviceJspFil e(JspServlet.java:314)
    org.apache.jasper.servlet.JspServlet.service(JspSe rvlet.java:264)
    javax.servlet.http.HttpServlet.service(HttpServlet .java:810)
    org.jboss.web.tomcat.filters.ReplyHeaderFilter.doF ilter(ReplyHeaderFilter.java:81)

  • #2
    Hi kasibhat,

    Two very basic questions:

    1) You do have a WEB-INF/springapp-servlet.xml file, right?

    2) Was that a copy-paste error in your web.xml? You are missing the start tag for the <servlet-mapping>. I am assuming that this is not the problem or else I would think you would not be getting as far as you are.

    -Arthur Loder

    Comment

    Working...
    X