56 questions
3
votes
0
answers
297
views
Custom validation without annotation in spring
I have validations in my application which are built based on spring validation annotations like NotNull, NotEmpty.
public class AccountCreateRequest {
@NotNull
private String accountName;
...
2
votes
1
answer
1k
views
Spring Boot, Hibernate validator language based on LocaleContextHolder
I've a Spring Boot 2.4.2 REST application using JPA, Hibernate, etc.
So far I use a MessageSource for applications errors (located in i18n/messages), and the default ValidationMessagesfor bean ...
0
votes
2
answers
973
views
Spring boot validation CGLIB enhanced controller components not autowired
I have created a spring boot application (user spring-boot-starter-parent V. 2.2.2.RELEASE) with Rest controllers, that work fine, now I have added a dependency to :
<dependency>
&...
0
votes
0
answers
187
views
springMVC 5.1.6 validation not working (BindingResult errors are 0 ?)
I am facing an issue with my "User" Object being Validated before being registered into a database
Used Technologies :
- Spring Web MVC with Hibernate Validator
- Spring Data (JDBC)
- Maven
Here ...
2
votes
0
answers
402
views
HibernateValidator constraintMapping for the fields inside nested object structure
I have below java external class which is coming from third party jar and I want to do the bean validation against this class.
Product.java:
private String id;
private Price price
Price.java
...
1
vote
1
answer
1k
views
HTTP Status 400 – Bad Request is being displayed on adding @Valid annotation to my controller
I'm trying to add a Validation to my form using Hibernate Validator to my project. On submitting the page below is the error message being displayed. But when I remove @Valid annotation from my ...
0
votes
1
answer
4k
views
Request processing failed; nested exception is javax.validation.ConstraintViolationException: Validation failed for classes
I am getting following validation exception. I explored some of the answers earlier on same question but nothing worked for me.
org.springframework.web.util.NestedServletException: Request
...
1
vote
1
answer
2k
views
hibernate-validator throwing different exceptions in version 4 and 5
I am doing a spring boot rest application with a custom exception mapping. The exception mapping is irrelevant, but I wanted to use hibernate validator in version 4 ((because I have to use java ...
0
votes
1
answer
1k
views
RestEasy @ValidateRequest is not working
I am having below configuration for a RestEasy Rest WS
jaxrs-api-2.3.5.Final.jar,
resteasy-jaxrs-2.3.5.Final.jar,
resteasy-hibernatevalidator-provider-2.3.5.Final.jar,
hibernate-validator-4.3.2....
2
votes
1
answer
820
views
Bean Validation API needed, when using Hibernate Validator Engine?
In my Java EE 7 OpenShift project I'm using javaee-api version 7.0. For my model I added the depency validation-api version 1.1.0, but that wasn't enough. Then I tried with
<dependency>
<...
2
votes
1
answer
358
views
javax.validation.ValidationException: %class% has already be configured in xml
There's a bean validation in a project's jar which validation.xml contains field-level validation of Address bean.
The other project uses Address class and needs to have specific Address validation. ...
1
vote
1
answer
658
views
How to get NHibernate.Validator working with NHibernate 4?
I have upgraded my software from NHibernate v2.1.2.4000 (which was compatible with NHibernate.Validator v1.2.3001) to NHibernate v4.0.2.4000.
Now I am trying to use NHibernate.Validator v1.3.2.4000, ...
2
votes
1
answer
616
views
Is there a way to access the target bean from within a Bean Validation field-level ConstraintValidator?
Apart from using class-level validations, is there a way to access the parent bean of a field-level validation annotation from within its validator class?
For example:
public class CustomValidator ...
0
votes
1
answer
253
views
The type or namespace name NHVConfiguration could not be found
I am working on some old project which is working with some old NHibernate.Validator. I got a exception when I build it which says The type or namespace name 'NHVConfiguration' could not be found.
...
0
votes
1
answer
2k
views
Validation in Hibernate Validator
I want to use Hibernate Validator, In first step I checked and studied the following reference :
Hibernate Validator JSR 349 Reference Implementation Reference Guide 5.0.2.Final
first sample in page 3 ...
5
votes
2
answers
625
views
NHibernate Validator and ASP.NET MVC 4
We're looking at upgrading a large-scale project currently implemented using ASP.NET MVC 2 with xVal providing the glue between NHibernate Validator and client-side validation.
When I was looking for ...
0
votes
1
answer
52
views
turn off NHib Validator logging when Debugging
When I have log4net set to DEBUG in a project with an NHibValidator dependency, I lots of feedback from NHibValidator. When the Validator is not the focus of the debug run however, this is just noise.
...
2
votes
2
answers
259
views
nhibernate validator and envers together
I am trying to use both nhibernate validator and nhibernate envers together in the same project.... but i am getting the null expection:
If i iniitliaze the validator later, i get the error:
Mesage: ...
1
vote
1
answer
345
views
Nhibernate Validation Annotation not generating valid schema
I am generating schema using nhibnernate, but its not generating it is not considering the constraints:
public class Person
{
public virtual int Id { get; set; }
[NotNull]
...
0
votes
1
answer
2k
views
Hibernate validator URL and ConstraintViolationException
I'm using Hibernate validator 4.3. I try validate given entity:
@Entity
@Table(name = "standard_group")
public class StandardGroup extends AbstractEntity {
private static final long ...
2
votes
0
answers
2k
views
Hibernate custom constraint validator, how to set propertyPath explicitly?
my custom class is implemented via:
@RequiredIfSet.List({
@RequiredIfSet(field = "isFillingOutForSomeoneElse", dependentField = "reporterName", message = "may not be null"),
})
When I loop ...
2
votes
1
answer
175
views
can't find validatorengine namespace with nhibernate,
I have NHibernate working opening sessions etc. I just want to initialise a new Validator engine (have put validator DLLS in my project from NHibernate validator 1.31GA) and my DLLS for NHibernate are ...
0
votes
1
answer
151
views
Prioritize NHibernate Validator's validation over the built in validation?
From this discussion I gather that NHibernate Validator runs after the built in validation, meaning my Not Null attributes throw PropertyValueException before NHibernate Validator is even run.
Is ...
3
votes
1
answer
671
views
Nhibernate.Util causing ProxyFactoryFactoryNotConfiguredException when configuration line exists in config
We're building a project using NHibernate and Castle with the Validators project. I'm trying to upgrade it to the latest supported version between all of those. I've gotten the application working ...
3
votes
1
answer
881
views
NHibernate.Validator: when saving entity, my custom messages aren't available, how can I get them?
I'm using NHibernate.Validator with the Loquacious ValidationDef configuration style.
For all my rules I use WithMessage to set a custom message when the value is invalid. The messages are codes that ...
0
votes
1
answer
292
views
nhibernate validator (1.3.1) localizing error messages
I created an unit test case for displaying error messages in a different language than English but it doesn't seem to work and I don't know what I am missing.
Here are the details:
I am using ...
2
votes
0
answers
88
views
NHibernate Validator throwing and catching sqillions of MappingExceptions (property not found)
After upgrading from NHibernate 2 to 3.1, NHibernate Validator is throwing and catching tons of MappingExceptions with the message "property not found: myProp on entity MyEntity".
The stack trace is:
...
6
votes
1
answer
693
views
NHibernate Validator throws System.NotSupportedException after upgrading to 3.1
Has anyone encountered this?
After upgrading to NHibernate 3.1, I am receiving the following exception from NHibernate Validator when running NUnit test cases:
System.NotSupportedException : The ...
2
votes
3
answers
2k
views
NHibernate and NHibernate Validation
Is it possible to validate domain model with Nhibernate validation framework in PreTranctionCommint event? If possible how we can write this event ?
1
vote
2
answers
397
views
Validation for Windows Forms Apps with Nhibernate
I've been using Nhibernate (with fluent nhibernate mapping) in a windows forms application and to do some validation and binding, I've been using NHibernate Validator too and when we try to validate ...
0
votes
1
answer
3k
views
Configuring Fluent NHibernate and NHibernate Validator
I am struggling to get Fluent NHibernate and the NHibernate Validator working together and there seems to be a lack of documentation on the internet about the best way to do this. I have found a few ...
5
votes
1
answer
607
views
upgrading NHibernate and NHibernate Validator w/ Nuget
As of the today, the Nuget release of NHibernate Validator is 1.3.1.4000 and says it has a dependency >= NHibernate 3.1.0.4000, which implies it should work with latest NHib 3.2.
But NHib 3.2 now has ...
2
votes
2
answers
579
views
NHiberate Validator start date before end date
Using Nhibernate Validator (with S#harp Architecture / MVC3), how can I write a custom attribute, preferably not object-specific (since this is a fairly common requirement) that enforces that ...
1
vote
1
answer
440
views
NHibernate Validator initialization is very slow with ValidatorMode.OverrideAttributeWithExternal
Is there any way of speeding up the time NHibernate Validator takes to initialize when the default validator mode is set to ValidatorMode.OverrideAttributeWithExternal?
It takes over 11 seconds to ...
3
votes
1
answer
2k
views
NHibernate Validator not integrating with Fluent NHibernate
I'm having some trouble getting NHV to work with Fluent NHibernate. A unit test that I have that has an entity that SHOULD be failing validation ends up throwing an ADO exception. I have NHV ...
0
votes
2
answers
865
views
Nhibernate Validator
In my unit tests I am getting an error when I am debugging. The weird thing is I do not get this whenever I just run the test (it's only when debugging a test). I get an exception whenever I try to ...
0
votes
2
answers
345
views
Nhibernate Validator for Nhibernate 3.1
Is there a version that works with Nhibernate 3.1? Currently I have a version that is looking for 2.1.2.4000. Is there something I can change to be able to use the old Nhibernate Validator with the ...
0
votes
2
answers
1k
views
MVC 3, NHIbernate Validators & Message Interpolator
I have followed this article and have a passing test showing custom validation error messages being returned from a resource file when a call to Validator.IsValid(someEntity) fails.
I am trying to ...
1
vote
1
answer
2k
views
nhibernate validator usage
Say I have a value object class, FullName, that is used as a property in an Employee entity class. The FullName may have a middle initial, nick name, etc; but from a domain perspective I would like to ...
3
votes
1
answer
167
views
NHibernate validator performance
What do you know about NHibernate validator performance? I plan to use it, but it use reflection and I worry about performance...
1
vote
1
answer
397
views
NHibernate DecimalMin Validator
I'm attempting to use the DecimalMin validator from NHibernates Validator library. Unfortunately, due to compiler restrictions I'm getting errors when attempting to utilize it. I'm sure its something ...
2
votes
1
answer
1k
views
NHibernate Validator and Null DateTime
There must be a simple solution out there, I'm trying to use NHibernate Validator attributes on my DateTime properties. If the value is null (via [NotNull]), I want it to fail validation. When I ...
1
vote
3
answers
470
views
NHibernate Validator and Schema Export question
I'm learning to use NHibernate validator and it's Fluent API (Loquacious).
I have noticed is that I can't set an integer property or nullable int property (int?) to be not nullable. Well, why not?
...
1
vote
1
answer
355
views
ValidatorEngine.Validate returns null (no error) if configured its ValidatorMode.UseExternal
i am integrating nhibernate validator into my application and and everything is fine with attributes
but as soon as I create *.nhv.xml files and move my validation rules there (as embedded resource)
...
0
votes
1
answer
2k
views
System.NullReferenceException with WhoCanHelpMe Unit Test
I'm working with a test project based on WhoCanHelpMe, which is based on Sharp Architecture, NHibernateValidator, etc. As its written the when_the_profile_tasks_is_asked_to_create_a_profile unit test ...
2
votes
2
answers
1k
views
How to get interpolated message in NHibernate.Validator
I'm trying to integrate NHibernate.Validator with ASP.NET MVC client side validations, and the only problem I found is that I simply can't convert the non-interpolated message to a human-readable one. ...
5
votes
3
answers
421
views
fluentnhibernate and nhibernate validator version error
We have a project using FluentNibernate to map the entities. Now I need to add some format validation to these maps. For Nullable, Length and such we are currently using the mappings. I added ...
2
votes
2
answers
572
views
NHibernate Validator Dynamic rules
I'm using Nhibernate and I have a requirement that the validation rules must change in time. The framework I'll use is NHibernate validator, but I don't really know how to make dynamic rules, the ...
1
vote
1
answer
485
views
xVal Date Validation with Nhibernate Validator
I am using xVal with NHibernate Validator and I have a hard time to validate the dates.
First, NHibernate does not have validation for Date/DateTime formatting (except Past and Future). Second, I ...
2
votes
1
answer
483
views
How to use Nhibernate Validator + NHib component + ddl
I just configured my NHibValidator. My NHibernate creates the DB
schema. When I set MaxLenght="20" to some property of a class then in
the database the length appears in the database column. I am ...