-->
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.  [ 1 post ] 
Author Message
 Post subject: Hibernate 4.1.4 integration with Jersey 2.22
PostPosted: Tue Oct 06, 2015 2:08 pm 
Newbie

Joined: Tue Mar 31, 2015 3:47 pm
Posts: 3
I'm using Jersey 2.22 and Hibernate 4.1.4.

According to the Jersey documentation:

Quote:
Bean Validation support in Jersey is provided as an **extension module** and needs to be mentioned explicitly in your pom.xml file (in case of using Maven)

As far as I can understand, it's not required. However, I'm using Hibernate as well in my project and this may be a huge factor.

Funny thing is that I don't use bean validation in my Hibernate, everything's old school configured in XML (mapping, persistence, session factory, etc). When I use my Hibernate project alone with Struts2 or plain Servlet projects, it works perfectly.

This error comes up
Code:
org.hibernate.HibernateException: Error applying BeanValidation relational constraints
whenever I include the
Code:
validation-api-1.1.0-Final.jar
, which came from the Jersey bundle, as part of my dependencies.

The temporary fix I made is to disable
Code:
javax.persistence.validation.mode
in my Hibernate configuration and everything worked out alright. But the problem is, I don't want to touch my configuration anymore since this Hibernate project is used across all my projects and I fear that this small change might make a huge impact - paranoia I guess.

So I have two questions:

1. Why is Jersey requiring me to include a bean validation dependency? (requiring in the sense that if I don't have one, my app will keep throwing an exception)
2. Seeing that I don't use bean validations for Hibernate but intend to use bean validations in Jersey, am I better off disabling
Code:
javax.persistence.validation.mode
? or will it be best to just include a bean validation jar?


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

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.