GWT validation error during gwt compilation - Missing source code

I am trying to get gwt validation check using hibernate validator. I followed the steps of http://code.google.com/p/google-web-toolkit/wiki/BeanValidation and set up my project according to the sample validation project at http://code.google.com/p/google-web -toolkit / source / browse / trunk / samples / validation /

The file My.gwt.xml contains:

<inherits name="org.hibernate.validator.HibernateValidator" /> 

and my custom factory check:

 <replace-with class="my.package.here.client.validation.ValidatorFactory"> <when-type-is class="javax.validation.ValidatorFactory" /> </replace-with> 

Validation works both on the client side and on the server side in dev mode, but when I try to perform gwt compilation, I get:

 gwtc-production: [java] Compiling module my.package.MyModule [java] Validating newly compiled units [java] [ERROR] Errors in 'jar:file:/hibernate-validator-4.2.0.Final-sources.jar!/org/hibernate/validator/constraints/impl/FutureValidatorForReadableInstant.java' [java] [ERROR] Line 32: No source code is available for type org.joda.time.ReadableInstant; did you forget to inherit a required module? [java] [ERROR] Errors in 'jar:file:/hibernate-validator-4.2.0.Final-sources.jar!/org/hibernate/validator/constraints/impl/FutureValidatorForReadablePartial.java' [java] [ERROR] Line 32: No source code is available for type org.joda.time.ReadablePartial; did you forget to inherit a required module? [java] [ERROR] Errors in 'jar:file:/hibernate-validator-4.2.0.Final-sources.jar!/org/hibernate/validator/constraints/impl/PastValidatorForReadableInstant.java' [java] [ERROR] Errors in 'jar:file:/hibernate-validator-4.2.0.Final-sources.jar!/org/hibernate/validator/constraints/impl/SafeHtmlValidator.java' [java] [ERROR] Line 22: The import org.jsoup cannot be resolved [java] [ERROR] Line 23: The import org.jsoup cannot be resolved [java] [ERROR] Line 35: Whitelist cannot be resolved to a type [java] [ERROR] Line 40: Whitelist cannot be resolved to a type [java] [ERROR] Line 40: Whitelist cannot be resolved [java] [ERROR] Line 43: Whitelist cannot be resolved to a type [java] [ERROR] Line 43: Whitelist cannot be resolved [java] [ERROR] Line 46: Whitelist cannot be resolved to a type [java] [ERROR] Line 46: Whitelist cannot be resolved [java] [ERROR] Line 49: Whitelist cannot be resolved to a type [java] [ERROR] Line 49: Whitelist cannot be resolved [java] [ERROR] Line 52: Whitelist cannot be resolved to a type [java] [ERROR] Line 52: Whitelist cannot be resolved [java] [ERROR] Line 55: Whitelist cannot be resolved to a type [java] [ERROR] Line 62: Jsoup cannot be resolved [java] [ERROR] Line 62: Whitelist cannot be resolved to a type [java] [ERROR] Errors in 'jar:file:gwt-user.jar!/org/hibernate/validator/super/org/hibernate/validator/engine/PathImpl.java' [java] [ERROR] Line 72: The constructor NodeImpl(String) is undefined [java] [ERROR] Line 84: The constructor NodeImpl(Path.Node) is undefined [java] [ERROR] Line 95: The constructor NodeImpl(Path.Node) is undefined [java] [ERROR] Line 202: The constructor NodeImpl(String) is undefined [java] [ERROR] Line 204: The method setInIterable(boolean) is undefined for the type NodeImpl [java] [ERROR] Line 209: The method setIndex(Integer) is undefined for the type NodeImpl [java] [ERROR] Line 212: The method setKey(String) is undefined for the type NodeImpl [java] [ERROR] Aborting compile due to errors in some input files 

There is obviously some jar source that I am missing. I have (among others) my class path:

 hibernate-validator-4.2.0.Final.jar hibernate-validator-4.2.0.Final-sources.jar 

I also tried adding joda-time-2.1.jar , joda-time-2.1-sources.jar , jsoup-1.6.3.jar and jsoup-1.6.3-sources.jar .

Shouldn't inherit org.hibernate.validator.HibernateValidator take care of super sources, so I don't need to provide sources? Can anyone see what I'm missing?

+4
source share
3 answers

GWT is built against Hibernate Validator 4.1.0-Final and relies on some of its internal components ( PathImpl , NodeImpl ) and, apparently, they have changed in Hibernate Validator 4.2.0.

Use 4.1.0-Final (or possibly 4.0.2.GA, as in the example) instead of 4.2.0.


The problem can be tracked in the GWT Tracker , we must at least document the incompatibility explicitly.

+7
source

I did not know the GWT implementation for checking Hibernate. But why is GWT trying to understand the code from your Hibernate source itself? If this is GWT native code, it should come from gwt-user.jar or something like that.

If you agree with me, then do not include any real Hibernate drum in the path of the GWT compilation class. In any case, this is not needed / does not know.

0
source

4.1.0 also worked for me, after a while I found out that there are several problems with higher versions. Therefore, use the same versions that were recommended in the tutorial from gwt ( http://www.gwtproject.org/doc/latest/DevGuideValidation.html ), I also had a WARNING compiler:

 detected warnings related to 'javax.validation.constraint'. is validation- version .jar on the classpath 

Which I fixed:

 <dependency> <groupId>javax.validation</groupId> <artifactId>validation-api</artifactId> <scope>compile</scope> </dependency> 
0
source

Source: https://habr.com/ru/post/1433762/


All Articles