GWT and annotations from JAXB

1,034 views
Skip to first unread message

Arinté

unread,
Apr 26, 2010, 11:06:13 AM4/26/10
to Google Web Toolkit
I have seen a few posts on this and apparently there was a defect that
was filed and fixed in 1.5. I am using GWT 2.0, but I still seem to
have this issue.

I have several class that are annotated with:
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;

But when I run GWT, I get these type of errors:
Line 5: The import javax.xml.bind cannot be resolved

I included the jar (I am pretty sure it is the right one) that has
these annotations in the lib directory of my GWT project, so what else
do I need to do?

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To post to this group, send email to google-we...@googlegroups.com.
To unsubscribe from this group, send email to google-web-tool...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

Prieto-Ilarion Bianco

unread,
Apr 27, 2010, 10:49:28 AM4/27/10
to Arinté, Google Web Toolkit
Hi.

You have to include source code for mentioned classes into classpath (you can use <super-source path="jre"/> tag in your Module.gwt.xml to override java classes).
I've successfully integrated GWT and JAXB using this approach.

Thanks, Bina Prieto.

davek

unread,
May 4, 2010, 6:49:44 PM5/4/10
to Google Web Toolkit
I cheated (too lazy to get the sources). I made a container class
with the jaxb annotations and put that under the server namespace.
The container has private fields that are shared-namespace classes
without the jaxb annotations. If found that I didn't have to annotate
the fields in the shared classes, presumably because the types are all
serializable (they're in the shared namespace for use with rpc and
implement Serializable).

ciosbel

unread,
May 11, 2010, 7:12:55 AM5/11/10
to Google Web Toolkit
I've the same problem. I've followed your instructions and almost
everything has been fixed.
Except for these errors:
[ERROR] Line 36: No source code is available for type
javax.xml.namespace.QName; did you forget to inherit a required
module?
[ERROR] Line 198: No source code is available for type
javax.xml.bind.JAXBElement<T>; did you forget to inherit a required
module?

I've also tried to include sources of stax, with no luck.
What i'm missing?

On Apr 27, 4:49 pm, Prieto-Ilarion Bianco <prieto-
ilar...@devexperts.com> wrote:
> :Hi.
> You have to include source code for mentioned classes into classpath (you can use <super-source path="jre"/> tag in your Module.gwt.xml to override java classes).
> I've successfully integrated GWT andJAXBusing this approach.
Reply all
Reply to author
Forward
0 new messages