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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:11:45+00:00 2026-05-28T14:11:45+00:00

I have problem with using Hibernate Validator with GWT 2.4. When module is starting

  • 0

I have problem with using Hibernate Validator with GWT 2.4. When module is starting i get error:

00:00:05,562 [ERROR] Deferred binding result type
‘javax.validation.ValidatorFactory’ should not be abstract

java.lang.RuntimeException: Deferred binding failed for
‘javax.validation.ValidatorFactory’ (did you forget to inherit a
required module?)
…

module configuration:

<module rename-to='start'>
  ...
  <inherits name="com.google.gwt.validation.Validation" />
  <!-- with this doesn't work too 
  <inherits name="org.hibernate.validator.HibernateValidator" />
  -->
  ...
</module>

entry point:

public class Start implements EntryPoint {
    public void onModuleLoad() {

        final ValidatorFactory factory = Validation.byDefaultProvider().configure().buildValidatorFactory();
        ...
    }
}

pom.xml

<dependency>
  <groupId>javax.validation</groupId>
  <artifactId>validation-api</artifactId>
  <version>1.0.0.GA</version>
</dependency>
<dependency>
  <groupId>org.hibernate</groupId>
  <artifactId>hibernate-validator</artifactId>
  <version>4.2.0.Final</version>
</dependency>
  • 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-28T14:11:45+00:00Added an answer on May 28, 2026 at 2:11 pm

    SOLVED this!
    According to http://code.google.com/p/google-web-toolkit/wiki/BeanValidation i had to implement custom MyValidatorFactory and add to project hibernate-validator sources .jar.

    GWT module configuration:

    <!-- hibernate validator -->
    <inherits name="org.hibernate.validator.HibernateValidator" />
    <replace-with class="net.marioosh.gwt.client.MyValidatorFactory">
      <when-type-is class="javax.validation.ValidatorFactory" />
    </replace-with>
    

    MyValidatorFactory

    package net.marioosh.gwt.client;
    
    import javax.validation.Validator;
    import net.marioosh.gwt.shared.model.entities.Link;
    import com.google.gwt.core.client.GWT;
    import com.google.gwt.validation.client.AbstractGwtValidatorFactory;
    import com.google.gwt.validation.client.GwtValidation;
    import com.google.gwt.validation.client.impl.AbstractGwtValidator;
    
    public class MyValidatorFactory extends AbstractGwtValidatorFactory {
    
        /**
         * Only the classes listed in the {@link GwtValidation} annotation can be validated.
         * In my example: Link.class can be validated
         */
        @GwtValidation(value = { Link.class })
        public interface GwtValidator extends Validator {
        }
    
        @Override
        public AbstractGwtValidator createValidator() {
            return GWT.create(GwtValidator.class);
        }
    
    }
    

    Hibernate validator sources are needed also

    <!-- local dependency -->
    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-validator-sources</artifactId>
        <version>4.2.0.Final</version>
        <scope>system</scope>
        <systemPath>${project.basedir}/src/main/webapp/WEB-INF/lib/hibernate-validator-4.2.0.Final-sources.jar</systemPath>
    </dependency>       
    

    Using:

    public void onModuleLoad() {
        final ValidatorFactory factory = Validation.byDefaultProvider().configure().buildValidatorFactory();
        final Validator validator = factory.getValidator();
        ...
    
        Link l = new Link(....);
        Set<ConstraintViolation<Link>> violations = validator.validate(l);
    
        if(!violations.isEmpty()) {
               // validation fail
        } else {
               // validation success
        }
        ...
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a problem with a query using hibernate. The entity class EntityClass has
I've been using Hibernate for years and never have a problem with it, but
I have problem in creating tinyint field in MySQL database using Hibernate. I used
I have a problem using Hibernate and PostgreSQL for production and HSQLDB for testing.
I'm handling a problem in downcasting a query.uniqueResult() using hibernate. I have 2 classes:
I have a problem with my hibernate mapping using EmbeddedId. My code looks like
I have a very weird problem. Have an application using Hibernate and spring.I have
i have one problem in one-to-many mapping using hibernate. i have 2 classes, Person
I have a problem with hashCode() that delegates to uninitialized objects using hibernate. My
I'm running into a performance problem in my SQL using Hibernate's DetachedCriteria. I have

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.