Results 1 to 2 of 2

Thread: NoSuchMethodException is thrown when deploying spring app into tomcat

Threaded View

  1. #1
    Join Date
    Dec 2012
    Posts
    1

    Default NoSuchMethodException is thrown when deploying spring app into tomcat

    Hi,

    When I try to deploy the sample application(springblog) from "Pro Spring3" book into tomcat, I always got a java.lang.NoSuchMethodException which indicates that it failed to parse the DelegatingFilterProxy in web.xml. I am sure that all the corresponding spring jars are there. But I don't know why it still fails. Could anyone give some tips ?

    Thanks in advance!

    1. This is the content of web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd" id="WebApp_ID" version="3.0">
    <!-- The definition of the Root Spring Container shared by all Servlets and Filters -->
    <!-- Enable escaping of form submission contents -->
    <context-param>
    <param-name>defaultHtmlEscape</param-name>
    <param-value>true</param-value>
    </context-param>
    <context-param>
    <param-name>spring.profiles.active</param-name>
    <!-- Spring profile parameters
    First profile: jpa - JPA implementation
    mybatis - MyBatis implementation
    Second profile: mysql - MySQL DB
    h2 - H2 database
    -->
    <param-value>jpa,h2</param-value>
    </context-param>
    <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
    /WEB-INF/spring/root-context.xml
    /WEB-INF/spring/datasource.xml
    /WEB-INF/spring/batch-context.xml
    /WEB-INF/spring/*-tx-config.xml
    /WEB-INF/spring/*-service-context.xml
    </param-value>
    </context-param>

    <!-- Spring Security Configuration -->
    <filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFil terProxy</filter-class>
    </filter>


    <filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
    </filter-mapping>
    ...
    </web-app>

    2. This is the error output of tomcat when it starts:
    WARNING: [SetPropertiesRule]{Context/Loader} Setting property 'useSystemClassLoaderAsParent' to 'false' did not find a matching property.
    Dec 14, 2012 8:20:19 AM org.apache.tomcat.util.digester.Digester endElement
    SEVERE: End event threw exception
    java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addFilter
    at org.apache.tomcat.util.IntrospectionUtils.callMeth od1(IntrospectionUtils.java:855)
    at org.apache.tomcat.util.digester.SetNextRule.end(Se tNextRule.java:201)
    at org.apache.tomcat.util.digester.Digester.endElemen t(Digester.java:1051)
    at com.sun.org.apache.xerces.internal.parsers.Abstrac tSAXParser.endElement(AbstractSAXParser.java:606)
    ...
    at java.lang.Thread.run(Thread.java:722)
    Dec 14, 2012 8:20:19 AM org.apache.catalina.startup.ContextConfig parseWebXml
    SEVERE: Parse error in application web.xml file at jndi:/localhost/springblog/WEB-INF/web.xml
    org.xml.sax.SAXParseException; systemId: jndi:/localhost/springblog/WEB-INF/web.xml; lineNumber: 34; columnNumber: 14; Error at (34, 14) : org.apache.catalina.deploy.WebXml addFilter

    at org.apache.tomcat.util.digester.Digester.createSAX Exception(Digester.java:2687)
    ...
    at java.lang.Thread.run(Thread.java:722)
    Caused by: java.lang.NoSuchMethodException: org.apache.catalina.deploy.WebXml addFilter
    at org.apache.tomcat.util.IntrospectionUtils.callMeth od1(IntrospectionUtils.java:855)
    at org.apache.tomcat.util.digester.SetNextRule.end(Se tNextRule.java:201)
    at org.apache.tomcat.util.digester.Digester.endElemen t(Digester.java:1051)
    ... 30 more
    Dec 14, 2012 8:20:19 AM org.apache.catalina.startup.ContextConfig parseWebXml
    SEVERE: Occurred at line 34 column 14

    Dec 14, 2012 8:20:19 AM org.apache.catalina.startup.ContextConfig configureStart
    SEVERE: Marking this application unavailable due to previous error(s)
    Dec 14, 2012 8:20:19 AM org.apache.catalina.core.StandardContext startInternal
    SEVERE: Error getConfigured
    Dec 14, 2012 8:20:19 AM org.apache.catalina.core.StandardContext startInternal
    SEVERE: Context [/springblog] startup failed due to previous errors
    Last edited by rc_hz; Dec 13th, 2012 at 06:43 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •