Compiling domain objects with Objectify annotations fails during code generation

189 views
Skip to first unread message

Koen Maes

unread,
Dec 18, 2011, 4:15:48 PM12/18/11
to gwt-val...@googlegroups.com
Hi

I am compiling my code because I want to see if it works with GAE.

I managed to keep the same server and client side domain objects and in development I use hibernate-validator for server side and gwtvf for client side validation. I specified this flag 
"-Dgwt.validation.excluded.ValidatorClassesRegexp=^org.hibernate.*" to make that happen in development mode.
My domain objects have Objectify persistence annotations but that doesnt bother in DevMode.

When I compile the client code, I have to specifically make sure hibernate-validations is not on the classpath, so I got that far. But now I am facing compilation problems during code generation from the GWTVF at compile time.
GWTVF does not like the Objectify annotations at compile time :


 [java]    Scanning for additional dependencies: file:/home/koen/workspace/klawt/src/com/klawt/screen/ui/center/CustomerActivity.java
     [java]       Computing all possible rebind results for 'com.klawt.shared.resources.CustomerResourceProxy'
     [java]          Rebinding com.klawt.shared.resources.CustomerResourceProxy
     [java]             Checking rule <generate-with class='com.em.validation.rebind.generator.gwt.GwtMessageGenerator'/>
     [java]                [ERROR] Errors in 'file:/home/koen/workspace/klawt/src/com/klawt/shared/domain/Customer.java'
     [java]                   [ERROR] Line 6: The import javax.persistence cannot be resolved
     [java]                   [ERROR] Line 12: The import com.googlecode cannot be resolved
     [java]                   [ERROR] Line 13: The import com.googlecode cannot be resolved
     [java]                   [ERROR] Line 16: Cached cannot be resolved to a type
     [java]                   [ERROR] Line 17: Entity cannot be resolved to a type
     [java]                   [ERROR] Line 20: Id cannot be resolved to a type
     [java]                [ERROR] Unable to find type 'com.klawt.shared.resources.CustomerResourceProxy'
     [java]                   [ERROR] Hint: Previous compiler errors may have made this type unavailable
     [java]                   [ERROR] Hint: Your source appears not to live underneath a subpackage called 'client'; no problem, but you'll need

Koen Maes

unread,
Dec 18, 2011, 4:27:21 PM12/18/11
to gwt-val...@googlegroups.com
Fixed by including the objectify jar in the client classpath.


Next compile problem is this  :

     [java]    [ERROR] Errors in 'jar:file:/home/koen/workspace/klawt/lib/gwt-validation-2.0-BETA-SNAPSHOT-r276.jar!/com/em/validation/emul/com/em/validation/client/ConstraintValidatorFactoryImpl.java'
     [java]       [ERROR] Line 36:  Failed to resolve 'javax.validation.ConstraintValidatorFactory' via deferred binding

The only implementation i can find in my project (which works in DevMode), is in the hibernate-validator, which I must exclude for compilation.

chris.r

unread,
Dec 19, 2011, 11:26:25 AM12/19/11
to gwt-validation
Are the javax.validation source libraries (not just the binary jar) on
your classpath?
Reply all
Reply to author
Forward
0 new messages