-
1. Re: Disabling Bean Validation Hibernate 4.2.7
smarlow Jan 14, 2014 9:15 AM (in response to antlia)Hi Antlia,
Can you enable TRACE logging for org.jboss.as.jpa, start the app server and attach the standalone/log/server.log output for the range from deployment start to end (or from the app server console).
Documentation for enabling TRACE logging is here.
Scott
-
2. Re: Re: Disabling Bean Validation Hibernate 4.2.7
antlia Jan 14, 2014 9:47 AM (in response to smarlow)Hi Scott, i followed your suggestions, this is the server's log.
Thank you for your support!
Antlia
-
server.log.zip 13.4 KB
-
-
3. Re: Re: Disabling Bean Validation Hibernate 4.2.7
smarlow Jan 14, 2014 10:02 AM (in response to antlia)What is the Reapp-0.1-dev.ear/lib/validation-api-1.0.0.GA-sources.jar jar? Have you tried removing that?
The trace output shows that "javax.persistence.validation.factory" is not being passed into Hibernate which is good. Which leaves me with wondering if its this validation-api jar. I'm not sure why it wasn't a problem before and is now for you.
-
4. Re: Disabling Bean Validation Hibernate 4.2.7
antlia Jan 14, 2014 11:07 AM (in response to smarlow)I've just repackaged my ear without the validation-api jar, but the problem is still there...the validation is still active...
-
5. Re: Re: Disabling Bean Validation Hibernate 4.2.7
smarlow Jan 14, 2014 11:21 AM (in response to antlia)Do you have a validation exception with call stack that you could post? That might give us some clue as to how the Hibernate Validator is being included with the deployment.
Do you have a MANIFEST.MF file in your deployment? If yes, could you show us the contents.
Do you have a jboss-deployment-structure.xml file in your deployment, if yes, could you show us the contents.
-
6. Re: Re: Re: Disabling Bean Validation Hibernate 4.2.7
antlia Jan 16, 2014 5:45 AM (in response to smarlow)Hi Scott,
I've attached all the content you requested me to this message.
- stackTrace.log is the exception that Hibernate is throwing me
Since in my application there are more MANIFEST.MF files, I've added all of them, numerated.
Many Thanks,
Antlia
-
stackTrace.log.zip 2.9 KB
-
jboss-deployment-structure.xml 622 bytes
-
01-MANIFEST.MF 39 bytes
-
02-MANIFEST.MF 51 bytes
-
03-MANIFEST.MF 50 bytes
-
04-MANIFEST.MF 68 bytes
-
-
7. Re: Re: Re: Re: Disabling Bean Validation Hibernate 4.2.7
smarlow Jan 16, 2014 9:35 AM (in response to antlia)1 of 1 people found this helpfulThe attached exception is not coming from Hibernate Validator, its directly from Hibernate ORM. Hibernate is complaining about apartmentNumber.
Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: it.antlia.common.model.Address.apartmentNumber
16:15:44,322 ERROR [stderr] (ajp-/192.168.2.95:8259-2) at org.hibernate.engine.internal.Nullability.checkNullability(Nullability.java:103)
16:15:44,322 ERROR [stderr] (ajp-/192.168.2.95:8259-2) at org.hibernate.action.internal.AbstractEntityInsertAction.nullifyTransientReferencesIfNotAlready(AbstractEntityInsertAction.java:132)
The error sounds wrong to me, as I would expect apartmentNumber to be nullable. Does this help?
-
8. Re: Re: Re: Re: Disabling Bean Validation Hibernate 4.2.7
antlia Jan 16, 2014 11:16 AM (in response to smarlow)Hi Scott,
yes the apartmentNumber field is marked as @NotNull, but I'm wondering why, if this exception is thrown by Hibernate ORM layer, in version 4.0.2 disabling the validation with the above-mentioned tag, it is not thrown anymore and everything works fine.
Maybe it's a bug on Hibernate 4.0.2 core?
Second question, is there an escape to this exception which does not require the removal of the @NotNull annotation?
-
9. Re: Re: Re: Re: Re: Disabling Bean Validation Hibernate 4.2.7
smarlow Jan 16, 2014 1:48 PM (in response to antlia)Second question, is there an escape to this exception which does not require the removal of the @NotNull annotation?
Yes, try setting persistence unit property "hibernate.check_nullability" to false (<property name="hibernate.check_nullability" value="false" />).
Maybe it's a bug on Hibernate 4.0.2 core?
I'm not sure exactly. It looks "hibernate.check_nullability" defaults to true unless the Hibernate Validator is accessible and enabled (set to AUTO or CALLBACK). Try the "hibernate.check_nullability" setting and see if that helps.
-
10. Re: Disabling Bean Validation Hibernate 4.2.7
antlia Jan 17, 2014 12:20 PM (in response to smarlow)Hi Scott,
setting the property you told me:
<property name="hibernate.check_nullability" value="false" />
solved the problem, no exception is thrown.
Many Thanks for your support!
Best Regards,
Antlia