Announcement Announcement Module
Collapse
No announcement yet.
HTTP Status 500 - Servlet.init() for servlet Dispatcher threw exception Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • HTTP Status 500 - Servlet.init() for servlet Dispatcher threw exception

    Hi,
    When i'm trying to run this simple html form:

    Code:
      
    
    <html>
           <head>
            <title>Enter a new Page</title>
           </head>
    
           <body>
    
              <div id="editPresPage">
                 <form action="editPresPage.do" method="post"> 
                <label>Enter Page ID</label><input type="text" name="page_id"/>
                <label>Enter Header1</label><input type="text" name="h1"/>
                <label>Enter Header2</label><input type="text" name="h2"/>
                <label>Enter Header3</label><input type="text" name="h3"/>
                <label>Enter Header4</label><input type="text" name="h4"/>            
                <label>Enter Page Text</label><input type="text" name="page_text"/>
    
                <input type="submit" value="Add New Page"/>
             </form>              
              </div>
    
    
           </body>
        </html>
    I'm getting the error HTTP Status 500 - Servlet.init() for servlet Dispatcher threw exception in my browser.

    In my command line window (which opens when i'm running the tomcat's start.batch file) i'm getting the following error:

    log4j:WARN No appenders could be found for logger(org.springframework.web.servlet.dispatchers ervlet)

    That my Dispatcher-servlet.xml file:

    Code:
    <beans xmlns="http://www.springframework.org/schema/beans" 
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xmlns:p="http://www.springframework.org/schema/p" 
        xmlns:context="http://www.springframework.org/schema/context"
        xsi:schemaLocation="
            http://www.springframework.org/schema/beans 
            http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
            http://www.springframework.org/schema/context 
            http://www.springframework.org/schema/context/spring-context-3.0.xsd">       
    
            <import resource="/application.xml"/>
    
            <bean name="/editPresPage.do"
                    class="my.pack.webTier.control.EditPresPageController" >
                <property name="page_manager_service" ref="page_manager_service"/>
            </bean> 
    
           <!--  I also tried using with annotations -->    
            <!-- <context:component-scan base-package="my.pack"/> -->        
    
    </beans>
    That's my web.xml file:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
             version="2.5">
    
        <servlet>
           <servlet-name>Dispatcher</servlet-name>
           <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
           <load-on-startup>1</load-on-startup>
        </servlet>
    
        <servlet-mapping>
           <servlet-name>Dispatcher</servlet-name>
           <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    
        <!-- Tomcat configuration -->
        <Context path="/myWebApp" docBase="../tomcat\work\Catalina\localhost\mywebapptomcat\work\Catalina\localhost\mywebapp">
        <Loader
        loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>
        </Context>
    
    </web-app>
    And thats my controller:

    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns="http://java.sun.com/xml/ns/javaee"
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
             xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd"
             version="2.5">
    
        <servlet>
           <servlet-name>Dispatcher</servlet-name>
           <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
           <load-on-startup>1</load-on-startup>
        </servlet>
    
        <servlet-mapping>
           <servlet-name>Dispatcher</servlet-name>
           <url-pattern>*.do</url-pattern>
    </servlet-mapping>
    
        <!-- Tomcat configuration -->
        <Context path="/myWebApp" docBase="../tomcat\work\Catalina\localhost\mywebapptomcat\work\Catalina\localhost\mywebapp">
        <Loader
        loaderClass="org.springframework.instrument.classloading.tomcat.TomcatInstrumentableClassLoader"/>
        </Context>
    
    </web-app>
    I'm working with spring MVC 3.2, eclipse 3.7, springTomcat/7.0.30 , java 7, and using ANT in my project.

    I've searched for an answer for this requirements - and didn't found one.

  • #2
    Recently,I learn about spring mvc and I cant know well about the dispatcherservlet . eg : http://localhost:8080/xiao/contact.htm
    I want to know when the @Controller @RequestMapping("/contact") load. and if the annotation is load on servlet start ,and the value is saved into map

    Comment


    • #3
      spring mvc ini

      when I visit my own project eg:http://localhost:8080/xiao/contact.htm .The dispacherServlet invoke doDispatch() method .But I want to know that the uri is exists in map or scan the annotation for @RequestMapping("/contact") ?
      thanks for your reply .

      Comment

      Working...
      X