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 8796951
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:44:31+00:00 2026-06-13T23:44:31+00:00

I am trying to add another filter named captcha verification filter along with spring

  • 0

I am trying to add another filter named captcha verification filter along with spring security’s authentication filter.
I am getting this error. What I am missing ?
Initialization of bean failed; nested exception is org.springframework.beans.ConversionNotSupportedException: Failed to convert property value of type ‘java.util.LinkedHashMap’ to required type ‘java.util.Map’ for property ‘filterChainMap’; nested exception is java.lang.IllegalStateException: Cannot convert value of type [com.asu.edu.base.vo.CaptchaFilterVO] to required type [javax.servlet.Filter] for property ‘filterChainMap[/**][3]’: no matching editors or conversion strategy found

My .java file

public class CaptchaFilterVO {
    @Autowired
    private ReCaptcha reCaptcha = null;

    public void doFilterInternal(HttpServletRequest req, HttpServletResponse res,
            FilterChain chain) throws IOException, ServletException {       
        String recaptcha_response = req.getParameter("recaptcha_response_field");
        String recaptcha_challenge = req.getParameter("recaptcha_challenge_field");
        String remoteAddress = req.getRemoteAddr();
        ReCaptchaResponse reCaptchaResponse = this.reCaptcha.checkAnswer(
                remoteAddress, recaptcha_challenge, recaptcha_response);
        if (!reCaptchaResponse.isValid()) {

            System.out.println("Captcha worong. Please try again.");        

        } 
        else 
        {
            System.out.println("Captcha correct. No need to try again.");
        }
        chain.doFilter(req, res);
    }
}

springsecurity.xml

     <http auto-config="true">
        <!-- intercept-url pattern="/welcome*" access="ROLE_DEPARTMENT_MGR,ROLE_REGULAR_EMP,ROLE_GUEST_USR,ROLE_CORPORATE_MGR" />
        <intercept-url pattern="/admin*" access="ROLE_ADMIN" /-->
        <intercept-url pattern="/login" filters="none" />
        <intercept-url pattern="/resources*" filters="none" />
        <intercept-url pattern="/register" filters="none" />
        <intercept-url pattern="/logout" filters="none" />
        <intercept-url pattern="/loginfailed" filters="none" />
        <intercept-url pattern="/admin*" access="ROLE_ADMIN" />
        <intercept-url pattern="/Dashboard*" access="ROLE_DEPARTMENT_MGR,ROLE_REGULAR_EMP,ROLE_CORPORATE_MGR" />
        <intercept-url pattern="/*" access="IS_AUTHENTICATED_FULLY"/>
        <form-login login-page="/login" default-target-url="/"
            authentication-failure-url="/loginfailed"   />
        <logout logout-success-url="/logout" />
        <custom-filter ref="captchaVerifierFilter" after="FORM_LOGIN_FILTER"/>

</http>     
 <beans:bean id="captchaVerifierFilter" class="com.asu.edu.base.vo.CaptchaFilterVO"/>
 <beans:bean id="springSecurityFilterChain" class="org.springframework.web.filter.DelegatingFilterProxy"/>
<beans:bean id="myfilterChainProxy" class="org.springframework.security.web.FilterChainProxy">
    <filter-chain-map path-type="ant">     
         <filter-chain pattern="/*" filters="springSecurityFilterChain,captchaVerifierFilter"/>
    </filter-chain-map>
 </beans:bean>

EDIT: public class CaptchaFilterVO extends OncePerRequestFilter implements javax.servlet.Filter
Now I have extended OncePerRequestFilter class but now I am facing a crash. Any help please.
org.springframework.web.util.NestedServletException: Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [org.springframework.http.HttpRequest]: Specified class is an interface
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:894)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:778)
javax.servlet.http.HttpServlet.service(HttpServlet.java:621)
javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:368)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:109)
org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:83)
org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:380)

  • 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-06-13T23:44:32+00:00Added an answer on June 13, 2026 at 11:44 pm

    Name of your method (doFilterInternal) suggests that you wanted to extend org.springframework.web.filter.OncePerRequestFilter.

    Add:

    extends OncePerRequestFilter
    

    after the name of your class.

    OncePerRequestFilter implements javax.servlet.Filter.

    and…

    Filter base class that guarantees to be just executed once per request,
    on any servlet container. It provides a doFilterInternal
    method with HttpServletRequest and HttpServletResponse arguments.
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi I'm trying to add some another field to this php contact form I
I am new to wordpress and widgets. I am trying to add another field
I am trying to make a button to add another input box every time
The .add method appends components to the end of another component. I'm trying to
I am trying to insert a div inside another div using add() of jquery
I am trying to add another <a> element after <a id='link1'> <html> <head> <script
I am trying to add another varable where on doesn't exist. It is a
I am trying to add another subview programmatically based on some event (user taps
I have a method and I am trying to add another method as a
I am trying to add a before_destroy filter to Devise's SessionsController. Here is what

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.