-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: [Hibernate Validator]Hibernate Validator not found: ignoring
PostPosted: Tue Jul 05, 2011 10:12 am 
Newbie

Joined: Tue Jul 05, 2011 10:03 am
Posts: 5
Hello!
I've decided to try Hibernate Validator. I use hibernate-core 3.6.5.Final. In my pom.xml(I use maven) I've added dependency on hibernate-validator 4.2.0.Final:
Code:
<dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-validator</artifactId>
         <version>4.2.0.Final</version>
      </dependency>


All works good: when I use annotation @NotNull - columns in DB are also NOT NULL. When I use @Email - Exception is called, when I try to save object with invalid email. But when I see in hibernate's log, i find this information:

Code:
[INFO] 05 jul 2011 17:59:56,018 http-thread-pool-8080(2) [org.hibernate.cfg.Configuration]
  Hibernate Validator not found: ignoring


Is it bug? Or may be I didn't configure anything?


Top
 Profile  
 
 Post subject: Re: [Hibernate Validator]Hibernate Validator not found: ignoring
PostPosted: Tue Jul 05, 2011 12:23 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

the dependency looks good. How does your Hibernate configuration look like and how your annotated entities?

kiRach wrote:
When I use @Email - Exception is called, when I try to save object with invalid email. But when I see in hibernate's log, i find this information:

Code:
[INFO] 05 jul 2011 17:59:56,018 http-thread-pool-8080(2) [org.hibernate.cfg.Configuration]
  Hibernate Validator not found: ignoring


I am not sure I understand your problem. There is another property in your entity which you annotate with @Email and that throws an exception? But at the same time a @NotNull works (in the same entity)? You really have to explain yourself a little better here.
Btw, do you call the validation yourself or do you rely on JPA calling the validation on life cycle events?

--Hardy


Top
 Profile  
 
 Post subject: Re: [Hibernate Validator]Hibernate Validator not found: ignoring
PostPosted: Wed Jul 06, 2011 2:10 am 
Newbie

Joined: Tue Jul 05, 2011 10:03 am
Posts: 5
I beg your pardon for my english.

All is in operation normally and functions the way that I also expected it. I.e.: @NotNull and @Email annotations works good.

hibernate.cfg.xml is default for my project. I haven't added any specific information about Hibernate Validator.

Code:
<hibernate-configuration>
   <session-factory>
      <!-- Database connection settings -->
      <property name="connection.driver_class">com.mysql.jdbc.Driver</property>
      <property name="connection.url">jdbc:mysql://localhost:3306/hibernate_test</property>
      <property name="connection.username">root</property>
      <property name="connection.password">***</property>
      <!-- JDBC connection pool (use the built-in) -->
      <property name="connection.pool_size">1</property>
      <!-- SQL dialect -->
      <property name="dialect">org.hibernate.dialect.MySQLDialect</property>
      <!-- Enable Hibernate's automatic session context management -->
      <property name="current_session_context_class">thread</property>
      <!-- Disable the second-level cache  -->
      <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
      <!-- Echo all executed SQL to stdout -->
      <property name="show_sql">true</property>
      <!-- Drop and re-create the database schema on startup -->
      <property name="hbm2ddl.auto">update</property>

      <property name="id.new_generator_mappings">true</property>

      <mapping class="ru.bytex.domain.Player"/>
   </session-factory>
</hibernate-configuration>


But when I start project, I see in log:
Code:
[INFO] 05 jul 2011 17:59:56,018 http-thread-pool-8080(2) [org.hibernate.cfg.Configuration]
  Hibernate Validator not found: ignoring


It seems, that hibernate isn't able to find Hibernate Validator, but I've added dependecy and Hibernate Validator works good indeed.

Perhaps that all needs to be... Or I forgot something to configure?


Top
 Profile  
 
 Post subject: Re: [Hibernate Validator]Hibernate Validator not found: ignoring
PostPosted: Fri Jul 08, 2011 8:32 am 
Newbie

Joined: Tue Jul 05, 2011 10:03 am
Posts: 5
Can anybody help me?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.