-->
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.  [ 10 posts ] 
Author Message
 Post subject: hibenate-validator 4.0.2.GA with hibernate 3.5.0-Beta-2
PostPosted: Sat Nov 21, 2009 11:14 am 
Newbie

Joined: Wed May 03, 2006 6:38 am
Posts: 18
I'm developing a webapp based on hibernate&validator&seam. Here is my dependency list:

Code:
      <dependency>
         <groupId>org.jboss.seam</groupId>
         <artifactId>jboss-seam</artifactId>
         <version>2.2.0.GA</version>
         <scope>compile</scope>
      </dependency>
      <dependency>
         <groupId>org.jboss.seam</groupId>
         <artifactId>jboss-seam-ui</artifactId>
         <version>2.2.0.GA</version>
         <scope>compile</scope>
      </dependency>
      <dependency>
         <groupId>org.jboss.seam</groupId>
         <artifactId>jboss-seam-mail</artifactId>
         <version>2.2.0.GA</version>
         <scope>compile</scope>
      </dependency>      
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-core</artifactId>
         <version>3.5.0-Beta-2</version>
      </dependency>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-annotations</artifactId>
         <version>3.5.0-Beta-2</version>
      </dependency>
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-entitymanager</artifactId>
         <version>3.5.0-Beta-2</version>
      </dependency>
      <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.0.2.GA</version>
      </dependency>      


I'm getting the exception below while app goes up:

Code:
SEVERE: Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
java.lang.RuntimeException: Could not create Component: org.jboss.seam.international.statusMessages
   at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1202)
   at org.jboss.seam.init.Initialization.installComponents(Initialization.java:1118)
   at org.jboss.seam.init.Initialization.init(Initialization.java:733)
   at org.jboss.seam.servlet.SeamListener.contextInitialized(SeamListener.java:36)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3843)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4350)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
   at org.apache.catalina.core.StandardHost.start(StandardHost.java:719)
   at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
   at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:443)
   at org.apache.catalina.core.StandardService.start(StandardService.java:516)
   at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
   at org.apache.catalina.startup.Catalina.start(Catalina.java:578)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:288)
   at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:413)
Caused by: java.lang.NoClassDefFoundError: org/hibernate/validator/InvalidValue
   at java.lang.Class.getDeclaredMethods0(Native Method)
   at java.lang.Class.privateGetDeclaredMethods(Class.java:2427)
   at java.lang.Class.privateGetPublicMethods(Class.java:2547)
   at java.lang.Class.privateGetPublicMethods(Class.java:2563)
   at java.lang.Class.getMethods(Class.java:1410)
   at org.jboss.seam.Component.hasAnnotation(Component.java:1158)
   at org.jboss.seam.Component.<init>(Component.java:218)
   at org.jboss.seam.Component.<init>(Component.java:205)
   at org.jboss.seam.init.Initialization.addComponent(Initialization.java:1186)
   ... 18 more
Caused by: java.lang.ClassNotFoundException: org.hibernate.validator.InvalidValue
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1360)
   at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1206)
   at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:402)
   ... 27 more


where does that class org.hibernate.validator.InvalidValue resides?


Top
 Profile  
 
 Post subject: Re: hibenate-validator 4.0.2.GA with hibernate 3.5.0-Beta-2
PostPosted: Mon Nov 23, 2009 3:15 pm 
Hibernate Team
Hibernate Team

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

InvalidValue is a class from the legacy validator (Validator 3.x). Seems to be a dependency problem.
Can you run 'mvn dependency:tree' to get a full list of all included dependencies (including transitive ones).

--Hardy


Top
 Profile  
 
 Post subject: Re: hibenate-validator 4.0.2.GA with hibernate 3.5.0-Beta-2
PostPosted: Fri Dec 04, 2009 12:01 pm 
Newbie

Joined: Fri Dec 04, 2009 11:55 am
Posts: 2
Have the same problem.

Code:
java.lang.RuntimeException: Could not create Component: org.jboss.seam.international.statusMessages


That class defines add and addToControls methods which parametrized with InvalidValue[].

But anyway I followed with your suggestion and re-checked that I have no older hibernate validator 3.x dependency.


Top
 Profile  
 
 Post subject: Re: hibenate-validator 4.0.2.GA with hibernate 3.5.0-Beta-2
PostPosted: Sun Dec 13, 2009 1:41 pm 
Newbie

Joined: Sun May 09, 2004 1:50 am
Posts: 3
I fixed this by replacing the dependency to hibernate-validator with something like

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

_________________
-- Antonio


Top
 Profile  
 
 Post subject: Re: hibenate-validator 4.0.2.GA with hibernate 3.5.0-Beta-2
PostPosted: Mon Dec 14, 2009 10:07 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
It depends what you mean with fixing. By added hibernate-validator-legacy as a dependency you are basically back to using the old 3.x Validator (hence legacy). If this is what you want then great.

However, I would recommend to upgrade to Hibernate Validator 4.x since it implements the Bean Validation standard. In fact it is the official reference implementation.


Top
 Profile  
 
 Post subject: Re: hibenate-validator 4.0.2.GA with hibernate 3.5.0-Beta-2
PostPosted: Mon Dec 14, 2009 2:26 pm 
Newbie

Joined: Sun May 09, 2004 1:50 am
Posts: 3
hardy.ferentschik wrote:
It depends what you mean with fixing. By added hibernate-validator-legacy as a dependency you are basically back to using the old 3.x Validator (hence legacy). If this is what you want then great. However, I would recommend to upgrade to Hibernate Validator 4.x since it implements the Bean Validation standard. In fact it is the official reference implementation.


I see your point.

However, I am currently working with Seam 2.2.0.GA (forgot to mention it earlier) and could not find any alternative other than using the old validator to avoid the ClassNotFoundException error mentioned by the initial poster. Is there a way to really fix this and use the new validator?

Thanks.

_________________
-- Antonio


Top
 Profile  
 
 Post subject: Re: hibenate-validator 4.0.2.GA with hibernate 3.5.0-Beta-2
PostPosted: Wed Dec 16, 2009 10:03 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Upgrading Seam? Maybe ask the question at the Seam forum?


Top
 Profile  
 
 Post subject: Re: hibenate-validator 4.0.2.GA with hibernate 3.5.0-Beta-2
PostPosted: Wed Dec 16, 2009 10:22 am 
Newbie

Joined: Fri Dec 04, 2009 11:55 am
Posts: 2
https://jira.jboss.org/jira/browse/JBSEAM-4500


Top
 Profile  
 
 Post subject: Re: hibenate-validator 4.0.2.GA with hibernate 3.5.0-Beta-2
PostPosted: Fri Feb 12, 2010 2:03 pm 
Newbie

Joined: Thu Dec 03, 2009 11:11 am
Posts: 1
I had the same problem and resolved using:

Code:
      <dependency>
         <groupId>org.hibernate</groupId>
         <artifactId>hibernate-validator</artifactId>
         <version>3.1.0.GA</version>
      </dependency>


Top
 Profile  
 
 Post subject: Re: hibenate-validator 4.0.2.GA with hibernate 3.5.0-Beta-2
PostPosted: Mon Feb 15, 2010 7:45 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
3.1.0.GA is as mentioned the obsolete/legacy branch of Hibernate Validator. Adding this dependency probably makes the exception disappears, but you are still not using Bean Validation.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 10 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.