If your classes are simply annotated with JAXB annotations, you should 
follow http://code.google.com/p/google-web-toolkit/issues/detail?id=4020 
(comment 10) for the workaround, and keep them in the 'shared' package, so 
they can communicate and used with both sides (and you don't violate DRY).
But If you have adapters (i.e., classes that extend XmlAdapter<V, B>) that 
are in the client/shared side, you should move them in the server, 'cause 
they cannot be compiled and are useful only when taking 
marshalling/unmarshalling in account.
I don't think your solution work. You are only excluding files from 
compilation, but what if they are useful? Move adapters to the server. Keep 
annotated classes in the 'shared' and follow the above link.

On Thursday, June 21, 2012 1:38:40 PM UTC+2, shawnjohnson wrote:
>
> 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#c8fortheworkaround.
>  
> > 
> > > 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 view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/R7LbxAI9W_sJ.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to