Thursday, June 21, 2012

Re: XmlAdapter compile error

Sorry, I didn't mean to post that reply quite that way (hit some new
keyboard combo)...

My.gwt.xml
(before)
<module>
<source path="common"/>
</module>

(after)
<module>
<source path="common">
<exclude name="MyXmlAdapter1.java" />
<exclude name="MyXmlAdapter2.java" />
<exclude name="MyXmlAdapter2.java" />
</source>
</module>


On Jun 21, 7:35 am, shawnjohnson <shawnjohnson...@gmail.com> wrote:
> Thank for the reply.  I'm only marshalling/unmarshalling on the server-side
> - so does that mean I should move those classes into a "server" package?
>  That's even if the annotation is in the shared bean?  Yes, still using
> GWT-RPC. Is the workaround as simple as this?
>
> My.gwt.xml (before)
> <module>
>         <source path="common"/></module> <module> <source path="common">
> <exclude name="MyXmlAdapter1.java" />
> <exclude name="MyXmlAdapter1.java" />
> </source>
>
>
>
>
>
>
>
> On Wednesday, June 20, 2012 6:16:03 PM UTC-4, Andrea Boscolo wrote:
>
> > Such annotations are not GWT compatible (i.e., they are not known to the
> > GWT emulated JRE and definitely cannot be compiled in js, even providing
> > the relative sources - that I think they can be found in jaxb-api-src.jar
> > inside the jaxb distribution).
> > To allow jaxb annotations (and annotations only) to be used in
> > client/shared side, you have to tell the gwt compiler to compile those
> > classes ignoring such annotations while still allow the server side to use
> > them.
> > Seehttp://code.google.com/p/google-web-toolkit/issues/detail?id=4020#c8forthe workaround.
>
> > If you are using an XmlAdapter (the class) in client code, move it to
> > server side (i.e., keep your marshalling/unmmarshalling logic in the
> > server).
>
> > I assumed you are using GWT-RPC of course. With RequestFactory you should
> > have no problem at all.
>
> > On Wednesday, June 20, 2012 11:33:54 PM UTC+2, shawnjohnson wrote:
>
> >> I am having this issue as well.  The annotations are in models in our
> >> 'shared' package - shared between client and server.  Anyone know what I
> >> should change to resolve this?
>
> >> On Thursday, December 30, 2010 1:38:27 PM UTC-5, Andrea Boscolo wrote:
>
> >>> I suppose you are trying to use that annotation on a client side
> >>> class; javax is not emulated by gwt compiler, so you couldn't use it
> >>> client side.
>
> >>> Why not moving the adapter to the server side? Does your client really
> >>> need it?
> >>> Annotated jaxb classes can be used by the client (with a couple of
> >>> tweaks and not for all annotations), but marshalling/unmarshalling to/
> >>> from xml, still need to be handled server side. In this point of view,
> >>> the adapter can be known only to your server.
>
> >>> I can tell you the tweak, but first try to move it server side.

--
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-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to google-web-toolkit+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.

No comments:

Post a Comment