Announcement Announcement Module
Collapse
No announcement yet.
java.lang.NoSuchMethodError: org.springframework.web.servlet.HttpServletBean$Se rvletC Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.NoSuchMethodError: org.springframework.web.servlet.HttpServletBean$Se rvletC

    I have a simple web application and here are the details

    web.xml
    ---------
    <?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">

    <description>Spring MVC Test Application</description>

    <display-name>springweb</display-name>

    <servlet>
    <description>Spring MVC Dispatcher Servlet</description>
    <servlet-name>springweb</servlet-name>
    <servlet-class>
    org.springframework.web.servlet.DispatcherServlet
    </servlet-class>
    <init-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>/WEB-INF/springweb-servlet.xml</param-value>
    </init-param>
    </servlet>

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

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

    springweb-servlet.xml
    ----------------------

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>

    <bean id="loanCalcCo"
    class="org.himu.springweb.demo.LoanCalcController" >
    <property name="formView">
    <value>loanCalc</value>
    </property>
    <property name="successView">
    <value>loanCalcResult</value>
    </property>
    <property name="commandName">
    <value>loanInfo</value>
    </property>
    <property name="commandClass">
    <value>org.himu.springweb.demo.LoanInfo</value>
    </property>
    <property name="validator">
    <bean class="org.himu.springweb.demo.LoanCalcValidator"/>
    </property>
    </bean>

    <bean id="simpleUrlMapping"
    class="org.springframework.web.servlet.handler.Sim pleUrlHandlerMapping">
    <property name="mappings">
    <props>
    <prop key="/home.htm">homePageCo</prop>
    <prop key="/loancalc.htm">loanCalcCo</prop>
    </props>
    </property>
    </bean>

    <bean name="/home.htm"
    class="org.himu.springweb.co.HomePageController"/>

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






    <!--
    <bean id="urlBasedViewResolver"
    class="org.springframework.web.servlet.view.UrlBas edViewResolver">
    <property name="viewClass" value="org.springframework.web.servlet.view.tiles2 .TilesView"/>
    <property name="order" value="1"/>
    </bean>


    <bean id="messageSource"
    class="org.springframework.context.support.Resourc eBundleMessageSource">
    <property name="basenames">
    <list>
    <value>messages</value>
    <value>errors</value>
    </list>
    </property>
    </bean>

    -->
    </beans>

    I use Tom-cat 6.x when i enter http://localhost:8080/home.htm i get the following error

    java.lang.NoSuchMethodError: org.springframework.web.servlet.HttpServletBean$Se rvletConfigPropertyValues.addPropertyValue(Lorg/springframework/beans/PropertyValueV
    org.springframework.web.servlet.HttpServletBean$Se rvletConfigPropertyValues.<init>(HttpServletBean.j ava:146)
    org.springframework.web.servlet.HttpServletBean$Se rvletConfigPropertyValues.<init>(HttpServletBean.j ava:129)
    org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:89)
    javax.servlet.GenericServlet.init(GenericServlet.j ava:212)
    org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:104)
    org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:216)
    org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
    org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:634)
    org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:445)
    java.lang.Thread.run(Thread.java:595)

  • #2
    NoSuchMethodError most assuredly means you are mixing different versions of the Spring JAR files. Delete them all (don't forget to look in the server's lib directory) and copy all the files from the Spring distro again.

    Comment


    • #3
      java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApp licati

      Hi

      I have changed my Jars to spring version-2.5, I am using spring.jar and spring-webmvc.jar every other details are same as mentioned in my previous context, Now i get the following exception

      java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApp licationContext.setServletConfig(Ljavax/servlet/ServletConfigV
      org.springframework.web.servlet.FrameworkServlet.c reateWebApplicationContext(FrameworkServlet.java:3 22)
      org.springframework.web.servlet.FrameworkServlet.i nitWebApplicationContext(FrameworkServlet.java:266 )
      org.springframework.web.servlet.FrameworkServlet.i nitServletBean(FrameworkServlet.java:236)
      org.springframework.web.servlet.HttpServletBean.in it(HttpServletBean.java:126)
      javax.servlet.GenericServlet.init(GenericServlet.j ava:212)
      org.apache.catalina.valves.ErrorReportValve.invoke (ErrorReportValve.java:104)
      org.apache.catalina.connector.CoyoteAdapter.servic e(CoyoteAdapter.java:216)
      org.apache.coyote.http11.Http11Processor.process(H ttp11Processor.java:844)
      org.apache.coyote.http11.Http11Protocol$Http11Conn ectionHandler.process(Http11Protocol.java:634)
      org.apache.tomcat.util.net.JIoEndpoint$Worker.run( JIoEndpoint.java:445)
      java.lang.Thread.run(Thread.java:595)

      Comment


      • #4
        java.lang.NoSuchMethodError: org.springframework.web.context.ConfigurableWebApp licati

        Hi
        I am trrying to implement the tutorial posted at the following address

        http://mhimu.wordpress.com/2007/11/2...-mvc-tutorial/

        Comment

        Working...
        X