Problem with class org.hibernate.validator.InvalidValue when upgrading from Hibernate 3.X to 4.X

0

I have a project developed using JBoss Seam 2.2.2.Final together with Hibernate 3.6 . I'm trying to upgrade this project by uploading and migrating the component versions that it uses. One of these migrations is to upgrade the version of Hibernate to version 4.6.3.Final , which at the date of this posting is the last stable release.

As the project is in Maven, the first thing I did was to update the dependencies of the project by upgrading the versions of Hibernate. As follows:

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-core</artifactId>
    <version>4.3.4.Final</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-entitymanager</artifactId>
    <version>4.3.4.Final</version>
    <scope>provided</scope>
</dependency>

<dependency>
    <groupId>org.hibernate</groupId>
    <artifactId>hibernate-envers</artifactId>
    <version>4.3.4.Final</version>
    <scope>provided</scope>
</dependency>

However, when doing the version updates in pom.xml , the project began to display compilation error in something related to Hibernate. See the code snippet below:

ResourceBundle bundle = SeamResourceBundle.getBundleNamed(NOME_BUNDLE);
StringBuilder msg = new StringBuilder("");
msg.append(bundle.getString(MSG_GERAL));
StatusMessages.instance().add(msg.toString()); //Erro ocorre aqui

In the fourth line of the above excerpt, an error related to class org.hibernate.validator.InvalidValue (link documentation ). The error that occurs is shown by Eclipse:

  

The type org.hibernate.validator.InvalidValue can not be resolved. It   is indirectly referenced from required .class files

Does anyone know how to fix this problem? Or do you know any workaround for this?

    
asked by anonymous 24.03.2014 / 14:20

1 answer

1

The hibernate validator has been updated in version 4 of hibernate.

Add in your dependencies:

  <dependency>
     <groupId>org.hibernate</groupId>
     <version>4.0.2.GA</version>
     <artifactId>hibernate-validator-legacy</artifactId>
   </dependency>

To maintain compatibility.

    
25.03.2014 / 17:20