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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:44:35+00:00 2026-05-27T21:44:35+00:00

I am using JSR 303 Bean validation in my JSF 2.0 web application and

  • 0

I am using JSR 303 Bean validation in my JSF 2.0 web application and it works fine with annotations. Now I would like to ignore annotations and configure validation rules using the validation.xml file, so this is what I did (I am using an eclipse dynamic web project) :

  1. Added validation.xml under WebContent/META-INF/validation.xml

    <?xml version="1.0" encoding="UTF-8"?>
    <validation-config
    xmlns="http://jboss.org/xml/ns/javax/validation/configuration"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/configuration validation-configuration-1.0.xsd"
    >
    
      <constraint-mapping>META-INF/validation/constraint-mapping.xml</constraint-mapping>
    
    </validation-config>
    
  2. Then created the file constraint-mapping.xml under WebContent/META-INF/validation/constraint-mapping.xml

    <constraint-mappings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                 xsi:schemaLocation="http://jboss.org/xml/ns/javax/validation/mapping validation-mapping-1.0.xsd"
                 xmlns="http://jboss.org/xml/ns/javax/validation/mapping">
    
    <bean class="my.full.path.ValidationMB" ignore-annotations="true">
    
    </bean>
    
    </constraint-mappings>
    

Having these configurations in place, I suppose the annotations in my bean class ValidationMB shall be ignored, BUT this is not happening!, which makes me assume that the validation.xml file is not being loaded.

any ideas? thanks.

Environment:

  1. Apache Tomcat 7.0.23
  2. javax.faces-2.1.4.jar
  3. hibernate-validator-4.2.0.Final.jar
  4. hibernate-validator-annotation-processor-4.2.0.Final.jar
  5. validation-api-1.0.0.GA.jar
  6. slf4j-api-1.6.1.jar

From the spec: section 4.4.6. XML Configuration: META-INF/validation.xml

Unless explicitly ignored by calling
Configuration.ignoreXMLConfiguration(), a Configuration takes into
account the configuration available in META-INF/validation.xml. This
configuration file is optional but can be used by applications to
refine some of the Bean Validation behavior. If more than one
META-INF/validation.xml file is found in the classpath, a
ValidationException is raised.

  • 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-27T21:44:35+00:00Added an answer on May 27, 2026 at 9:44 pm

    To solve my problem I had to create a META-INF folder under the project src folder, which ends in the WEB-INF/classes/META-INF.

    The structure of the web application is:

    ROOT
    |_META-INF -- don't put validation.xml here
    |_WEB-INF
        |__ classes
               |_META-INF
                    |__validation.xml
    

    But I think that if I pack my web application in a jar file and reuse it in another project It may not work, I will let you know later once I do it.

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

Sidebar

Related Questions

For the current project we're using JSR-303 annotations to validate our interface parameters. I
I have a bean to validate using jsr-303 but the BIndingResult returns no error.
I'm trying to set up JSR-303 validation of forms using Spring MVC. I had
I've started using Spring 3 Java Config with the JSR-330 @Inject annotations. Unlike the
I'm using Spring MVC 3 and JSR 303. I have a form backing object
I'm using Spring 3 and JSR 303. I have a form backing object whose
My spring web application is using ajax with spring, and it based in general
I started developing a portlet based application using WebSphere Portal and now I am
We're looking at using the JSR-330 javax.inject.* annotations instead of the com.google.inject.* equivalents. It
I am trying to validate a form using Spring with integrated JSR-303 validations with

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.