Announcement Announcement Module
Collapse
No announcement yet.
Exceptions with DispatcherServlet while deployment Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Exceptions with DispatcherServlet while deployment

    Hi all,

    I've got some problems with my web application. Whenever I try to deploy my app, JBOSS is throwing a ClassNotFoundException for class
    org.springframework.web.servlet.DispatcherServlet

    Here is my environment:

    Java 1.4
    Spring 1.2
    JBOSS 3.2.6

    Spring.jar is part of the project and the file sample-servlet.xml is in the WEB-INF folder of my project.


    Here is my 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">

    <!-- Copyright (c) 2002 by ObjectLearn. All Rights Reserved. -->
    <web-app>

    <servlet>
    <servlet-name>sample</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherSe rvlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    </servlet>

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

    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    /WEB-INF/xml/common-data.xml,
    /WEB-INF/xml/spring-data.xml,
    /WEB-INF/xml/spring-service.xml
    </param-value>
    </context-param>

    <context-param>
    <param-name>javax.servlet.jsp.jstl.fmt.localizationContex t</param-name>
    <param-value>
    config/internationalstrings
    </param-value>
    </context-param>

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

    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>

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

    </web-app>
    ***********************************+

    Here is my sample-servlet.xml

    <?xml version="1.0" encoding="UTF-8"?>

    <!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://localhost:8082/dtds/spring-beans.dtd'>

    <beans>
    <bean name="/index.htm" class="com.ldm.servlet.LoginController">
    <property name="formView"><value>login</value></property>
    <property name="successView"><value>welcome</value></property>
    </bean>


    <bean id="viewResolver" class="org.springframework.web.servlet.view.Intern alResourceViewResolver">
    <property name="prefix"><value>/WEB-INF/jsp/</value></property>
    <property name="suffix"><value>.jsp</value></property>
    </bean>

    </beans>
    ************************************************** **

    Here is what JBOSS produces while deploying:

    java.lang.ClassNotFoundException: org.springframework.web.servlet.DispatcherServlet at java.net.URLClassLoader$1.run....

    ************************************************** ***

    Does anyone have an idea what's wrong here??
    Thank you in advance

    Lori

  • #2
    Problem is solved. Of course I had to copy all the jars into
    WEB-INF/lib.

    Comment

    Working...
    X