Hi Jersey,
the project
https://github.com/wordnik/swagger-core/tree/develop-1.3/samples/java-jaxrs-cxf 
  
works for me (with this shrewdness: from swagger u.i when you put the address  
http://localhost:8002/api/api-docs.json you must remove the .json from it, 
otherwise it does not work).
I try to do the same, publishing an endPoint from java code (take a look at the 
code of attached file "classExample.java" that publishes only the pet 
endPoint), 
but when I call: 
 http://localhost:8002/api/api-docs
from swagger u.i this error is shown:
    No message body writer has been found for response class ResourceListing.
This should occur because when we arrive in the method
    private void serializeMessage(Message message, 
                                  Response response, 
                                  OperationResourceInfo ori,
                                  boolean firstTry) 
of JAXRSOutInterceptor class
the availableContentTypes is: [application/json, application/json;q=0.01]
while the message is a 
org.apache.cxf.message.XMLMessage
so that the List<WriterInterceptor> writers is null and no messageBodyWriter 
are attached...

On the other hand, if I use the swagger u.i with 
http://localhost:8002/api/api-docs.json 
an exception 
    java.lang.NoSuchMethodError
occurs in the JAXRSInInterceptor  even before arriving in the ApiListing class 
of swagger (this because with .json class we have a mismatch with the path of 
the api, I think). 

How can I solve this problem?
Thanks a lot for the help,

Andrea


Date: Fri, 7 Jun 2013 02:12:14 -0700
From: ml-node+s547215n5728909...@n5.nabble.com
To: bisoma...@hotmail.it
Subject: Re: CXF and swagger



        Hi Andrea

On 07/06/13 07:37, eanbiso wrote:

> I attach also the pom.xml file with required jar of the project (if it was

> more useful)...

> it is the pom.xml file of the example at:

> https://github.com/wordnik/swagger-core/tree/develop-1.3/samples/java-jaxrs-cxf
> that I've tried to replicate in mine project...

> pom.xml <http://cxf.547215.n5.nabble.com/file/n5728895/pom.xml>

>

I can give it a go and experiment with the actual project at


https://github.com/wordnik/swagger-core/tree/develop-1.3/samples/java-jaxrs-cxf

Can you tell me please, does that original project work for you ?


Thanks, Sergey


> Andrea

>

>

>

> --

> View this message in context: 
> http://cxf.547215.n5.nabble.com/CXF-and-swagger-tp5728644p5728895.html
> Sent from the cxf-user mailing list archive at Nabble.com.

>



-- 

Sergey Beryozkin


Talend Community Coders

http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com


        
        
        
        

        

        
        
                If you reply to this email, your message will be added to the 
discussion below:
                
http://cxf.547215.n5.nabble.com/CXF-and-swagger-tp5728644p5728909.html
        
        
                
                To unsubscribe from CXF and swagger, click here.

                NAML
                                                  

classExample.java (4K) 
<http://cxf.547215.n5.nabble.com/attachment/5728912/0/classExample.java>




--
View this message in context: 
http://cxf.547215.n5.nabble.com/CXF-and-swagger-tp5728644p5728912.html
Sent from the cxf-user mailing list archive at Nabble.com.

Reply via email to