cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <>
Subject Re: CXF - WSDL : Newbie question
Date Wed, 24 Jun 2009 21:29:56 GMT

Both are related to JAXB spec.   For 2, JAXB ONLY ever creates object with 
default constructors.  Thus the objects need to have them.  You can mark the 
methods with the @XmlTransient annotation and JAXB will ignore them.

For (1), the default in JAXB is to expose things that are "properties".   
Normally, that means either the field is public or there are public 
getter/setters.   However, you can add an annotation of:
to  the class to force field usage if you want.


On Wed June 24 2009 5:18:03 pm xpsytor wrote:
> @XmlSeeAlso was just what doctor ordered. Thanks to both you and Daniel,
> Problem 1 solved!
> About Problem 2 (empty classes), well... I don't know if I was doing it
> wrong BUT I had to change my original classes in order to solve this. What
> I did -
> 1. Made equal number or setters against their getters (or vice-versa).
> Since in my existing application, some classes only have getters as the
> values were being set in constructors themselves. Is this A MUST thing to
> do for all your exposed client-side classes?
> If anyone knows of a good doc or reference which clearly lays out these
> design principles, thatd be awesome!
> 2. Removed any getters/setters which were setting/returning Objects which
> DO NOT have a default constructor. For example I have methods public
> Exception getError() & public void setError(Exception e). These method
> cannot be exposed according to cxf, I STILL dont know why though. Gives me
> following error -
> Caused by: com.sun.xml.bind.v2.runtime.IllegalAnnotationsException: 1
> counts of IllegalAnnotationExceptions java.lang.StackTraceElement does not
> have a no-arg default constructor. this problem is related to the following
> location:
>         at java.lang.StackTraceElement
>         at public java.lang.StackTraceElement[]
> java.lang.Throwable.getStackTrace() at java.lang.Throwable
>         at java.lang.Exception
>         at public java.lang.Exception com.abcd.common.Result.getError()
>         at com.abcd.common.Result
>         at private com.abcd.common.Result
> com.abcd.handler.jaxws_asm.LoginResponse._return at
> com.abcd.handler.jaxws_asm.LoginResponse
> --- On Wed, 6/24/09, Andrew Clegg <> wrote:
> From: Andrew Clegg <>
> Subject: Re: CXF - WSDL : Newbie question
> To:
> Date: Wednesday, June 24, 2009, 10:38 AM
> 2009/6/24 xpsytor <>:
> > Will take a look at the link you've mentioned here.
> >
> > About the method definitions for returned class, I'm sorry - I should
> > have probably said definition for my getter and setter methods. Yes, they
> > - including the constructor isn't generating. The class is literally
> > empty. The ObjectFactory class does have a newInstance() for returned
> > class but its pretty much useless as the returned class is abstract.
> Okay, cool, I thought for a minute you might have been under a
> misconception about what was possible over SOAP.
> As Dan said, the XmlSeeAlso tricks (as described in that article)
> might fix this, if it can pick up the correct class 'content' from the
> concrete classes referred to.
> If it doesn't help, post some code...
> Andrew.

Daniel Kulp

View raw message