-->
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.  [ 2 posts ] 
Author Message
 Post subject: Hibernate Validator ClassNotFoundException
PostPosted: Tue Nov 05, 2013 5:01 am 
Newbie

Joined: Tue Nov 05, 2013 4:28 am
Posts: 3
Hi Developers!

I am using Hibernate Validator for my project, and when I want to customize the message for a constraint violation using EL expression like:

Code:
  @Past(message = "${pastDateMessage}")
  private Calendar aPastDate;


Then I recieve java.lang.ClassNotFoundException: com.sun.el.ExpressionFactoryImpl

I am using Maven for building the project and get the external dependencies

Code:
         <dependency>
            <groupId>javax.el</groupId>
            <artifactId>javax.el-api</artifactId>
            <version>2.2.4</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>javax.el</artifactId>
            <version>2.2.4</version>
        </dependency>
        <dependency>
            <groupId>org.glassfish.web</groupId>
            <artifactId>el-impl</artifactId>
            <version>2.2</version>
        </dependency>


Can you help me please to solve this issue?

Thank you for your time and understanding!

Best Regards,

YouCan


Top
 Profile  
 
 Post subject: Re: Hibernate Validator ClassNotFoundException
PostPosted: Tue Nov 05, 2013 2:01 pm 
Hibernate Team
Hibernate Team

Joined: Sat Jan 24, 2009 12:46 pm
Posts: 388
Hi,

You only should add the first two of these dependencies. When does the error occur, during unit tests or when deployed to a container?

Note that you shouldn't add these dependencies to your app (e.g. a WAR) when deploying it to a container such as WildFly or Tomcat, as they already provide these libs.

--Gunnar

_________________
Visit my blog at http://musingsofaprogrammingaddict.blogspot.com/


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