Open GoogleCodeExporter opened 9 years ago
Hi, Nico
Thanks for your nice details.
The UIBinding and Reflection working, it's mean your Pojo have reflectable, but for Control JavaScript size, GWTENT provided different reflection level. for example "@Reflectable" is a normal level, "@Reflect_Domain" and "@Reflect_Full" will create full reflection information for that class, to using validation, you need full reflection for your class.
I will change the Error message to make it more obviously for validation, Thanks you very much. Please let me know how is it going :)
James
Original comment by JamesLuo...@gmail.com
on 13 Jul 2010 at 11:34
Hmm Sorry but that didn't fix my Problem.
I added @Reflect_Full to my Pojo, but nothing changed about the Exception.
The weird thing to me is that it wasn't the Pojo in the first place, that is
mentioned in the ReflectionNeededException, but that it's the
javax.validation.constraints.SizeValidator Class.
Or is the strategy behind that to make SizeValidator reflectable through the
@Reflect_Full Annotation on any Pojo that is Implementing the @Size?
I got one step further by manually adding the SizeValidator class to the
typeMap of TypeOracleImpl via instantiating a ClassTypeImpl like this:
new ClassTypeImpl(SizeValidator.class);
The SizeValidator can then be retrieved from the TypeOracleImpl when
validating, but I end up with a NullPointer later, when the constructor is to
be found, cause of course there is no MetaData for Reflection still :o(
So I still guess that it has to do something with the class loading of the
Validation stuff. May it be a problem that I have javax validation API lib in
my classpath too, where all those Validation Annotations are included also?
I didn't think so, cause that's only server-side and GWT-ent is client-side,
but of course I don't have the complete view of what GWT ent is doing while
preparing Reflection Information and stuff...
Thanks for your help!
Original comment by nico.rog...@gmail.com
on 14 Jul 2010 at 7:18
Hi, Is it possible that I can have a look your Pojo class? There is a @Size in
showcase as well but not problems.
If Pojo is fine, then maybe javax validation API is the problem as well.
James
Original comment by JamesLuo...@gmail.com
on 14 Jul 2010 at 9:13
Hi James,
the Pojo Code is the following:
package de.hdi.bin.fub.client.model;
import java.io.Serializable;
import javax.validation.constraints.Size;
import com.gwtent.reflection.client.annotations.Reflect_Full;
import com.gwtent.validate.client.constraints.Required;
/**
* GWT Model Klasse zur Representation der Kurzform eines VUs.
*
* @author Rogasch
*/
@Reflect_Full
public class VuKurz implements Serializable {
private static final long serialVersionUID = 1L;
Long vuNummer;
@Required
@Size(min = 5)
String vuName;
String vuOrt;
public Long getVuNummer() {
return this.vuNummer;
}
public void setVuNummer(final Long vuNummer) {
this.vuNummer = vuNummer;
}
public String getVuName() {
return this.vuName;
}
public void setVuName(final String vuName) {
this.vuName = vuName;
}
public String getVuOrt() {
return this.vuOrt;
}
public void setVuOrt(final String vuOrt) {
this.vuOrt = vuOrt;
}
}
Original comment by nico.rog...@gmail.com
on 14 Jul 2010 at 9:22
Thanks, the pojo is correct. I will put a separated javax validation jar to my
gwt compile classpath and try again. will let you know tomorrow.
Can you try to remove the validation jar from your gwt compile classpath? I
think that will help :)
Original comment by JamesLuo...@gmail.com
on 14 Jul 2010 at 9:57
Hi James,
I see no chance to remove the validation jar from the project, since it's part
of a bigger scope and even though it's not directly used in my project, it's a
dependency of some framework component we use.
Shouldn't there be a way to tell GWT only to use the GWT-Ent classes?
We did something like that with the Apache Commons library.
We override the log4J standard classes so they could also be used on
client-side(triggering a remote-service that logs the stuff on the server) and
tell GWT to replace the standard log4j classes with our custom made classes
when generating the client-side code.
We used the "<super-source path="">" entry in our gwt.xml for that. Are you
familiar with that configuration?
P.S.: Sorry but my next answer may take a while, since I'm going onto well
earned vacation for a week, but I may tell a collegue to continue with this
topic :o)
Original comment by nico.rog...@gmail.com
on 15 Jul 2010 at 1:18
Hi, Nico
Thank you very much. I will working on this, actually the JSR303 implement here is a subset of JSR303, no all API can be supported in GWT client code. I will review my codes and will let you know how it's going.
James
Original comment by JamesLuo...@gmail.com
on 20 Jul 2010 at 12:10
Original issue reported on code.google.com by
nico.rog...@gmail.com
on 13 Jul 2010 at 3:08