You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Margaret Leber <ma...@gmail.com> on 2011/09/25 01:26:26 UTC

Generated WADL missing elements from @Description annotation?

Our CXF JAX-RS Spring app generates perfectly lovely WADL
documents...except no matter how I try apply @Description annotations
to the REST interfaces, I find no <doc> elements on the generated
WADL.

In the FAQ I read "When using Spring AOP to enable things like
transactions and security, the generated WSDL is very messed up with
wrong namespaces, part names, etc...When using Spring AOP, spring
injects a proxy to the bean into CXF instead of the actual bean. The
Proxy does not have the annotations on it (like the @WebService
annotation) so we cannot query the information directly from the
object like we can in the non-AOP case. The "fix" is to also specify
the actual serviceClass of the object in the spring config..."

Is it possible that something like this is what's happening to the
@Description annotations in the WADL case?

(I hope not because to date we have about two dozen service beans
under one JAX-RS server; gonna be hard to merge them into one service
class.)

Any thoughts about what I might be doing wrong would be welcome.

Cheers
MaggieL

Re: Generated WADL missing elements from @Description annotation?

Posted by Margaret Leber <ma...@gmail.com>.
On Sep 26, 2011 8:59 AM, "Sergey Beryozkin" <sb...@gmail.com> wrote:

> Please check that the code used in the office has all the annotations
grouped on the same class/interface...

It's the same application code in both circumstances. I'm pretty sure at
this point there's something boogered in the libraries at the office.

I'll let you know what I discover.

@MaggieL

Re: Generated WADL missing elements from @Description annotation?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

Please check that the code used in the office has all the annotations 
grouped on the same class/interface, for example, if you have 
HttpService interface and HttpServiceImpl, then Description annotations 
should also be on HttpService where @Path/etc are, otherwise they'd be 
not 'visible'

Cheers, Sergey



On 26/09/11 13:14, Maggie Leber (sl: Maggie Darwin) wrote:
> On Sun, Sep 25, 2011 at 11:38 AM, Sergey Beryozkin<sb...@gmail.com>  wrote:
>
>> What CXF version are you working with ? It has to be 2.4.0 at least.
>
> I upgraded to 2.4.2...
>
>> If WADL is properly generated, then annotations such as @Path are visible.
>> But if no @Description is visible at the same time, then may be it's a case
>> of an OSGI Import-Package directive missing a
>> "org.apache.cxf.jaxrs.model.wadl" value ?
>
> ...by editing our Maven POM; we're not using OSGI.
>
> Last night I tried to reproduce the issue on my home development
> environment and it seems to be working correctly.
>
> There must be something bogus (downlevel libs, perhaps) on the dev
> environment on my office machine. I'm new to Maven and likely did
> something wrong getting to 2.4.2. Thanks for your help!
>
>   MaggieL


Re: Generated WADL missing elements from @Description annotation?

Posted by "Maggie Leber (sl: Maggie Darwin) " <ma...@matrisync.com>.
On Sun, Sep 25, 2011 at 11:38 AM, Sergey Beryozkin <sb...@gmail.com> wrote:

> What CXF version are you working with ? It has to be 2.4.0 at least.

I upgraded to 2.4.2...

> If WADL is properly generated, then annotations such as @Path are visible.
> But if no @Description is visible at the same time, then may be it's a case
> of an OSGI Import-Package directive missing a
> "org.apache.cxf.jaxrs.model.wadl" value ?

...by editing our Maven POM; we're not using OSGI.

Last night I tried to reproduce the issue on my home development
environment and it seems to be working correctly.

There must be something bogus (downlevel libs, perhaps) on the dev
environment on my office machine. I'm new to Maven and likely did
something wrong getting to 2.4.2. Thanks for your help!

 MaggieL

Re: Generated WADL missing elements from @Description annotation?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi


Please see comments inline

On 25/09/11 00:26, Margaret Leber wrote:
> Our CXF JAX-RS Spring app generates perfectly lovely WADL
> documents...except no matter how I try apply @Description annotations
> to the REST interfaces, I find no<doc>  elements on the generated
> WADL.
>
> In the FAQ I read "When using Spring AOP to enable things like
> transactions and security, the generated WSDL is very messed up with
> wrong namespaces, part names, etc...When using Spring AOP, spring
> injects a proxy to the bean into CXF instead of the actual bean. The
> Proxy does not have the annotations on it (like the @WebService
> annotation) so we cannot query the information directly from the
> object like we can in the non-AOP case. The "fix" is to also specify
> the actual serviceClass of the object in the spring config..."
>
> Is it possible that something like this is what's happening to the
> @Description annotations in the WADL case?
>
> (I hope not because to date we have about two dozen service beans
> under one JAX-RS server; gonna be hard to merge them into one service
> class.)
>

What CXF version are you working with ? It has to be 2.4.0 at least.

If WADL is properly generated, then annotations such as @Path are 
visible. But if no @Description is visible at the same time, then may be 
it's a case of an OSGI Import-Package directive missing a 
"org.apache.cxf.jaxrs.model.wadl" value ?

Let me know please if that helps

Cheers, Sergey

> Any thoughts about what I might be doing wrong would be welcome.
>
> Cheers
> MaggieL