Announcement Announcement Module
Collapse
No announcement yet.
Help me resolve - No WebApplicationContext found: no ContextLoaderListener registere Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Help me resolve - No WebApplicationContext found: no ContextLoaderListener registere

    Hi,

    I have a very simple web application and in the servlet init method below is my code

    public void init(ServletConfig config) throws ServletException {
    super.init(config);

    WebApplicationContext applicationContext =
    WebApplicationContextUtils.getRequiredWebApplicati onContext( config.getServletContext() );

    WebApplicationContext applicationContext =
    WebApplicationContextUtils.getWebApplicationContex t( config.getServletContext());
    DelegationPageBean.setApplicationContext(applicati onContext);
    }

    and below is code for web.xml

    <web-app id="WebApp_ID">
    <display-name>DelegateProtoTypeWeb</display-name>
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>>classpath*:/com/pnc/delegate/persistence/config/testingDataSourceApplicationContext.xml, classpath*:/com/pnc/delegate/persistence/config/persistenceApplicationContext.xml</param-value>
    </context-param>
    <listener>
    <listener-class>org.springframework.web.context.ContextLoade rListener</listener-class>
    </listener>
    <servlet>
    <servlet-name>TestServlet3</servlet-name>
    <servlet-class>com.pnc.delegation.servlet.TestServlet3</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>TestServlet3</servlet-name>
    <url-pattern>/TestServlet3</url-pattern>
    </servlet-mapping>
    </web-app>

    I keep getting the below error when i try to run the servlet

    [Servlet Error]-[TestServlet3]: java.lang.IllegalStateException: No WebApplicationContext found: no ContextLoaderListener registered?
    at java.lang.Throwable.<init>(Throwable.java)
    at java.lang.Throwable.<init>(Throwable.java)
    at org.springframework.web.context.support.WebApplica tionContextUtils.getRequiredWebApplicationContext( WebApplicationContextUtils.java:86)
    at com.pnc.delegation.servlet.TestServlet3.doPost(Tes tServlet3.java:49)
    at com.pnc.delegation.servlet.TestServlet3.doGet(Test Servlet3.java:35)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:740)
    at javax.servlet.http.HttpServlet.service(HttpServlet .java:853)
    Can some one help me resolve thsi issue?

    Thank you
Working...
X