onConstraintViolation not triggered
Hello,
I'm using GWT 2.4 with GWT-Platform and RequestFactory. I have one EJB Module and two war's, the one
that uses GWT-P with client-side logic and another war only for RequestFactory with a DefaultRequestTransport class for delegating. All deployed on Jboss 6.
At some point in the past, all worked as expected, i tried client side constraint validation (http://code.google.com/p/gwt-validation/) and also annotated the Entitties at the
EJB Project and the onConstraintViolation Method was trigged.
But now, only the onFailure Method get triggered when a validation exception occurs on server side. I didn't change the validation groups in persistance.xml.
One thing that is different, is that i'm using an extra session bean with security domain and this bean calls methods of another session bean (but also tried to call the
method of the session bean without security domain directly, like before, but didn't change anything).
I only need libraries on client side project if i want to use gwt client side validation right?
Maybe, one reason could be, that the ConstraintViolationException is wrapped in a persistanceException.
I have 2 session beans, lets call them beanA and beanB.
beanA invokes a method of beanB (just a merge operation). If i'm not doing a em.flush() at the end of the method of beanB im getting this exception:
WARN [com.arjuna.ats.arjuna] ARJUNA-12125 TwoPhaseCoordinator.beforeCompletion - failed for SynchronizationImple< 0:ffffc0a80067:126a:514777a4:239, org.hibernate.transaction.synchronization.HibernateSynchronizationImpl@6c09201 >: javax.persistence.PersistenceException: error during managed flush
..............
Caused by: javax.validation.ConstraintViolationException: Validation failed for classes [<MyEntity>] during update time for groups [javax.validation.groups.Default, ]
List of constraint violations:[
............
]
If i'm doing a flush, i'm just getting:
22:10:03,784 ERROR [org.jboss.ejb3.tx2.impl.CMTTxInterceptor] javax.ejb.EJBTransactionRolledbackException: Validation failed for classes [<MyEntity>] during update time for groups [javax.validation.groups.Default, ]
List of constraint violations:[
............
]
I thought this could solve the problem, but always returning onFailure Method.
On client side:
<context>.update(<EntityProxy>).fire(new Receiver<EntityProxy>() {
@Override
public void onSuccess(EntityProxyresponse) {
....
}
@Override
public void onFailure(ServerFailure error) {
....
}
@Override
public void onConstraintViolation(Set<ConstraintViolation<?>> violations) {
....
}
});
What i'm doing wrong? Is there something i have to do on client-side code expect of overiding the onConstraintVilation Method?
Thanks for any replies.
--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home