0

Please why I am getting the requested resource is not found on project start up even though everything seems alright

<context-param>
        <param-name>log4jConfigLocation</param-name>
        <param-value>classpath:log4j.xml</param-value>
    </context-param>
    <listener>
        <listener-class>org.springframework.web.util.Log4jConfigListener</listener-class>
    </listener>

    <servlet>
        <servlet-name>spring</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <load-on-startup>1</load-on-startup>
    </servlet>
    <servlet-mapping>
        <servlet-name>spring</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>

Please assist me!!!

Blaze
  • 2,269
  • 11
  • 40
  • 82

1 Answers1

0

You need to load the Spring context with org.springframework.web.context.ContextLoaderListener, not Log4jConfigListener (or try out Spring Boot)

See Loading context in Spring using web.xml

Community
  • 1
  • 1
Assen Kolov
  • 4,143
  • 2
  • 22
  • 32