You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by yesitspeter <ok...@bah.com> on 2007/11/27 16:02:57 UTC

Specifying a JAXB search path

My team has had difficulty with CXF being able to discover the entire set of
classes needed for serialization/deserialization using JAXB.  We specify
this rather easily with XFire and have great success with that solution.  We
wish to migrate to CXF however we see no clearly documented method of adding
the context. 

I was hoping one of you could point us in the right direction.   I apologize
in advance if this question has already been asked.  
-- 
View this message in context: http://www.nabble.com/Specifying-a-JAXB-search-path-tf4882221.html#a13972262
Sent from the cxf-user mailing list archive at Nabble.com.


Re: Specifying a JAXB search path

Posted by Jim Ma <em...@iona.com>.
Hi ,

CXF only adds the classes that is needed to JaxbContext  by reflecting 
and analyzing method paramter types.
It can not use a search path to discover and load these classes .

If you want to load extra class into JaxbContext , you can write a  
jaxb.index file to specify them.
For example, if com.foo.bar.A.class is the method parameter type, create 
a file named jaxb.index and place under the same package. 
Write the extra class name to  this  file as the following :
--------------jaxb.index-------------
B
C

Cxf will read this file and add com.foo.bar.A and com.foo.bar.C into 
JaxbContext.

Does it help?

Cheers

Jim Ma

yesitspeter wrote:
> My team has had difficulty with CXF being able to discover the entire set of
> classes needed for serialization/deserialization using JAXB.  We specify
> this rather easily with XFire and have great success with that solution.  We
> wish to migrate to CXF however we see no clearly documented method of adding
> the context. 
>
> I was hoping one of you could point us in the right direction.   I apologize
> in advance if this question has already been asked.  
>