I wanted to use the JaxB annotation in my class like this:
@XmlRootElement
public class ItemExtension implements Serializable {
But GWT com
I was able to solve my GWT compiler issues by excluding the generated JAXB ObjectFactory from the source in the GWT module XML:
<source path="model">
<exclude name="**/ObjectFactory.*" />
</source>
I have used this library to do jaxb parsing from within a GWT client
http://code.google.com/p/gwtjaxb/
It is not a full JAXB generator, but it covers everything that I need.
You might find a viable solution here: GWT with JPA
I have a project that uses entity classes with both JPA and JAXB annotations in the client-side GWT code. See the section "Overriding one package implementation with another" in the GWT Documentation.
Let's say your module is in package com.example.app
. You will need to recreate[1] all JAXB annotation classes in a new package, specifically com.example.app.jre.java.xml.bind.annotation
; in your module XML file, you then add <super-source path="jre" />
and you're set.
Note that you don't need to distribute the class files in that package, they are needed solely for the sake of the GWT compiler.
[1]: You can copy them over and adjust all package references.
Have you checked these discussions already:
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/849c6cc6c9b1467a/cab6b973bbf7d162?hl=en&lnk=gst&q=jaxb+annotations#cab6b973bbf7d162
and
http://groups.google.com/group/google-web-toolkit/browse_thread/thread/6312cedd281b91a9/b1add5932c842ace?hl=en&lnk=gst&q=jaxb+annotations#b1add5932c842ace