Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7075271
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:09:26+00:00 2026-05-28T06:09:26+00:00

I started a gwt spring 3 project thought spring roo. Then I took roo

  • 0

I started a gwt spring 3 project thought spring roo. Then I took roo off the project and implemented spring security, everything working as expected.

But I am having a problem to add restful controllers to my project. Basically it should have been easy, but, since I am using GWT, maybe it has to do with some of the configurations.

org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping#0’: Initialization of bean failed; nested exception is java.lang.NoSuchMethodError: org.springframework.web.bind.annotation.RequestMapping.consumes()[Ljava/lang/String;

I thought this would mean I am missing some kind of dependency, but I checked, I am using all spring dependencies possible and required in all example projects that I researched, so I am assuming its another thing.

My restful controller below

@RequestMapping("/api")
@Controller
public class TestControler {

   @RequestMapping("/test")
   @ResponseBody
   public String getAll() {
      return "aba";
   }

My web.xml

    <context-param>
        <param-name>defaultHtmlEscape</param-name>
        <param-value>true</param-value>
    </context-param>

    <context-param>
        <param-name>contextConfigLocation</param-name>
        <param-value>classpath*:META-INF/spring/applicationContext*.xml 
        </param-value>
    </context-param>

    <filter>
        <filter-name>CharacterEncodingFilter</filter-name>
        <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
        <init-param>
            <param-name>encoding</param-name>
            <param-value>UTF-8</param-value>
        </init-param>
        <init-param>
            <param-name>forceEncoding</param-name>
            <param-value>true</param-value>
        </init-param>
    </filter>

    <filter>
        <filter-name>HttpMethodFilter</filter-name>
        <filter-class>org.springframework.web.filter.HiddenHttpMethodFilter</filter-class>
    </filter>

    <filter>
        <filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
        <filter-class>org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter</filter-class>
    </filter>    

    <listener>
        <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
    </listener>

    <filter>
        <filter-name>springSecurityFilterChain</filter-name>
        <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    </filter>
    <filter-mapping>
        <filter-name>springSecurityFilterChain</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>    

    <filter-mapping>
        <filter-name>CharacterEncodingFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>HttpMethodFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>

    <filter-mapping>
        <filter-name>Spring OpenEntityManagerInViewFilter</filter-name>
        <url-pattern>/*</url-pattern>
    </filter-mapping>    

    <!-- Handles Spring requests -->
    <servlet>
        <servlet-name>myapp</servlet-name>
        <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
        <init-param>
            <param-name>contextConfigLocation</param-name>
            <param-value>WEB-INF/spring/webmvc-config.xml</param-value>
        </init-param>
        <load-on-startup>1</load-on-startup>
    </servlet>

    <servlet>
        <servlet-name>requestFactory</servlet-name>
        <servlet-class>com.myapp.CustomRequestFactoryServlet</servlet-class>
    </servlet>       

    <servlet-mapping>
        <servlet-name>myapp</servlet-name>
        <url-pattern>/</url-pattern>
    </servlet-mapping>    

    <servlet-mapping>
        <servlet-name>requestFactory</servlet-name>
        <url-pattern>/gwtRequest</url-pattern>
    </servlet-mapping>
    <session-config>
        <session-timeout>10</session-timeout>
    </session-config>

My servlet spring mvc config

<context:component-scan base-package="br.ufsc.inf.citymobile"
    use-default-filters="false">
    <context:include-filter expression="org.springframework.stereotype.Controller"
        type="annotation" />
</context:component-scan>

<mvc:annotation-driven />

<mvc:resources location="/, classpath:/META-INF/web-resources/"
    mapping="/resources/**" />

<mvc:default-servlet-handler />

<mvc:interceptors>
    <bean class="org.springframework.web.servlet.theme.ThemeChangeInterceptor" />
    <bean class="org.springframework.web.servlet.i18n.LocaleChangeInterceptor"
        p:paramName="lang" />
</mvc:interceptors>

<mvc:view-controller path="/" view-name="index" />
<mvc:view-controller path="/uncaughtException" />
<mvc:view-controller path="/resourceNotFound" />
<mvc:view-controller path="/dataAccessFailure" />

<bean       class="org.springframework.context.support.ReloadableResourceBundleMessageSource"
    id="messageSource" p:basenames="WEB-INF/i18n/messages,WEB-INF/i18n/application"
    p:fallbackToSystemLocale="false" />

<bean class="org.springframework.web.servlet.i18n.CookieLocaleResolver"
    id="localeResolver" p:cookieName="locale" />

<bean
    class="org.springframework.ui.context.support.ResourceBundleThemeSource"
    id="themeSource" />

<bean class="org.springframework.web.servlet.theme.CookieThemeResolver"
    id="themeResolver" p:cookieName="theme" p:defaultThemeName="standard" />

<bean       class="org.springframework.web.servlet.handler.SimpleMappingExceptionResolver"
    p:defaultErrorView="uncaughtException">
    <property name="exceptionMappings">
        <props>
            <prop key=".DataAccessException">dataAccessFailure</prop>
            <prop key=".NoSuchRequestHandlingMethodException">resourceNotFound</prop>
            <prop key=".TypeMismatchException">resourceNotFound</prop>
            <prop key=".MissingServletRequestParameterException">resourceNotFound</prop>
        </props>
    </property>
</bean>

<bean
    class="org.springframework.web.multipart.commons.CommonsMultipartResolver"
    id="multipartResolver" />

My application context

<context:annotation-config />

<context:property-placeholder location="classpath*:META-INF/spring/*.properties" />

<context:spring-configured />

<context:component-scan base-package="br.ufsc.inf.citymobile">
    <context:exclude-filter expression=".*_Roo_.*"
        type="regex" />
    <context:exclude-filter expression="org.springframework.stereotype.Controller"
        type="annotation" />
</context:component-scan>

<bean class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close" id="dataSource">
    <property name="driverClassName" value="${database.driverClassName}" />
    <property name="url" value="${database.url}" />
    <property name="username" value="${database.username}" />
    <property name="password" value="${database.password}" />
    <property name="testOnBorrow" value="true" />
    <property name="testOnReturn" value="true" />
    <property name="testWhileIdle" value="true" />
    <property name="timeBetweenEvictionRunsMillis" value="1800000" />
    <property name="numTestsPerEvictionRun" value="3" />
    <property name="minEvictableIdleTimeMillis" value="1800000" />
</bean>

<bean class="org.springframework.orm.jpa.JpaTransactionManager"
    id="transactionManager">
    <property name="entityManagerFactory" ref="entityManagerFactory" />
</bean>

<tx:annotation-driven mode="aspectj"
    transaction-manager="transactionManager" />

<bean
    class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
    id="entityManagerFactory">
    <property name="persistenceUnitName" value="persistenceUnit" />
    <property name="dataSource" ref="dataSource" />
</bean>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:09:27+00:00Added an answer on May 28, 2026 at 6:09 am

    Your version of Spring is too old.

    The exception is complaining about a missing method (RequestMapping.consume), which was only introduced in Spring 3.1. It’s not in Spring 3.0.

    You need to upgrade to Spring 3.1

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I just started working on a huge gwt project and asked myself if there
I´ve just started learning GWT and I´m trying to implement http://gwt.google.com/samples/Showcase/Showcase.html#!CwFileUpload and but failing
I'm just getting started with a project that combines GWT, Google App Engine and
I have a basic GWT Maven project going. I added SmartGWT and started playing
I started off programming in Basic on the ZX81 , then BASICA , GW-BASIC
I just started a new GWT project for a client and I'm interested in
I just started to port twitter's bootstrap to GWT (see the github project here
Something I have found strange since I started working on GWT is how few
I'm working on a small GWT project in Intellij using their built-in support. Dev
I am using GWT in a project and recently started using the WindowBuilder in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.