You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Sergey Beryozkin <sb...@gmail.com> on 2016/06/01 08:38:17 UTC

Re: Swagger2Feature jar and version

Hi

I'll be moving it into a dedicated module in 3.2.0-SNAPSHOT, the current 
module has both WADL and Swagger code

Cheers, Sergey
On 01/06/16 00:35, Benson Margulies wrote:
> Somewhere in
>
>
> [INFO]    org.apache.cxf:cxf-rt-rs-service-description:jar:3.1.4:provided
>
>
>
>
>
> On Tue, May 31, 2016 at 7:31 PM, javaworkinggirl
> <ja...@gmail.com> wrote:
>> Which jar?
>>
>>
>>
>> --
>> View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769167.html
>> Sent from the cxf-user mailing list archive at Nabble.com.


Re: Swagger2Feature jar and version

Posted by Sergey Beryozkin <sb...@gmail.com>.
As far as I know the only difference between a Spring-based demo with a 
war and a standalone Spring container is the context path. So if you can 
make UI work with a war then it would be a good start

So I'd recommend you making a war demo work and see UI displayed, and 
only then start trying to make it work in a standalone container
Cheers, Sergey

On 03/06/16 21:30, Sergey Beryozkin wrote:
> I've no idea to be honest how Swagger works internally, I don't think it
> dumps any files though, the fact it responds to /swagger.json does not
> mean it has any files produced, it is a dynamic output most likely.
>
>
> On 03/06/16 21:20, javaworkinggirl wrote:
>> What directory is the Swagger JSON doc generated to?
>> I don't find any swagger files after running my app with Swagger2Feature
>> even though I am getting swagger output in my logs:
>> 2016-06-03T13:13:49,924 DEBUG [main] io.swagger.jaxrs.Reader - picking up
>> response class from method public javax.ws.rs.core.Response
>> com.twc.ctg.ecp.service.rest.EcpTvodRestServiceV1.postEntitlement(javax.servlet.http.HttpServletRequest,com.twc.ctg.ecp.model.tvod.TvodEntitlementOrder)
>>
>> throws com.twc.atgw.commons.webservices.exception.GenericRestException
>>
>> And I have run about 5 different examples.  All the examples work, but
>> none
>> fit my situation exactly.
>> I need cxf + spring + stand alone app (no .war)
>
> Well, try description_swagger - Andriy Redko did it, looks like it is a
> standalone one, Swagger(1) but setting UI should be the same as for
> Swagger2
>
> Sergey
>
>>
>> On Fri, Jun 3, 2016 at 2:15 PM, Sergey Beryozkin [via CXF] <
>> ml-node+s547215n5769280h16@n5.nabble.com> wrote:
>>
>>> Hi
>>>
>>> All it does it ensures that Swagger JSON or YAML doc is available to the
>>> clients (browsers, etc).
>>> Swagger UI is one such client - it can show Swagger JSON (which is what
>>> SwaggerFeature -> Swagger Core/JAX-RS produces) nicely formatted. As I
>>> said please do check the demo poms on how to get Swagger UI installed.
>>>
>>> It does take few tries indeed with setting UI but it is not what
>>> SwaggerFeature can help with, I recall spending a bit of time while
>>> trying the demos too. Try the demo first...
>>>
>>> Aki, Andriy, can Swagger2Feature do something to make it simpler to plug
>>> in UI ? I guess it is unlikely it can download it itself, etc.
>>>
>>> Cheers, Sergey
>>>
>>> On 03/06/16 20:04, javaworkinggirl wrote:
>>>
>>>> I still can't get swagger2Feature to work in my project
>>>>
>>>> What is the expected outcome of Swagger2Feature?  I am expecting that I
>>> am
>>>> going to see swagger documents for my api under
>>>> http://0.0.0.0:8877/api,
>>> but
>>>> the logs say 404 not found.
>>>>
>>>> Can someone explain more what is happening behind the scenes on
>>>> Swagger2Feature?
>>>> Any recommendations?  Thx.
>>>>
>>>> Here's the config I am using in applicationContext.xml:
>>>>
>>>>      <bean id="swagger2Feature"
>>>> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>>>>      <property name="basePath" value="/api"/>
>>>>      </bean>
>>>>
>>>>
>>>>
>>>>      <jaxrs:server id="ecpWebServices"
>>>> basePackages="com.twc.ctg.ecp.service.rest.custom"
>>>> address="http://0.0.0.0:8877" depends-on="activeMQConnectionFactory">
>>>>         <jaxrs:inInterceptors>
>>>>            <ref bean="validationInInterceptor"/>
>>>>         </jaxrs:inInterceptors>
>>>>         <jaxrs:outInterceptors>
>>>>            <ref bean="validationOutInterceptor"/>
>>>>         </jaxrs:outInterceptors>
>>>>         <jaxrs:serviceBeans>
>>>>            <ref bean="ecpAdminRestServiceV1"/>
>>>>            <ref bean="ecpApplicationRestServiceV1"/>
>>>>            <ref bean="ecpEntitlementRestServiceV2"/>
>>>>            <ref bean="ecpTvodRestServiceV1"/>
>>>>            <ref bean="ecpHouseholdHistoryRestServiceV1"/>
>>>>            <ref bean="ecpPromotionRestServiceV1"/>
>>>>            <ref bean="ecpTvodPromotionServiceV1"/>
>>>>            <ref bean="ecpFeatureRestServiceV1"/>
>>>>            <ref bean="ecpPpvServiceV1"/>
>>>>         </jaxrs:serviceBeans>
>>>>         <jaxrs:providers>
>>>>            <bean
>>>> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>>>>            <bean
>>>>
>>> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
>>>
>>>>            <ref bean="genericRestExceptionMapper"/>
>>>>            <ref bean="customValidationExceptionMapper"/>
>>>>         </jaxrs:providers>
>>>>         <jaxrs:features>
>>>>            <ref bean="swagger2Feature" />
>>>>         </jaxrs:features>
>>>>      </jaxrs:server>
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769278.html
>>>
>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>
>>>
>>>
>>> --
>>> Sergey Beryozkin
>>>
>>> Talend Community Coders
>>> http://coders.talend.com/
>>>
>>>
>>> ------------------------------
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769280.html
>>>
>>> To unsubscribe from Swagger2Feature jar and version, click here
>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5769165&code=amF2YXdvcmtpbmdnaXJsQGdtYWlsLmNvbXw1NzY5MTY1fC0xMTE1Njg5NTY4>
>>>
>>> .
>>> NAML
>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>
>>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769281.html
>>
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Re: Swagger2Feature jar and version

Posted by Sergey Beryozkin <sb...@gmail.com>.
I've no idea to be honest how Swagger works internally, I don't think it 
dumps any files though, the fact it responds to /swagger.json does not 
mean it has any files produced, it is a dynamic output most likely.


On 03/06/16 21:20, javaworkinggirl wrote:
> What directory is the Swagger JSON doc generated to?
> I don't find any swagger files after running my app with Swagger2Feature
> even though I am getting swagger output in my logs:
> 2016-06-03T13:13:49,924 DEBUG [main] io.swagger.jaxrs.Reader - picking up
> response class from method public javax.ws.rs.core.Response
> com.twc.ctg.ecp.service.rest.EcpTvodRestServiceV1.postEntitlement(javax.servlet.http.HttpServletRequest,com.twc.ctg.ecp.model.tvod.TvodEntitlementOrder)
> throws com.twc.atgw.commons.webservices.exception.GenericRestException
>
> And I have run about 5 different examples.  All the examples work, but none
> fit my situation exactly.
> I need cxf + spring + stand alone app (no .war)

Well, try description_swagger - Andriy Redko did it, looks like it is a 
standalone one, Swagger(1) but setting UI should be the same as for Swagger2

Sergey

>
> On Fri, Jun 3, 2016 at 2:15 PM, Sergey Beryozkin [via CXF] <
> ml-node+s547215n5769280h16@n5.nabble.com> wrote:
>
>> Hi
>>
>> All it does it ensures that Swagger JSON or YAML doc is available to the
>> clients (browsers, etc).
>> Swagger UI is one such client - it can show Swagger JSON (which is what
>> SwaggerFeature -> Swagger Core/JAX-RS produces) nicely formatted. As I
>> said please do check the demo poms on how to get Swagger UI installed.
>>
>> It does take few tries indeed with setting UI but it is not what
>> SwaggerFeature can help with, I recall spending a bit of time while
>> trying the demos too. Try the demo first...
>>
>> Aki, Andriy, can Swagger2Feature do something to make it simpler to plug
>> in UI ? I guess it is unlikely it can download it itself, etc.
>>
>> Cheers, Sergey
>>
>> On 03/06/16 20:04, javaworkinggirl wrote:
>>
>>> I still can't get swagger2Feature to work in my project
>>>
>>> What is the expected outcome of Swagger2Feature?  I am expecting that I
>> am
>>> going to see swagger documents for my api under http://0.0.0.0:8877/api,
>> but
>>> the logs say 404 not found.
>>>
>>> Can someone explain more what is happening behind the scenes on
>>> Swagger2Feature?
>>> Any recommendations?  Thx.
>>>
>>> Here's the config I am using in applicationContext.xml:
>>>
>>>      <bean id="swagger2Feature"
>>> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>>>      <property name="basePath" value="/api"/>
>>>      </bean>
>>>
>>>
>>>
>>>      <jaxrs:server id="ecpWebServices"
>>> basePackages="com.twc.ctg.ecp.service.rest.custom"
>>> address="http://0.0.0.0:8877" depends-on="activeMQConnectionFactory">
>>>         <jaxrs:inInterceptors>
>>>            <ref bean="validationInInterceptor"/>
>>>         </jaxrs:inInterceptors>
>>>         <jaxrs:outInterceptors>
>>>            <ref bean="validationOutInterceptor"/>
>>>         </jaxrs:outInterceptors>
>>>         <jaxrs:serviceBeans>
>>>            <ref bean="ecpAdminRestServiceV1"/>
>>>            <ref bean="ecpApplicationRestServiceV1"/>
>>>            <ref bean="ecpEntitlementRestServiceV2"/>
>>>            <ref bean="ecpTvodRestServiceV1"/>
>>>            <ref bean="ecpHouseholdHistoryRestServiceV1"/>
>>>            <ref bean="ecpPromotionRestServiceV1"/>
>>>            <ref bean="ecpTvodPromotionServiceV1"/>
>>>            <ref bean="ecpFeatureRestServiceV1"/>
>>>            <ref bean="ecpPpvServiceV1"/>
>>>         </jaxrs:serviceBeans>
>>>         <jaxrs:providers>
>>>            <bean
>>> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>>>            <bean
>>>
>> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
>>>            <ref bean="genericRestExceptionMapper"/>
>>>            <ref bean="customValidationExceptionMapper"/>
>>>         </jaxrs:providers>
>>>         <jaxrs:features>
>>>            <ref bean="swagger2Feature" />
>>>         </jaxrs:features>
>>>      </jaxrs:server>
>>>
>>>
>>>
>>> --
>>> View this message in context:
>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769278.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>
>>
>> --
>> Sergey Beryozkin
>>
>> Talend Community Coders
>> http://coders.talend.com/
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769280.html
>> To unsubscribe from Swagger2Feature jar and version, click here
>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5769165&code=amF2YXdvcmtpbmdnaXJsQGdtYWlsLmNvbXw1NzY5MTY1fC0xMTE1Njg5NTY4>
>> .
>> NAML
>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769281.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


Re: Swagger2Feature jar and version

Posted by javaworkinggirl <ja...@gmail.com>.
What directory is the Swagger JSON doc generated to?
I don't find any swagger files after running my app with Swagger2Feature
even though I am getting swagger output in my logs:
2016-06-03T13:13:49,924 DEBUG [main] io.swagger.jaxrs.Reader - picking up
response class from method public javax.ws.rs.core.Response
com.twc.ctg.ecp.service.rest.EcpTvodRestServiceV1.postEntitlement(javax.servlet.http.HttpServletRequest,com.twc.ctg.ecp.model.tvod.TvodEntitlementOrder)
throws com.twc.atgw.commons.webservices.exception.GenericRestException

And I have run about 5 different examples.  All the examples work, but none
fit my situation exactly.
I need cxf + spring + stand alone app (no .war)

On Fri, Jun 3, 2016 at 2:15 PM, Sergey Beryozkin [via CXF] <
ml-node+s547215n5769280h16@n5.nabble.com> wrote:

> Hi
>
> All it does it ensures that Swagger JSON or YAML doc is available to the
> clients (browsers, etc).
> Swagger UI is one such client - it can show Swagger JSON (which is what
> SwaggerFeature -> Swagger Core/JAX-RS produces) nicely formatted. As I
> said please do check the demo poms on how to get Swagger UI installed.
>
> It does take few tries indeed with setting UI but it is not what
> SwaggerFeature can help with, I recall spending a bit of time while
> trying the demos too. Try the demo first...
>
> Aki, Andriy, can Swagger2Feature do something to make it simpler to plug
> in UI ? I guess it is unlikely it can download it itself, etc.
>
> Cheers, Sergey
>
> On 03/06/16 20:04, javaworkinggirl wrote:
>
> > I still can't get swagger2Feature to work in my project
> >
> > What is the expected outcome of Swagger2Feature?  I am expecting that I
> am
> > going to see swagger documents for my api under http://0.0.0.0:8877/api,
> but
> > the logs say 404 not found.
> >
> > Can someone explain more what is happening behind the scenes on
> > Swagger2Feature?
> > Any recommendations?  Thx.
> >
> > Here's the config I am using in applicationContext.xml:
> >
> >     <bean id="swagger2Feature"
> > class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
> >     <property name="basePath" value="/api"/>
> >     </bean>
> >
> >
> >
> >     <jaxrs:server id="ecpWebServices"
> > basePackages="com.twc.ctg.ecp.service.rest.custom"
> > address="http://0.0.0.0:8877" depends-on="activeMQConnectionFactory">
> >        <jaxrs:inInterceptors>
> >           <ref bean="validationInInterceptor"/>
> >        </jaxrs:inInterceptors>
> >        <jaxrs:outInterceptors>
> >           <ref bean="validationOutInterceptor"/>
> >        </jaxrs:outInterceptors>
> >        <jaxrs:serviceBeans>
> >           <ref bean="ecpAdminRestServiceV1"/>
> >           <ref bean="ecpApplicationRestServiceV1"/>
> >           <ref bean="ecpEntitlementRestServiceV2"/>
> >           <ref bean="ecpTvodRestServiceV1"/>
> >           <ref bean="ecpHouseholdHistoryRestServiceV1"/>
> >           <ref bean="ecpPromotionRestServiceV1"/>
> >           <ref bean="ecpTvodPromotionServiceV1"/>
> >           <ref bean="ecpFeatureRestServiceV1"/>
> >           <ref bean="ecpPpvServiceV1"/>
> >        </jaxrs:serviceBeans>
> >        <jaxrs:providers>
> >           <bean
> > class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
> >           <bean
> >
> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
> >           <ref bean="genericRestExceptionMapper"/>
> >           <ref bean="customValidationExceptionMapper"/>
> >        </jaxrs:providers>
> >        <jaxrs:features>
> >           <ref bean="swagger2Feature" />
> >        </jaxrs:features>
> >     </jaxrs:server>
> >
> >
> >
> > --
> > View this message in context:
> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769278.html
> > Sent from the cxf-user mailing list archive at Nabble.com.
> >
>
>
> --
> Sergey Beryozkin
>
> Talend Community Coders
> http://coders.talend.com/
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769280.html
> To unsubscribe from Swagger2Feature jar and version, click here
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5769165&code=amF2YXdvcmtpbmdnaXJsQGdtYWlsLmNvbXw1NzY5MTY1fC0xMTE1Njg5NTY4>
> .
> NAML
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769281.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Swagger2Feature jar and version

Posted by Sergey Beryozkin <sb...@gmail.com>.
If the file is already available then CXF SwaggerFeature is not needed, 
it is just a resource then that can be served. SwaggerFeature sets up 
the Swagger endpoint or optionally a filter which can response to 
/swagger.json queries by introspecting Swagger-annotated resources

Cheers, Sergey
On 03/06/16 22:09, Chris Riley wrote:
> You may want to consider using the Swagger Editor at swagger.io to generate a server and then look at the pom.xml. If you are using the wordnik plugin and annotations in code, it generates the doc under the target folder I believe. Not sure how this ties into CXF feature.
>
> Chris Riley, Manager
> HKM Consulting LLC
> criley@hkmconsultingllc.com
> (o)  774-357-5900
> (m) 508-273-3102
> (f)   774-357-5905
>
>> On Jun 3, 2016, at 4:14 PM, Sergey Beryozkin <sb...@gmail.com> wrote:
>>
>> Hi
>>
>> All it does it ensures that Swagger JSON or YAML doc is available to the clients (browsers, etc).
>> Swagger UI is one such client - it can show Swagger JSON (which is what SwaggerFeature -> Swagger Core/JAX-RS produces) nicely formatted. As I said please do check the demo poms on how to get Swagger UI installed.
>>
>> It does take few tries indeed with setting UI but it is not what SwaggerFeature can help with, I recall spending a bit of time while trying the demos too. Try the demo first...
>>
>> Aki, Andriy, can Swagger2Feature do something to make it simpler to plug in UI ? I guess it is unlikely it can download it itself, etc.
>>
>> Cheers, Sergey
>>
>>> On 03/06/16 20:04, javaworkinggirl wrote:
>>> I still can't get swagger2Feature to work in my project
>>>
>>> What is the expected outcome of Swagger2Feature?  I am expecting that I am
>>> going to see swagger documents for my api under http://0.0.0.0:8877/api, but
>>> the logs say 404 not found.
>>>
>>> Can someone explain more what is happening behind the scenes on
>>> Swagger2Feature?
>>> Any recommendations?  Thx.
>>>
>>> Here's the config I am using in applicationContext.xml:
>>>
>>>     <bean id="swagger2Feature"
>>> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>>>     <property name="basePath" value="/api"/>
>>>     </bean>
>>>
>>>
>>>
>>>     <jaxrs:server id="ecpWebServices"
>>> basePackages="com.twc.ctg.ecp.service.rest.custom"
>>> address="http://0.0.0.0:8877" depends-on="activeMQConnectionFactory">
>>>        <jaxrs:inInterceptors>
>>>           <ref bean="validationInInterceptor"/>
>>>        </jaxrs:inInterceptors>
>>>        <jaxrs:outInterceptors>
>>>           <ref bean="validationOutInterceptor"/>
>>>        </jaxrs:outInterceptors>
>>>        <jaxrs:serviceBeans>
>>>           <ref bean="ecpAdminRestServiceV1"/>
>>>           <ref bean="ecpApplicationRestServiceV1"/>
>>>           <ref bean="ecpEntitlementRestServiceV2"/>
>>>           <ref bean="ecpTvodRestServiceV1"/>
>>>           <ref bean="ecpHouseholdHistoryRestServiceV1"/>
>>>           <ref bean="ecpPromotionRestServiceV1"/>
>>>           <ref bean="ecpTvodPromotionServiceV1"/>
>>>           <ref bean="ecpFeatureRestServiceV1"/>
>>>           <ref bean="ecpPpvServiceV1"/>
>>>        </jaxrs:serviceBeans>
>>>        <jaxrs:providers>
>>>           <bean
>>> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>>>           <bean
>>> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
>>>           <ref bean="genericRestExceptionMapper"/>
>>>           <ref bean="customValidationExceptionMapper"/>
>>>        </jaxrs:providers>
>>>        <jaxrs:features>
>>>           <ref bean="swagger2Feature" />
>>>        </jaxrs:features>
>>>     </jaxrs:server>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769278.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
>> --
>> Sergey Beryozkin
>>
>> Talend Community Coders
>> http://coders.talend.com/


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Re: Swagger2Feature jar and version

Posted by Chris Riley <cr...@hkmconsultingllc.com>.
You may want to consider using the Swagger Editor at swagger.io to generate a server and then look at the pom.xml. If you are using the wordnik plugin and annotations in code, it generates the doc under the target folder I believe. Not sure how this ties into CXF feature.

Chris Riley, Manager
HKM Consulting LLC
criley@hkmconsultingllc.com
(o)  774-357-5900
(m) 508-273-3102
(f)   774-357-5905

> On Jun 3, 2016, at 4:14 PM, Sergey Beryozkin <sb...@gmail.com> wrote:
> 
> Hi
> 
> All it does it ensures that Swagger JSON or YAML doc is available to the clients (browsers, etc).
> Swagger UI is one such client - it can show Swagger JSON (which is what SwaggerFeature -> Swagger Core/JAX-RS produces) nicely formatted. As I said please do check the demo poms on how to get Swagger UI installed.
> 
> It does take few tries indeed with setting UI but it is not what SwaggerFeature can help with, I recall spending a bit of time while trying the demos too. Try the demo first...
> 
> Aki, Andriy, can Swagger2Feature do something to make it simpler to plug in UI ? I guess it is unlikely it can download it itself, etc.
> 
> Cheers, Sergey
> 
>> On 03/06/16 20:04, javaworkinggirl wrote:
>> I still can't get swagger2Feature to work in my project
>> 
>> What is the expected outcome of Swagger2Feature?  I am expecting that I am
>> going to see swagger documents for my api under http://0.0.0.0:8877/api, but
>> the logs say 404 not found.
>> 
>> Can someone explain more what is happening behind the scenes on
>> Swagger2Feature?
>> Any recommendations?  Thx.
>> 
>> Here's the config I am using in applicationContext.xml:
>> 
>>    <bean id="swagger2Feature"
>> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>>    <property name="basePath" value="/api"/>
>>    </bean>
>> 
>> 
>> 
>>    <jaxrs:server id="ecpWebServices"
>> basePackages="com.twc.ctg.ecp.service.rest.custom"
>> address="http://0.0.0.0:8877" depends-on="activeMQConnectionFactory">
>>       <jaxrs:inInterceptors>
>>          <ref bean="validationInInterceptor"/>
>>       </jaxrs:inInterceptors>
>>       <jaxrs:outInterceptors>
>>          <ref bean="validationOutInterceptor"/>
>>       </jaxrs:outInterceptors>
>>       <jaxrs:serviceBeans>
>>          <ref bean="ecpAdminRestServiceV1"/>
>>          <ref bean="ecpApplicationRestServiceV1"/>
>>          <ref bean="ecpEntitlementRestServiceV2"/>
>>          <ref bean="ecpTvodRestServiceV1"/>
>>          <ref bean="ecpHouseholdHistoryRestServiceV1"/>
>>          <ref bean="ecpPromotionRestServiceV1"/>
>>          <ref bean="ecpTvodPromotionServiceV1"/>
>>          <ref bean="ecpFeatureRestServiceV1"/>
>>          <ref bean="ecpPpvServiceV1"/>
>>       </jaxrs:serviceBeans>
>>       <jaxrs:providers>
>>          <bean
>> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>>          <bean
>> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
>>          <ref bean="genericRestExceptionMapper"/>
>>          <ref bean="customValidationExceptionMapper"/>
>>       </jaxrs:providers>
>>       <jaxrs:features>
>>          <ref bean="swagger2Feature" />
>>       </jaxrs:features>
>>    </jaxrs:server>
>> 
>> 
>> 
>> --
>> View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769278.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
> 
> 
> -- 
> Sergey Beryozkin
> 
> Talend Community Coders
> http://coders.talend.com/

Re: Swagger2Feature jar and version

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

All it does it ensures that Swagger JSON or YAML doc is available to the 
clients (browsers, etc).
Swagger UI is one such client - it can show Swagger JSON (which is what 
SwaggerFeature -> Swagger Core/JAX-RS produces) nicely formatted. As I 
said please do check the demo poms on how to get Swagger UI installed.

It does take few tries indeed with setting UI but it is not what 
SwaggerFeature can help with, I recall spending a bit of time while 
trying the demos too. Try the demo first...

Aki, Andriy, can Swagger2Feature do something to make it simpler to plug 
in UI ? I guess it is unlikely it can download it itself, etc.

Cheers, Sergey

On 03/06/16 20:04, javaworkinggirl wrote:
> I still can't get swagger2Feature to work in my project
>
> What is the expected outcome of Swagger2Feature?  I am expecting that I am
> going to see swagger documents for my api under http://0.0.0.0:8877/api, but
> the logs say 404 not found.
>
> Can someone explain more what is happening behind the scenes on
> Swagger2Feature?
> Any recommendations?  Thx.
>
> Here's the config I am using in applicationContext.xml:
>
>     <bean id="swagger2Feature"
> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>     <property name="basePath" value="/api"/>
>     </bean>
>
>
>
>     <jaxrs:server id="ecpWebServices"
> basePackages="com.twc.ctg.ecp.service.rest.custom"
> address="http://0.0.0.0:8877" depends-on="activeMQConnectionFactory">
>        <jaxrs:inInterceptors>
>           <ref bean="validationInInterceptor"/>
>        </jaxrs:inInterceptors>
>        <jaxrs:outInterceptors>
>           <ref bean="validationOutInterceptor"/>
>        </jaxrs:outInterceptors>
>        <jaxrs:serviceBeans>
>           <ref bean="ecpAdminRestServiceV1"/>
>           <ref bean="ecpApplicationRestServiceV1"/>
>           <ref bean="ecpEntitlementRestServiceV2"/>
>           <ref bean="ecpTvodRestServiceV1"/>
>           <ref bean="ecpHouseholdHistoryRestServiceV1"/>
>           <ref bean="ecpPromotionRestServiceV1"/>
>           <ref bean="ecpTvodPromotionServiceV1"/>
>           <ref bean="ecpFeatureRestServiceV1"/>
>           <ref bean="ecpPpvServiceV1"/>
>        </jaxrs:serviceBeans>
>        <jaxrs:providers>
>           <bean
> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>           <bean
> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
>           <ref bean="genericRestExceptionMapper"/>
>           <ref bean="customValidationExceptionMapper"/>
>        </jaxrs:providers>
>        <jaxrs:features>
>           <ref bean="swagger2Feature" />
>        </jaxrs:features>
>     </jaxrs:server>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769278.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Re: Swagger2Feature jar and version

Posted by javaworkinggirl <ja...@gmail.com>.
I still can't get swagger2Feature to work in my project 

What is the expected outcome of Swagger2Feature?  I am expecting that I am
going to see swagger documents for my api under http://0.0.0.0:8877/api, but
the logs say 404 not found.

Can someone explain more what is happening behind the scenes on
Swagger2Feature?
Any recommendations?  Thx.

Here's the config I am using in applicationContext.xml:
   
   <bean id="swagger2Feature"
class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
   <property name="basePath" value="/api"/>
   </bean>

   
   
   <jaxrs:server id="ecpWebServices"
basePackages="com.twc.ctg.ecp.service.rest.custom"
address="http://0.0.0.0:8877" depends-on="activeMQConnectionFactory">
      <jaxrs:inInterceptors>
         <ref bean="validationInInterceptor"/>
      </jaxrs:inInterceptors>
      <jaxrs:outInterceptors>
         <ref bean="validationOutInterceptor"/>
      </jaxrs:outInterceptors>
      <jaxrs:serviceBeans>
         <ref bean="ecpAdminRestServiceV1"/>
         <ref bean="ecpApplicationRestServiceV1"/>
         <ref bean="ecpEntitlementRestServiceV2"/>
         <ref bean="ecpTvodRestServiceV1"/>
         <ref bean="ecpHouseholdHistoryRestServiceV1"/>
         <ref bean="ecpPromotionRestServiceV1"/>
         <ref bean="ecpTvodPromotionServiceV1"/>
         <ref bean="ecpFeatureRestServiceV1"/>
         <ref bean="ecpPpvServiceV1"/>
      </jaxrs:serviceBeans>
      <jaxrs:providers>
         <bean
class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
         <bean
class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
         <ref bean="genericRestExceptionMapper"/>
         <ref bean="customValidationExceptionMapper"/>
      </jaxrs:providers>
      <jaxrs:features>
         <ref bean="swagger2Feature" />
      </jaxrs:features>
   </jaxrs:server>



--
View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769278.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Swagger2Feature jar and version

Posted by Aki Yoshida <el...@gmail.com>.
I saw the other thread today that you already created. So please
ignore my previous reply.

2016-07-01 1:30 GMT+02:00 Aki Yoshida <el...@gmail.com>:
> what is your current setup? What do you mean by a single endpoint
> working but not multiple endpoints?
> Multiple endpoints are not working at al or their swagger descriptions
> are not correctly generated?
> Maybe it would be better to start a new thread where you can describe
> this exact problem.
>
> 2016-06-22 23:56 GMT+02:00 javaworkinggirl <ja...@gmail.com>:
>> Thank you for updating the sample.  I was able to get 1 endpoint working, but
>> not multiple endpoints in the same application.  Any ideas?
>>
>>
>>
>> --
>> View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769674.html
>> Sent from the cxf-user mailing list archive at Nabble.com.

Re: Swagger2Feature jar and version

Posted by Aki Yoshida <el...@gmail.com>.
what is your current setup? What do you mean by a single endpoint
working but not multiple endpoints?
Multiple endpoints are not working at al or their swagger descriptions
are not correctly generated?
Maybe it would be better to start a new thread where you can describe
this exact problem.

2016-06-22 23:56 GMT+02:00 javaworkinggirl <ja...@gmail.com>:
> Thank you for updating the sample.  I was able to get 1 endpoint working, but
> not multiple endpoints in the same application.  Any ideas?
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769674.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Re: Swagger2Feature jar and version

Posted by javaworkinggirl <ja...@gmail.com>.
Thank you for updating the sample.  I was able to get 1 endpoint working, but
not multiple endpoints in the same application.  Any ideas?



--
View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769674.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Swagger2Feature jar and version

Posted by Aki Yoshida <el...@gmail.com>.
just committed the sample and also fixed the jackson version mixed-up
which got slipped into cxf-3.1.6.



2016-06-07 9:16 GMT+02:00 Aki Yoshida <el...@gmail.com>:
> javaworkinggirl,
> I have to correct what I said before regarding the jackson version and
> you are right.
> I just checked cxf 3.1.x and 3.2.x's samples. They are picking some
> mismatched jackson dependency.
> I'll update them shortly and also add a plain spring version of it
> (although we thought that would not be necessary because all you need
> is to take the description_swagger2_web's spring xml and change the
> endpoint url and just load the file using the spring context loader,
> having a sample is probably helpful).
> regards, aki
>
> 2016-06-05 23:00 GMT+02:00 Aki Yoshida <el...@gmail.com>:
>> regarding your jackson version issue, CXF's samples should be all
>> running with the jackson version that are automatically picked up,
>> which is some 2.4.x. version.
>> And current swagger-core 1.5.9 itself is built with jackson 2.4.5.
>>
>> So if your code is complaining about jackson version and upgrading it
>> to the 2.7.4 version which is not even used in swagger, it has to
>> something to do with your own jackson usage. Probably you had a
>> mixture of old and new versions and the new one was picking up some
>> classes from the older one and hitting the NoSuchMethodError
>>
>> regards, aki
>>
>>
>> 2016-06-02 20:38 GMT+02:00 javaworkinggirl <ja...@gmail.com>:
>>> I upgraded jackson to get the sample to work.
>>>
>>> <dependency>
>>>       <groupId>com.fasterxml.jackson.jaxrs</groupId>
>>>       <artifactId>jackson-jaxrs-json-provider</artifactId>
>>>       <version>2.7.4</version>
>>> </dependency>
>>>    <dependency>
>>>     <groupId>com.fasterxml.jackson.core</groupId>
>>>        <artifactId>jackson-core</artifactId>
>>>        <version>2.7.4</version>
>>>    </dependency>
>>>
>>>
>>> On Thu, Jun 2, 2016 at 11:09 AM, Tara Czutno <ja...@gmail.com>
>>> wrote:
>>>
>>>> In the description_swagger2 project I followed the Readme.txt.
>>>> This worked:
>>>>
>>>> mvn install
>>>> mvn -Pserver
>>>>
>>>>
>>>> But none of these links worked:
>>>>
>>>> http://localhost:9000/swagger.json
>>>> http://localhost:9000/swagger.yaml
>>>>
>>>> http://localhost:9000/?url=/swagger.json
>>>>
>>>> http://localhost:9000/?url=/swagger.yaml
>>>>
>>>>
>>>> Got:
>>>>
>>>> Can't read from server. It may not have the appropriate access-control-origin settings.
>>>>
>>>> And this was in the logs:
>>>>
>>>> Jun 02, 2016 11:05:03 AM org.apache.cxf.common.logging.LogUtils doLog
>>>>>
>>>>> WARNING: Interceptor for {http://server.swagger.jaxrs.demo/}Sample has
>>>>> thrown exception, unwinding now
>>>>>
>>>>> org.apache.cxf.interceptor.Fault:
>>>>> com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
>>>>>
>>>>> at
>>>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleWriteException(JAXRSOutInterceptor.java:391)
>>>>>
>>>>> at
>>>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:266)
>>>>>
>>>>> at
>>>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:120)
>>>>>
>>>>> at
>>>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAXRSOutInterceptor.java:83)
>>>>>
>>>>> at
>>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>>>>>
>>>>> at
>>>>> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83)
>>>>>
>>>>> at
>>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>>>>>
>>>>> at
>>>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>>>>>
>>>>> at
>>>>> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
>>>>>
>>>>> at
>>>>> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
>>>>>
>>>>> at
>>>>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
>>>>>
>>>>> at
>>>>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
>>>>>
>>>>> at
>>>>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
>>>>>
>>>>> at
>>>>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)
>>>>>
>>>>> at
>>>>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:223)
>>>>>
>>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
>>>>>
>>>>> at
>>>>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274)
>>>>>
>>>>> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
>>>>>
>>>>> at org.eclipse.jetty.server.Server.handle(Server.java:517)
>>>>>
>>>>> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
>>>>>
>>>>> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
>>>>>
>>>>> at
>>>>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
>>>>>
>>>>> at java.lang.Thread.run(Thread.java:745)
>>>>>
>>>>> Caused by: java.lang.NoSuchMethodError:
>>>>> com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
>>>>>
>>>>> at
>>>>> com.fasterxml.jackson.databind.ser.BasicSerializerFactory.findSerializerByLookup(BasicSerializerFactory.java:302)
>>>>>
>>>>> at
>>>>> com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:218)
>>>>>
>>>>> at
>>>>> com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:153)
>>>>>
>>>>> at
>>>>> com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:1203)
>>>>>
>>>>> at
>>>>> com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1157)
>>>>>
>>>>> at
>>>>> com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:481)
>>>>>
>>>>> at
>>>>> com.fasterxml.jackson.databind.SerializerProvider.findTypedValueSerializer(SerializerProvider.java:679)
>>>>>
>>>>> at
>>>>> com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:107)
>>>>>
>>>>> at
>>>>> com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3559)
>>>>>
>>>>> at
>>>>> com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:2927)
>>>>>
>>>>> at
>>>>> io.swagger.jaxrs.listing.SwaggerSerializers.writeTo(SwaggerSerializers.java:52)
>>>>>
>>>>> at
>>>>> org.apache.cxf.jaxrs.swagger.Swagger2Serializers.writeTo(Swagger2Serializers.java:145)
>>>>>
>>>>> at
>>>>> org.apache.cxf.jaxrs.swagger.Swagger2Serializers.writeTo(Swagger2Serializers.java:49)
>>>>>
>>>>> at
>>>>> org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1380)
>>>>>
>>>>> at
>>>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:244)
>>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Thu, Jun 2, 2016 at 10:33 AM, Tara Czutno <ja...@gmail.com>
>>>> wrote:
>>>>
>>>>> Okay I will try that.
>>>>>
>>>>> On Thu, Jun 2, 2016 at 10:32 AM, Aki Yoshida-3 [via CXF] <
>>>>> ml-node+s547215n5769226h42@n5.nabble.com> wrote:
>>>>>
>>>>>> hi,
>>>>>> those swagger2 samples included in cxf's samples include README.txt
>>>>>> explaining how you can try them out.
>>>>>> In short, both description_swagger2 and description_swagger2_web are
>>>>>> the standalone/embedded-jetty and web-container samples and both
>>>>>> deploy the swagger-ui with the sample apps. description_swagger2_osgi
>>>>>> is an osgi bundle that doesn't include the swagger-ui. You can use
>>>>>> swagger-ui from elsewhere (e.g., from one of the other samples or from
>>>>>> a local file system).
>>>>>> regards, aki
>>>>>>
>>>>>> 2016-06-02 11:24 GMT+02:00 Sergey Beryozkin <[hidden email]
>>>>>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=0>>:
>>>>>>
>>>>>> > Hi
>>>>>> >
>>>>>> > I believe one needs to add Swagger UI, Aki Youshida added 3 Swagger 2
>>>>>> demos,
>>>>>> > see this directory:
>>>>>> >
>>>>>> >
>>>>>> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs
>>>>>> >
>>>>>> > Can you please try one of them ?
>>>>>> >
>>>>>> > Actually, I've just tried
>>>>>> >
>>>>>> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot
>>>>>> >
>>>>>> > which creates a CXFServlet with a URI "/services/helloworld/*" pattern
>>>>>> > and registers the feature at
>>>>>> >
>>>>>> https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java#L49
>>>>>> >
>>>>>> > and
>>>>>> >
>>>>>> > http://localhost:8080/services/helloservice/swagger.json
>>>>>> >
>>>>>> > returns JSON,
>>>>>> >
>>>>>> > http://localhost:8080/services/helloservice/swagger.yaml
>>>>>> >
>>>>>> > return Yaml.
>>>>>> >
>>>>>> > but I guess having UI on top of it would be good, so please Aki's
>>>>>> demo's
>>>>>> > (pom.xml) on how to wire Swagger UI in
>>>>>> >
>>>>>> > HTH, Sergey
>>>>>> >
>>>>>> >
>>>>>> >
>>>>>> > On 01/06/16 21:21, javaworkinggirl wrote:
>>>>>> >>
>>>>>> >> Okay I got my code to compile and run with Swagger2Feature, but I
>>>>>> don't
>>>>>> >> see
>>>>>> >> any swagger files being generated.  Where are they supposed to be
>>>>>> >> generated
>>>>>> >> at?  Does Swagger2Feature log any status?
>>>>>> >>
>>>>>> >> <!-- CXF Swagger2Feature -->
>>>>>> >> <bean id="swagger2FeatureWebServices"
>>>>>> >> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>>>>>> >>     <property name="basePath" value="/api"/>
>>>>>> >>     <property name="contact" value="[hidden email]
>>>>>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=1>"/>
>>>>>> >>     <property name="description" value="xyz REST Services"/>
>>>>>> >>     <property name="host" value="0.0.0.0"/>
>>>>>> >>     <property name="prettyPrint" value="false"/>
>>>>>> >>     <property name="resourcePackage"
>>>>>> >> value="com.twc.ctg.xyz.service.rest"/>
>>>>>> >>     <property name="title" value="xyz REST Services"/>
>>>>>> >> </bean>
>>>>>> >>
>>>>>> >>
>>>>>> >> <!-- Depends on activemq due to tvod vendor rest service using amqp
>>>>>> to
>>>>>> >> send notifications -->
>>>>>> >> <!-- This endpoint scans our rest.custom directory for Providers,
>>>>>> >> NameBindings etc. -->
>>>>>> >> <jaxrs:server id="ecpWebServices"
>>>>>> >> basePackages="com.twc.ctg.ecp.service.rest.custom"
>>>>>> >> address="http://0.0.0.0:8877"
>>>>>> depends-on="activeMQConnectionFactory">
>>>>>> >>     <jaxrs:inInterceptors>
>>>>>> >>        <ref bean="validationInInterceptor"/>
>>>>>> >>     </jaxrs:inInterceptors>
>>>>>> >>     <jaxrs:outInterceptors>
>>>>>> >>        <ref bean="validationOutInterceptor"/>
>>>>>> >>     </jaxrs:outInterceptors>
>>>>>> >>     <jaxrs:serviceBeans>
>>>>>> >>        <ref bean="ecpAdminRestServiceV1"/>
>>>>>> >>        <ref bean="ecpApplicationRestServiceV1"/>
>>>>>> >>        <ref bean="ecpEntitlementRestServiceV2"/>
>>>>>> >>        <ref bean="ecpTvodRestServiceV1"/>
>>>>>> >>        <ref bean="ecpHouseholdHistoryRestServiceV1"/>
>>>>>> >>        <ref bean="ecpPromotionRestServiceV1"/>
>>>>>> >>        <ref bean="ecpTvodPromotionServiceV1"/>
>>>>>> >>        <ref bean="ecpFeatureRestServiceV1"/>
>>>>>> >>        <ref bean="ecpPpvServiceV1"/>
>>>>>> >>     </jaxrs:serviceBeans>
>>>>>> >>     <jaxrs:providers>
>>>>>> >>        <bean
>>>>>> >> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>>>>>> >>        <bean
>>>>>> >>
>>>>>> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
>>>>>> >>        <ref bean="genericRestExceptionMapper"/>
>>>>>> >>        <ref bean="customValidationExceptionMapper"/>
>>>>>> >>     </jaxrs:providers>
>>>>>> >>     <jaxrs:features>
>>>>>> >>        <ref bean="swagger2FeatureWebServices" />
>>>>>> >>     </jaxrs:features>
>>>>>> >> </jaxrs:server>
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> On Wed, Jun 1, 2016 at 2:38 AM, Sergey Beryozkin [via CXF] <
>>>>>> >> [hidden email]
>>>>>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=2>> wrote:
>>>>>> >>
>>>>>> >>> Hi
>>>>>> >>>
>>>>>> >>> I'll be moving it into a dedicated module in 3.2.0-SNAPSHOT, the
>>>>>> current
>>>>>> >>> module has both WADL and Swagger code
>>>>>> >>>
>>>>>> >>> Cheers, Sergey
>>>>>> >>> On 01/06/16 00:35, Benson Margulies wrote:
>>>>>> >>>
>>>>>> >>>> Somewhere in
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> [INFO]
>>>>>> >>>
>>>>>> >>>   org.apache.cxf:cxf-rt-rs-service-description:jar:3.1.4:provided
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>>
>>>>>> >>>> On Tue, May 31, 2016 at 7:31 PM, javaworkinggirl
>>>>>> >>>> <[hidden email] <
>>>>>> http:///user/SendEmail.jtp?type=node&node=5769172&i=0>>
>>>>>> >>>
>>>>>> >>> wrote:
>>>>>> >>>>>
>>>>>> >>>>> Which jar?
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>>
>>>>>> >>>>> --
>>>>>> >>>>> View this message in context:
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769167.html
>>>>>> >>>>>
>>>>>> >>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> >>> ------------------------------
>>>>>> >>> If you reply to this email, your message will be added to the
>>>>>> discussion
>>>>>> >>> below:
>>>>>> >>>
>>>>>> >>>
>>>>>> >>>
>>>>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769172.html
>>>>>> >>> To unsubscribe from Swagger2Feature jar and version, click here
>>>>>> >>>
>>>>>> >>> <
>>>>>> >>> .
>>>>>> >>> NAML
>>>>>> >>>
>>>>>> >>> <
>>>>>> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>>>>
>>>>>> >>>
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >>
>>>>>> >> --
>>>>>> >> View this message in context:
>>>>>> >>
>>>>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769200.html
>>>>>> >> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>>> >>
>>>>>> >
>>>>>>
>>>>>>
>>>>>> ------------------------------
>>>>>> If you reply to this email, your message will be added to the discussion
>>>>>> below:
>>>>>>
>>>>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769226.html
>>>>>> To unsubscribe from Swagger2Feature jar and version, click here
>>>>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5769165&code=amF2YXdvcmtpbmdnaXJsQGdtYWlsLmNvbXw1NzY5MTY1fC0xMTE1Njg5NTY4>
>>>>>> .
>>>>>> NAML
>>>>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>>>>
>>>>>
>>>>>
>>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769237.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.

Re: Swagger2Feature jar and version

Posted by Aki Yoshida <el...@gmail.com>.
javaworkinggirl,
I have to correct what I said before regarding the jackson version and
you are right.
I just checked cxf 3.1.x and 3.2.x's samples. They are picking some
mismatched jackson dependency.
I'll update them shortly and also add a plain spring version of it
(although we thought that would not be necessary because all you need
is to take the description_swagger2_web's spring xml and change the
endpoint url and just load the file using the spring context loader,
having a sample is probably helpful).
regards, aki

2016-06-05 23:00 GMT+02:00 Aki Yoshida <el...@gmail.com>:
> regarding your jackson version issue, CXF's samples should be all
> running with the jackson version that are automatically picked up,
> which is some 2.4.x. version.
> And current swagger-core 1.5.9 itself is built with jackson 2.4.5.
>
> So if your code is complaining about jackson version and upgrading it
> to the 2.7.4 version which is not even used in swagger, it has to
> something to do with your own jackson usage. Probably you had a
> mixture of old and new versions and the new one was picking up some
> classes from the older one and hitting the NoSuchMethodError
>
> regards, aki
>
>
> 2016-06-02 20:38 GMT+02:00 javaworkinggirl <ja...@gmail.com>:
>> I upgraded jackson to get the sample to work.
>>
>> <dependency>
>>       <groupId>com.fasterxml.jackson.jaxrs</groupId>
>>       <artifactId>jackson-jaxrs-json-provider</artifactId>
>>       <version>2.7.4</version>
>> </dependency>
>>    <dependency>
>>     <groupId>com.fasterxml.jackson.core</groupId>
>>        <artifactId>jackson-core</artifactId>
>>        <version>2.7.4</version>
>>    </dependency>
>>
>>
>> On Thu, Jun 2, 2016 at 11:09 AM, Tara Czutno <ja...@gmail.com>
>> wrote:
>>
>>> In the description_swagger2 project I followed the Readme.txt.
>>> This worked:
>>>
>>> mvn install
>>> mvn -Pserver
>>>
>>>
>>> But none of these links worked:
>>>
>>> http://localhost:9000/swagger.json
>>> http://localhost:9000/swagger.yaml
>>>
>>> http://localhost:9000/?url=/swagger.json
>>>
>>> http://localhost:9000/?url=/swagger.yaml
>>>
>>>
>>> Got:
>>>
>>> Can't read from server. It may not have the appropriate access-control-origin settings.
>>>
>>> And this was in the logs:
>>>
>>> Jun 02, 2016 11:05:03 AM org.apache.cxf.common.logging.LogUtils doLog
>>>>
>>>> WARNING: Interceptor for {http://server.swagger.jaxrs.demo/}Sample has
>>>> thrown exception, unwinding now
>>>>
>>>> org.apache.cxf.interceptor.Fault:
>>>> com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
>>>>
>>>> at
>>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleWriteException(JAXRSOutInterceptor.java:391)
>>>>
>>>> at
>>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:266)
>>>>
>>>> at
>>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:120)
>>>>
>>>> at
>>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAXRSOutInterceptor.java:83)
>>>>
>>>> at
>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>>>>
>>>> at
>>>> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83)
>>>>
>>>> at
>>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>>>>
>>>> at
>>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>>>>
>>>> at
>>>> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
>>>>
>>>> at
>>>> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
>>>>
>>>> at
>>>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
>>>>
>>>> at
>>>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
>>>>
>>>> at
>>>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
>>>>
>>>> at
>>>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)
>>>>
>>>> at
>>>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:223)
>>>>
>>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
>>>>
>>>> at
>>>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274)
>>>>
>>>> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
>>>>
>>>> at
>>>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
>>>>
>>>> at
>>>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)
>>>>
>>>> at
>>>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
>>>>
>>>> at
>>>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)
>>>>
>>>> at
>>>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>>>>
>>>> at
>>>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
>>>>
>>>> at org.eclipse.jetty.server.Server.handle(Server.java:517)
>>>>
>>>> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306)
>>>>
>>>> at
>>>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
>>>>
>>>> at
>>>> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
>>>>
>>>> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>>>>
>>>> at
>>>> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
>>>>
>>>> at
>>>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
>>>>
>>>> at
>>>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
>>>>
>>>> at
>>>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
>>>>
>>>> at
>>>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
>>>>
>>>> at java.lang.Thread.run(Thread.java:745)
>>>>
>>>> Caused by: java.lang.NoSuchMethodError:
>>>> com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
>>>>
>>>> at
>>>> com.fasterxml.jackson.databind.ser.BasicSerializerFactory.findSerializerByLookup(BasicSerializerFactory.java:302)
>>>>
>>>> at
>>>> com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:218)
>>>>
>>>> at
>>>> com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:153)
>>>>
>>>> at
>>>> com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:1203)
>>>>
>>>> at
>>>> com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1157)
>>>>
>>>> at
>>>> com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:481)
>>>>
>>>> at
>>>> com.fasterxml.jackson.databind.SerializerProvider.findTypedValueSerializer(SerializerProvider.java:679)
>>>>
>>>> at
>>>> com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:107)
>>>>
>>>> at
>>>> com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3559)
>>>>
>>>> at
>>>> com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:2927)
>>>>
>>>> at
>>>> io.swagger.jaxrs.listing.SwaggerSerializers.writeTo(SwaggerSerializers.java:52)
>>>>
>>>> at
>>>> org.apache.cxf.jaxrs.swagger.Swagger2Serializers.writeTo(Swagger2Serializers.java:145)
>>>>
>>>> at
>>>> org.apache.cxf.jaxrs.swagger.Swagger2Serializers.writeTo(Swagger2Serializers.java:49)
>>>>
>>>> at
>>>> org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1380)
>>>>
>>>> at
>>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:244)
>>>>
>>>
>>>
>>>
>>>
>>> On Thu, Jun 2, 2016 at 10:33 AM, Tara Czutno <ja...@gmail.com>
>>> wrote:
>>>
>>>> Okay I will try that.
>>>>
>>>> On Thu, Jun 2, 2016 at 10:32 AM, Aki Yoshida-3 [via CXF] <
>>>> ml-node+s547215n5769226h42@n5.nabble.com> wrote:
>>>>
>>>>> hi,
>>>>> those swagger2 samples included in cxf's samples include README.txt
>>>>> explaining how you can try them out.
>>>>> In short, both description_swagger2 and description_swagger2_web are
>>>>> the standalone/embedded-jetty and web-container samples and both
>>>>> deploy the swagger-ui with the sample apps. description_swagger2_osgi
>>>>> is an osgi bundle that doesn't include the swagger-ui. You can use
>>>>> swagger-ui from elsewhere (e.g., from one of the other samples or from
>>>>> a local file system).
>>>>> regards, aki
>>>>>
>>>>> 2016-06-02 11:24 GMT+02:00 Sergey Beryozkin <[hidden email]
>>>>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=0>>:
>>>>>
>>>>> > Hi
>>>>> >
>>>>> > I believe one needs to add Swagger UI, Aki Youshida added 3 Swagger 2
>>>>> demos,
>>>>> > see this directory:
>>>>> >
>>>>> >
>>>>> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs
>>>>> >
>>>>> > Can you please try one of them ?
>>>>> >
>>>>> > Actually, I've just tried
>>>>> >
>>>>> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot
>>>>> >
>>>>> > which creates a CXFServlet with a URI "/services/helloworld/*" pattern
>>>>> > and registers the feature at
>>>>> >
>>>>> https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java#L49
>>>>> >
>>>>> > and
>>>>> >
>>>>> > http://localhost:8080/services/helloservice/swagger.json
>>>>> >
>>>>> > returns JSON,
>>>>> >
>>>>> > http://localhost:8080/services/helloservice/swagger.yaml
>>>>> >
>>>>> > return Yaml.
>>>>> >
>>>>> > but I guess having UI on top of it would be good, so please Aki's
>>>>> demo's
>>>>> > (pom.xml) on how to wire Swagger UI in
>>>>> >
>>>>> > HTH, Sergey
>>>>> >
>>>>> >
>>>>> >
>>>>> > On 01/06/16 21:21, javaworkinggirl wrote:
>>>>> >>
>>>>> >> Okay I got my code to compile and run with Swagger2Feature, but I
>>>>> don't
>>>>> >> see
>>>>> >> any swagger files being generated.  Where are they supposed to be
>>>>> >> generated
>>>>> >> at?  Does Swagger2Feature log any status?
>>>>> >>
>>>>> >> <!-- CXF Swagger2Feature -->
>>>>> >> <bean id="swagger2FeatureWebServices"
>>>>> >> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>>>>> >>     <property name="basePath" value="/api"/>
>>>>> >>     <property name="contact" value="[hidden email]
>>>>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=1>"/>
>>>>> >>     <property name="description" value="xyz REST Services"/>
>>>>> >>     <property name="host" value="0.0.0.0"/>
>>>>> >>     <property name="prettyPrint" value="false"/>
>>>>> >>     <property name="resourcePackage"
>>>>> >> value="com.twc.ctg.xyz.service.rest"/>
>>>>> >>     <property name="title" value="xyz REST Services"/>
>>>>> >> </bean>
>>>>> >>
>>>>> >>
>>>>> >> <!-- Depends on activemq due to tvod vendor rest service using amqp
>>>>> to
>>>>> >> send notifications -->
>>>>> >> <!-- This endpoint scans our rest.custom directory for Providers,
>>>>> >> NameBindings etc. -->
>>>>> >> <jaxrs:server id="ecpWebServices"
>>>>> >> basePackages="com.twc.ctg.ecp.service.rest.custom"
>>>>> >> address="http://0.0.0.0:8877"
>>>>> depends-on="activeMQConnectionFactory">
>>>>> >>     <jaxrs:inInterceptors>
>>>>> >>        <ref bean="validationInInterceptor"/>
>>>>> >>     </jaxrs:inInterceptors>
>>>>> >>     <jaxrs:outInterceptors>
>>>>> >>        <ref bean="validationOutInterceptor"/>
>>>>> >>     </jaxrs:outInterceptors>
>>>>> >>     <jaxrs:serviceBeans>
>>>>> >>        <ref bean="ecpAdminRestServiceV1"/>
>>>>> >>        <ref bean="ecpApplicationRestServiceV1"/>
>>>>> >>        <ref bean="ecpEntitlementRestServiceV2"/>
>>>>> >>        <ref bean="ecpTvodRestServiceV1"/>
>>>>> >>        <ref bean="ecpHouseholdHistoryRestServiceV1"/>
>>>>> >>        <ref bean="ecpPromotionRestServiceV1"/>
>>>>> >>        <ref bean="ecpTvodPromotionServiceV1"/>
>>>>> >>        <ref bean="ecpFeatureRestServiceV1"/>
>>>>> >>        <ref bean="ecpPpvServiceV1"/>
>>>>> >>     </jaxrs:serviceBeans>
>>>>> >>     <jaxrs:providers>
>>>>> >>        <bean
>>>>> >> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>>>>> >>        <bean
>>>>> >>
>>>>> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
>>>>> >>        <ref bean="genericRestExceptionMapper"/>
>>>>> >>        <ref bean="customValidationExceptionMapper"/>
>>>>> >>     </jaxrs:providers>
>>>>> >>     <jaxrs:features>
>>>>> >>        <ref bean="swagger2FeatureWebServices" />
>>>>> >>     </jaxrs:features>
>>>>> >> </jaxrs:server>
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> On Wed, Jun 1, 2016 at 2:38 AM, Sergey Beryozkin [via CXF] <
>>>>> >> [hidden email]
>>>>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=2>> wrote:
>>>>> >>
>>>>> >>> Hi
>>>>> >>>
>>>>> >>> I'll be moving it into a dedicated module in 3.2.0-SNAPSHOT, the
>>>>> current
>>>>> >>> module has both WADL and Swagger code
>>>>> >>>
>>>>> >>> Cheers, Sergey
>>>>> >>> On 01/06/16 00:35, Benson Margulies wrote:
>>>>> >>>
>>>>> >>>> Somewhere in
>>>>> >>>>
>>>>> >>>>
>>>>> >>>> [INFO]
>>>>> >>>
>>>>> >>>   org.apache.cxf:cxf-rt-rs-service-description:jar:3.1.4:provided
>>>>> >>>>
>>>>> >>>>
>>>>> >>>>
>>>>> >>>>
>>>>> >>>>
>>>>> >>>>
>>>>> >>>> On Tue, May 31, 2016 at 7:31 PM, javaworkinggirl
>>>>> >>>> <[hidden email] <
>>>>> http:///user/SendEmail.jtp?type=node&node=5769172&i=0>>
>>>>> >>>
>>>>> >>> wrote:
>>>>> >>>>>
>>>>> >>>>> Which jar?
>>>>> >>>>>
>>>>> >>>>>
>>>>> >>>>>
>>>>> >>>>> --
>>>>> >>>>> View this message in context:
>>>>> >>>
>>>>> >>>
>>>>> >>>
>>>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769167.html
>>>>> >>>>>
>>>>> >>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>> >>>
>>>>> >>>
>>>>> >>>
>>>>> >>>
>>>>> >>> ------------------------------
>>>>> >>> If you reply to this email, your message will be added to the
>>>>> discussion
>>>>> >>> below:
>>>>> >>>
>>>>> >>>
>>>>> >>>
>>>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769172.html
>>>>> >>> To unsubscribe from Swagger2Feature jar and version, click here
>>>>> >>>
>>>>> >>> <
>>>>> >>> .
>>>>> >>> NAML
>>>>> >>>
>>>>> >>> <
>>>>> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>>>
>>>>> >>>
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >>
>>>>> >> --
>>>>> >> View this message in context:
>>>>> >>
>>>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769200.html
>>>>> >> Sent from the cxf-user mailing list archive at Nabble.com.
>>>>> >>
>>>>> >
>>>>>
>>>>>
>>>>> ------------------------------
>>>>> If you reply to this email, your message will be added to the discussion
>>>>> below:
>>>>>
>>>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769226.html
>>>>> To unsubscribe from Swagger2Feature jar and version, click here
>>>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5769165&code=amF2YXdvcmtpbmdnaXJsQGdtYWlsLmNvbXw1NzY5MTY1fC0xMTE1Njg5NTY4>
>>>>> .
>>>>> NAML
>>>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>>>
>>>>
>>>>
>>>
>>
>>
>>
>>
>> --
>> View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769237.html
>> Sent from the cxf-user mailing list archive at Nabble.com.

Re: Swagger2Feature jar and version

Posted by Aki Yoshida <el...@gmail.com>.
regarding your jackson version issue, CXF's samples should be all
running with the jackson version that are automatically picked up,
which is some 2.4.x. version.
And current swagger-core 1.5.9 itself is built with jackson 2.4.5.

So if your code is complaining about jackson version and upgrading it
to the 2.7.4 version which is not even used in swagger, it has to
something to do with your own jackson usage. Probably you had a
mixture of old and new versions and the new one was picking up some
classes from the older one and hitting the NoSuchMethodError

regards, aki


2016-06-02 20:38 GMT+02:00 javaworkinggirl <ja...@gmail.com>:
> I upgraded jackson to get the sample to work.
>
> <dependency>
>       <groupId>com.fasterxml.jackson.jaxrs</groupId>
>       <artifactId>jackson-jaxrs-json-provider</artifactId>
>       <version>2.7.4</version>
> </dependency>
>    <dependency>
>     <groupId>com.fasterxml.jackson.core</groupId>
>        <artifactId>jackson-core</artifactId>
>        <version>2.7.4</version>
>    </dependency>
>
>
> On Thu, Jun 2, 2016 at 11:09 AM, Tara Czutno <ja...@gmail.com>
> wrote:
>
>> In the description_swagger2 project I followed the Readme.txt.
>> This worked:
>>
>> mvn install
>> mvn -Pserver
>>
>>
>> But none of these links worked:
>>
>> http://localhost:9000/swagger.json
>> http://localhost:9000/swagger.yaml
>>
>> http://localhost:9000/?url=/swagger.json
>>
>> http://localhost:9000/?url=/swagger.yaml
>>
>>
>> Got:
>>
>> Can't read from server. It may not have the appropriate access-control-origin settings.
>>
>> And this was in the logs:
>>
>> Jun 02, 2016 11:05:03 AM org.apache.cxf.common.logging.LogUtils doLog
>>>
>>> WARNING: Interceptor for {http://server.swagger.jaxrs.demo/}Sample has
>>> thrown exception, unwinding now
>>>
>>> org.apache.cxf.interceptor.Fault:
>>> com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
>>>
>>> at
>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleWriteException(JAXRSOutInterceptor.java:391)
>>>
>>> at
>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:266)
>>>
>>> at
>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:120)
>>>
>>> at
>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAXRSOutInterceptor.java:83)
>>>
>>> at
>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>>>
>>> at
>>> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83)
>>>
>>> at
>>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>>>
>>> at
>>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>>>
>>> at
>>> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
>>>
>>> at
>>> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
>>>
>>> at
>>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
>>>
>>> at
>>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
>>>
>>> at
>>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
>>>
>>> at
>>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)
>>>
>>> at
>>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:223)
>>>
>>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
>>>
>>> at
>>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274)
>>>
>>> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
>>>
>>> at
>>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
>>>
>>> at
>>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)
>>>
>>> at
>>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
>>>
>>> at
>>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)
>>>
>>> at
>>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>>>
>>> at
>>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
>>>
>>> at org.eclipse.jetty.server.Server.handle(Server.java:517)
>>>
>>> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306)
>>>
>>> at
>>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
>>>
>>> at
>>> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
>>>
>>> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>>>
>>> at
>>> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
>>>
>>> at
>>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
>>>
>>> at
>>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
>>>
>>> at
>>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
>>>
>>> at
>>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
>>>
>>> at java.lang.Thread.run(Thread.java:745)
>>>
>>> Caused by: java.lang.NoSuchMethodError:
>>> com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
>>>
>>> at
>>> com.fasterxml.jackson.databind.ser.BasicSerializerFactory.findSerializerByLookup(BasicSerializerFactory.java:302)
>>>
>>> at
>>> com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:218)
>>>
>>> at
>>> com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:153)
>>>
>>> at
>>> com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:1203)
>>>
>>> at
>>> com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1157)
>>>
>>> at
>>> com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:481)
>>>
>>> at
>>> com.fasterxml.jackson.databind.SerializerProvider.findTypedValueSerializer(SerializerProvider.java:679)
>>>
>>> at
>>> com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:107)
>>>
>>> at
>>> com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3559)
>>>
>>> at
>>> com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:2927)
>>>
>>> at
>>> io.swagger.jaxrs.listing.SwaggerSerializers.writeTo(SwaggerSerializers.java:52)
>>>
>>> at
>>> org.apache.cxf.jaxrs.swagger.Swagger2Serializers.writeTo(Swagger2Serializers.java:145)
>>>
>>> at
>>> org.apache.cxf.jaxrs.swagger.Swagger2Serializers.writeTo(Swagger2Serializers.java:49)
>>>
>>> at
>>> org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1380)
>>>
>>> at
>>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:244)
>>>
>>
>>
>>
>>
>> On Thu, Jun 2, 2016 at 10:33 AM, Tara Czutno <ja...@gmail.com>
>> wrote:
>>
>>> Okay I will try that.
>>>
>>> On Thu, Jun 2, 2016 at 10:32 AM, Aki Yoshida-3 [via CXF] <
>>> ml-node+s547215n5769226h42@n5.nabble.com> wrote:
>>>
>>>> hi,
>>>> those swagger2 samples included in cxf's samples include README.txt
>>>> explaining how you can try them out.
>>>> In short, both description_swagger2 and description_swagger2_web are
>>>> the standalone/embedded-jetty and web-container samples and both
>>>> deploy the swagger-ui with the sample apps. description_swagger2_osgi
>>>> is an osgi bundle that doesn't include the swagger-ui. You can use
>>>> swagger-ui from elsewhere (e.g., from one of the other samples or from
>>>> a local file system).
>>>> regards, aki
>>>>
>>>> 2016-06-02 11:24 GMT+02:00 Sergey Beryozkin <[hidden email]
>>>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=0>>:
>>>>
>>>> > Hi
>>>> >
>>>> > I believe one needs to add Swagger UI, Aki Youshida added 3 Swagger 2
>>>> demos,
>>>> > see this directory:
>>>> >
>>>> >
>>>> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs
>>>> >
>>>> > Can you please try one of them ?
>>>> >
>>>> > Actually, I've just tried
>>>> >
>>>> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot
>>>> >
>>>> > which creates a CXFServlet with a URI "/services/helloworld/*" pattern
>>>> > and registers the feature at
>>>> >
>>>> https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java#L49
>>>> >
>>>> > and
>>>> >
>>>> > http://localhost:8080/services/helloservice/swagger.json
>>>> >
>>>> > returns JSON,
>>>> >
>>>> > http://localhost:8080/services/helloservice/swagger.yaml
>>>> >
>>>> > return Yaml.
>>>> >
>>>> > but I guess having UI on top of it would be good, so please Aki's
>>>> demo's
>>>> > (pom.xml) on how to wire Swagger UI in
>>>> >
>>>> > HTH, Sergey
>>>> >
>>>> >
>>>> >
>>>> > On 01/06/16 21:21, javaworkinggirl wrote:
>>>> >>
>>>> >> Okay I got my code to compile and run with Swagger2Feature, but I
>>>> don't
>>>> >> see
>>>> >> any swagger files being generated.  Where are they supposed to be
>>>> >> generated
>>>> >> at?  Does Swagger2Feature log any status?
>>>> >>
>>>> >> <!-- CXF Swagger2Feature -->
>>>> >> <bean id="swagger2FeatureWebServices"
>>>> >> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>>>> >>     <property name="basePath" value="/api"/>
>>>> >>     <property name="contact" value="[hidden email]
>>>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=1>"/>
>>>> >>     <property name="description" value="xyz REST Services"/>
>>>> >>     <property name="host" value="0.0.0.0"/>
>>>> >>     <property name="prettyPrint" value="false"/>
>>>> >>     <property name="resourcePackage"
>>>> >> value="com.twc.ctg.xyz.service.rest"/>
>>>> >>     <property name="title" value="xyz REST Services"/>
>>>> >> </bean>
>>>> >>
>>>> >>
>>>> >> <!-- Depends on activemq due to tvod vendor rest service using amqp
>>>> to
>>>> >> send notifications -->
>>>> >> <!-- This endpoint scans our rest.custom directory for Providers,
>>>> >> NameBindings etc. -->
>>>> >> <jaxrs:server id="ecpWebServices"
>>>> >> basePackages="com.twc.ctg.ecp.service.rest.custom"
>>>> >> address="http://0.0.0.0:8877"
>>>> depends-on="activeMQConnectionFactory">
>>>> >>     <jaxrs:inInterceptors>
>>>> >>        <ref bean="validationInInterceptor"/>
>>>> >>     </jaxrs:inInterceptors>
>>>> >>     <jaxrs:outInterceptors>
>>>> >>        <ref bean="validationOutInterceptor"/>
>>>> >>     </jaxrs:outInterceptors>
>>>> >>     <jaxrs:serviceBeans>
>>>> >>        <ref bean="ecpAdminRestServiceV1"/>
>>>> >>        <ref bean="ecpApplicationRestServiceV1"/>
>>>> >>        <ref bean="ecpEntitlementRestServiceV2"/>
>>>> >>        <ref bean="ecpTvodRestServiceV1"/>
>>>> >>        <ref bean="ecpHouseholdHistoryRestServiceV1"/>
>>>> >>        <ref bean="ecpPromotionRestServiceV1"/>
>>>> >>        <ref bean="ecpTvodPromotionServiceV1"/>
>>>> >>        <ref bean="ecpFeatureRestServiceV1"/>
>>>> >>        <ref bean="ecpPpvServiceV1"/>
>>>> >>     </jaxrs:serviceBeans>
>>>> >>     <jaxrs:providers>
>>>> >>        <bean
>>>> >> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>>>> >>        <bean
>>>> >>
>>>> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
>>>> >>        <ref bean="genericRestExceptionMapper"/>
>>>> >>        <ref bean="customValidationExceptionMapper"/>
>>>> >>     </jaxrs:providers>
>>>> >>     <jaxrs:features>
>>>> >>        <ref bean="swagger2FeatureWebServices" />
>>>> >>     </jaxrs:features>
>>>> >> </jaxrs:server>
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >> On Wed, Jun 1, 2016 at 2:38 AM, Sergey Beryozkin [via CXF] <
>>>> >> [hidden email]
>>>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=2>> wrote:
>>>> >>
>>>> >>> Hi
>>>> >>>
>>>> >>> I'll be moving it into a dedicated module in 3.2.0-SNAPSHOT, the
>>>> current
>>>> >>> module has both WADL and Swagger code
>>>> >>>
>>>> >>> Cheers, Sergey
>>>> >>> On 01/06/16 00:35, Benson Margulies wrote:
>>>> >>>
>>>> >>>> Somewhere in
>>>> >>>>
>>>> >>>>
>>>> >>>> [INFO]
>>>> >>>
>>>> >>>   org.apache.cxf:cxf-rt-rs-service-description:jar:3.1.4:provided
>>>> >>>>
>>>> >>>>
>>>> >>>>
>>>> >>>>
>>>> >>>>
>>>> >>>>
>>>> >>>> On Tue, May 31, 2016 at 7:31 PM, javaworkinggirl
>>>> >>>> <[hidden email] <
>>>> http:///user/SendEmail.jtp?type=node&node=5769172&i=0>>
>>>> >>>
>>>> >>> wrote:
>>>> >>>>>
>>>> >>>>> Which jar?
>>>> >>>>>
>>>> >>>>>
>>>> >>>>>
>>>> >>>>> --
>>>> >>>>> View this message in context:
>>>> >>>
>>>> >>>
>>>> >>>
>>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769167.html
>>>> >>>>>
>>>> >>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>>
>>>> >>> ------------------------------
>>>> >>> If you reply to this email, your message will be added to the
>>>> discussion
>>>> >>> below:
>>>> >>>
>>>> >>>
>>>> >>>
>>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769172.html
>>>> >>> To unsubscribe from Swagger2Feature jar and version, click here
>>>> >>>
>>>> >>> <
>>>> >>> .
>>>> >>> NAML
>>>> >>>
>>>> >>> <
>>>> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>>
>>>> >>>
>>>> >>
>>>> >>
>>>> >>
>>>> >>
>>>> >> --
>>>> >> View this message in context:
>>>> >>
>>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769200.html
>>>> >> Sent from the cxf-user mailing list archive at Nabble.com.
>>>> >>
>>>> >
>>>>
>>>>
>>>> ------------------------------
>>>> If you reply to this email, your message will be added to the discussion
>>>> below:
>>>>
>>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769226.html
>>>> To unsubscribe from Swagger2Feature jar and version, click here
>>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5769165&code=amF2YXdvcmtpbmdnaXJsQGdtYWlsLmNvbXw1NzY5MTY1fC0xMTE1Njg5NTY4>
>>>> .
>>>> NAML
>>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>>
>>>
>>>
>>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769237.html
> Sent from the cxf-user mailing list archive at Nabble.com.

Re: Swagger2Feature jar and version

Posted by javaworkinggirl <ja...@gmail.com>.
I upgraded jackson to get the sample to work.

<dependency>
      <groupId>com.fasterxml.jackson.jaxrs</groupId>
      <artifactId>jackson-jaxrs-json-provider</artifactId>
      <version>2.7.4</version>
</dependency>
   <dependency>
    <groupId>com.fasterxml.jackson.core</groupId>
       <artifactId>jackson-core</artifactId>
       <version>2.7.4</version>
   </dependency>


On Thu, Jun 2, 2016 at 11:09 AM, Tara Czutno <ja...@gmail.com>
wrote:

> In the description_swagger2 project I followed the Readme.txt.
> This worked:
>
> mvn install
> mvn -Pserver
>
>
> But none of these links worked:
>
> http://localhost:9000/swagger.json
> http://localhost:9000/swagger.yaml
>
> http://localhost:9000/?url=/swagger.json
>
> http://localhost:9000/?url=/swagger.yaml
>
>
> Got:
>
> Can't read from server. It may not have the appropriate access-control-origin settings.
>
> And this was in the logs:
>
> Jun 02, 2016 11:05:03 AM org.apache.cxf.common.logging.LogUtils doLog
>>
>> WARNING: Interceptor for {http://server.swagger.jaxrs.demo/}Sample has
>> thrown exception, unwinding now
>>
>> org.apache.cxf.interceptor.Fault:
>> com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
>>
>> at
>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleWriteException(JAXRSOutInterceptor.java:391)
>>
>> at
>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:266)
>>
>> at
>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:120)
>>
>> at
>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAXRSOutInterceptor.java:83)
>>
>> at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>>
>> at
>> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83)
>>
>> at
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>>
>> at
>> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>>
>> at
>> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
>>
>> at
>> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
>>
>> at
>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
>>
>> at
>> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
>>
>> at
>> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
>>
>> at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)
>>
>> at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:223)
>>
>> at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
>>
>> at
>> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274)
>>
>> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
>>
>> at
>> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
>>
>> at
>> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)
>>
>> at
>> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
>>
>> at
>> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)
>>
>> at
>> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>>
>> at
>> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
>>
>> at org.eclipse.jetty.server.Server.handle(Server.java:517)
>>
>> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306)
>>
>> at
>> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
>>
>> at
>> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
>>
>> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>>
>> at
>> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
>>
>> at
>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
>>
>> at
>> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
>>
>> at
>> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
>>
>> at
>> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
>>
>> at java.lang.Thread.run(Thread.java:745)
>>
>> Caused by: java.lang.NoSuchMethodError:
>> com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
>>
>> at
>> com.fasterxml.jackson.databind.ser.BasicSerializerFactory.findSerializerByLookup(BasicSerializerFactory.java:302)
>>
>> at
>> com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:218)
>>
>> at
>> com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:153)
>>
>> at
>> com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:1203)
>>
>> at
>> com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1157)
>>
>> at
>> com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:481)
>>
>> at
>> com.fasterxml.jackson.databind.SerializerProvider.findTypedValueSerializer(SerializerProvider.java:679)
>>
>> at
>> com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:107)
>>
>> at
>> com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3559)
>>
>> at
>> com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:2927)
>>
>> at
>> io.swagger.jaxrs.listing.SwaggerSerializers.writeTo(SwaggerSerializers.java:52)
>>
>> at
>> org.apache.cxf.jaxrs.swagger.Swagger2Serializers.writeTo(Swagger2Serializers.java:145)
>>
>> at
>> org.apache.cxf.jaxrs.swagger.Swagger2Serializers.writeTo(Swagger2Serializers.java:49)
>>
>> at
>> org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1380)
>>
>> at
>> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:244)
>>
>
>
>
>
> On Thu, Jun 2, 2016 at 10:33 AM, Tara Czutno <ja...@gmail.com>
> wrote:
>
>> Okay I will try that.
>>
>> On Thu, Jun 2, 2016 at 10:32 AM, Aki Yoshida-3 [via CXF] <
>> ml-node+s547215n5769226h42@n5.nabble.com> wrote:
>>
>>> hi,
>>> those swagger2 samples included in cxf's samples include README.txt
>>> explaining how you can try them out.
>>> In short, both description_swagger2 and description_swagger2_web are
>>> the standalone/embedded-jetty and web-container samples and both
>>> deploy the swagger-ui with the sample apps. description_swagger2_osgi
>>> is an osgi bundle that doesn't include the swagger-ui. You can use
>>> swagger-ui from elsewhere (e.g., from one of the other samples or from
>>> a local file system).
>>> regards, aki
>>>
>>> 2016-06-02 11:24 GMT+02:00 Sergey Beryozkin <[hidden email]
>>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=0>>:
>>>
>>> > Hi
>>> >
>>> > I believe one needs to add Swagger UI, Aki Youshida added 3 Swagger 2
>>> demos,
>>> > see this directory:
>>> >
>>> >
>>> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs
>>> >
>>> > Can you please try one of them ?
>>> >
>>> > Actually, I've just tried
>>> >
>>> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot
>>> >
>>> > which creates a CXFServlet with a URI "/services/helloworld/*" pattern
>>> > and registers the feature at
>>> >
>>> https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java#L49
>>> >
>>> > and
>>> >
>>> > http://localhost:8080/services/helloservice/swagger.json
>>> >
>>> > returns JSON,
>>> >
>>> > http://localhost:8080/services/helloservice/swagger.yaml
>>> >
>>> > return Yaml.
>>> >
>>> > but I guess having UI on top of it would be good, so please Aki's
>>> demo's
>>> > (pom.xml) on how to wire Swagger UI in
>>> >
>>> > HTH, Sergey
>>> >
>>> >
>>> >
>>> > On 01/06/16 21:21, javaworkinggirl wrote:
>>> >>
>>> >> Okay I got my code to compile and run with Swagger2Feature, but I
>>> don't
>>> >> see
>>> >> any swagger files being generated.  Where are they supposed to be
>>> >> generated
>>> >> at?  Does Swagger2Feature log any status?
>>> >>
>>> >> <!-- CXF Swagger2Feature -->
>>> >> <bean id="swagger2FeatureWebServices"
>>> >> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>>> >>     <property name="basePath" value="/api"/>
>>> >>     <property name="contact" value="[hidden email]
>>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=1>"/>
>>> >>     <property name="description" value="xyz REST Services"/>
>>> >>     <property name="host" value="0.0.0.0"/>
>>> >>     <property name="prettyPrint" value="false"/>
>>> >>     <property name="resourcePackage"
>>> >> value="com.twc.ctg.xyz.service.rest"/>
>>> >>     <property name="title" value="xyz REST Services"/>
>>> >> </bean>
>>> >>
>>> >>
>>> >> <!-- Depends on activemq due to tvod vendor rest service using amqp
>>> to
>>> >> send notifications -->
>>> >> <!-- This endpoint scans our rest.custom directory for Providers,
>>> >> NameBindings etc. -->
>>> >> <jaxrs:server id="ecpWebServices"
>>> >> basePackages="com.twc.ctg.ecp.service.rest.custom"
>>> >> address="http://0.0.0.0:8877"
>>> depends-on="activeMQConnectionFactory">
>>> >>     <jaxrs:inInterceptors>
>>> >>        <ref bean="validationInInterceptor"/>
>>> >>     </jaxrs:inInterceptors>
>>> >>     <jaxrs:outInterceptors>
>>> >>        <ref bean="validationOutInterceptor"/>
>>> >>     </jaxrs:outInterceptors>
>>> >>     <jaxrs:serviceBeans>
>>> >>        <ref bean="ecpAdminRestServiceV1"/>
>>> >>        <ref bean="ecpApplicationRestServiceV1"/>
>>> >>        <ref bean="ecpEntitlementRestServiceV2"/>
>>> >>        <ref bean="ecpTvodRestServiceV1"/>
>>> >>        <ref bean="ecpHouseholdHistoryRestServiceV1"/>
>>> >>        <ref bean="ecpPromotionRestServiceV1"/>
>>> >>        <ref bean="ecpTvodPromotionServiceV1"/>
>>> >>        <ref bean="ecpFeatureRestServiceV1"/>
>>> >>        <ref bean="ecpPpvServiceV1"/>
>>> >>     </jaxrs:serviceBeans>
>>> >>     <jaxrs:providers>
>>> >>        <bean
>>> >> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>>> >>        <bean
>>> >>
>>> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
>>> >>        <ref bean="genericRestExceptionMapper"/>
>>> >>        <ref bean="customValidationExceptionMapper"/>
>>> >>     </jaxrs:providers>
>>> >>     <jaxrs:features>
>>> >>        <ref bean="swagger2FeatureWebServices" />
>>> >>     </jaxrs:features>
>>> >> </jaxrs:server>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> On Wed, Jun 1, 2016 at 2:38 AM, Sergey Beryozkin [via CXF] <
>>> >> [hidden email]
>>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=2>> wrote:
>>> >>
>>> >>> Hi
>>> >>>
>>> >>> I'll be moving it into a dedicated module in 3.2.0-SNAPSHOT, the
>>> current
>>> >>> module has both WADL and Swagger code
>>> >>>
>>> >>> Cheers, Sergey
>>> >>> On 01/06/16 00:35, Benson Margulies wrote:
>>> >>>
>>> >>>> Somewhere in
>>> >>>>
>>> >>>>
>>> >>>> [INFO]
>>> >>>
>>> >>>   org.apache.cxf:cxf-rt-rs-service-description:jar:3.1.4:provided
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>>
>>> >>>> On Tue, May 31, 2016 at 7:31 PM, javaworkinggirl
>>> >>>> <[hidden email] <
>>> http:///user/SendEmail.jtp?type=node&node=5769172&i=0>>
>>> >>>
>>> >>> wrote:
>>> >>>>>
>>> >>>>> Which jar?
>>> >>>>>
>>> >>>>>
>>> >>>>>
>>> >>>>> --
>>> >>>>> View this message in context:
>>> >>>
>>> >>>
>>> >>>
>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769167.html
>>> >>>>>
>>> >>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>> >>>
>>> >>>
>>> >>>
>>> >>>
>>> >>> ------------------------------
>>> >>> If you reply to this email, your message will be added to the
>>> discussion
>>> >>> below:
>>> >>>
>>> >>>
>>> >>>
>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769172.html
>>> >>> To unsubscribe from Swagger2Feature jar and version, click here
>>> >>>
>>> >>> <
>>> >>> .
>>> >>> NAML
>>> >>>
>>> >>> <
>>> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>
>>> >>>
>>> >>
>>> >>
>>> >>
>>> >>
>>> >> --
>>> >> View this message in context:
>>> >>
>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769200.html
>>> >> Sent from the cxf-user mailing list archive at Nabble.com.
>>> >>
>>> >
>>>
>>>
>>> ------------------------------
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769226.html
>>> To unsubscribe from Swagger2Feature jar and version, click here
>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5769165&code=amF2YXdvcmtpbmdnaXJsQGdtYWlsLmNvbXw1NzY5MTY1fC0xMTE1Njg5NTY4>
>>> .
>>> NAML
>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>
>>
>>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769237.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Swagger2Feature jar and version

Posted by javaworkinggirl <ja...@gmail.com>.
Okay I will try that.

On Thu, Jun 2, 2016 at 10:32 AM, Aki Yoshida-3 [via CXF] <
ml-node+s547215n5769226h42@n5.nabble.com> wrote:

> hi,
> those swagger2 samples included in cxf's samples include README.txt
> explaining how you can try them out.
> In short, both description_swagger2 and description_swagger2_web are
> the standalone/embedded-jetty and web-container samples and both
> deploy the swagger-ui with the sample apps. description_swagger2_osgi
> is an osgi bundle that doesn't include the swagger-ui. You can use
> swagger-ui from elsewhere (e.g., from one of the other samples or from
> a local file system).
> regards, aki
>
> 2016-06-02 11:24 GMT+02:00 Sergey Beryozkin <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5769226&i=0>>:
>
> > Hi
> >
> > I believe one needs to add Swagger UI, Aki Youshida added 3 Swagger 2
> demos,
> > see this directory:
> >
> >
> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs
> >
> > Can you please try one of them ?
> >
> > Actually, I've just tried
> >
> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot
> >
> > which creates a CXFServlet with a URI "/services/helloworld/*" pattern
> > and registers the feature at
> >
> https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java#L49
> >
> > and
> >
> > http://localhost:8080/services/helloservice/swagger.json
> >
> > returns JSON,
> >
> > http://localhost:8080/services/helloservice/swagger.yaml
> >
> > return Yaml.
> >
> > but I guess having UI on top of it would be good, so please Aki's demo's
> > (pom.xml) on how to wire Swagger UI in
> >
> > HTH, Sergey
> >
> >
> >
> > On 01/06/16 21:21, javaworkinggirl wrote:
> >>
> >> Okay I got my code to compile and run with Swagger2Feature, but I don't
> >> see
> >> any swagger files being generated.  Where are they supposed to be
> >> generated
> >> at?  Does Swagger2Feature log any status?
> >>
> >> <!-- CXF Swagger2Feature -->
> >> <bean id="swagger2FeatureWebServices"
> >> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
> >>     <property name="basePath" value="/api"/>
> >>     <property name="contact" value="[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=5769226&i=1>"/>
> >>     <property name="description" value="xyz REST Services"/>
> >>     <property name="host" value="0.0.0.0"/>
> >>     <property name="prettyPrint" value="false"/>
> >>     <property name="resourcePackage"
> >> value="com.twc.ctg.xyz.service.rest"/>
> >>     <property name="title" value="xyz REST Services"/>
> >> </bean>
> >>
> >>
> >> <!-- Depends on activemq due to tvod vendor rest service using amqp to
> >> send notifications -->
> >> <!-- This endpoint scans our rest.custom directory for Providers,
> >> NameBindings etc. -->
> >> <jaxrs:server id="ecpWebServices"
> >> basePackages="com.twc.ctg.ecp.service.rest.custom"
> >> address="http://0.0.0.0:8877" depends-on="activeMQConnectionFactory">
> >>     <jaxrs:inInterceptors>
> >>        <ref bean="validationInInterceptor"/>
> >>     </jaxrs:inInterceptors>
> >>     <jaxrs:outInterceptors>
> >>        <ref bean="validationOutInterceptor"/>
> >>     </jaxrs:outInterceptors>
> >>     <jaxrs:serviceBeans>
> >>        <ref bean="ecpAdminRestServiceV1"/>
> >>        <ref bean="ecpApplicationRestServiceV1"/>
> >>        <ref bean="ecpEntitlementRestServiceV2"/>
> >>        <ref bean="ecpTvodRestServiceV1"/>
> >>        <ref bean="ecpHouseholdHistoryRestServiceV1"/>
> >>        <ref bean="ecpPromotionRestServiceV1"/>
> >>        <ref bean="ecpTvodPromotionServiceV1"/>
> >>        <ref bean="ecpFeatureRestServiceV1"/>
> >>        <ref bean="ecpPpvServiceV1"/>
> >>     </jaxrs:serviceBeans>
> >>     <jaxrs:providers>
> >>        <bean
> >> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
> >>        <bean
> >>
> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
> >>        <ref bean="genericRestExceptionMapper"/>
> >>        <ref bean="customValidationExceptionMapper"/>
> >>     </jaxrs:providers>
> >>     <jaxrs:features>
> >>        <ref bean="swagger2FeatureWebServices" />
> >>     </jaxrs:features>
> >> </jaxrs:server>
> >>
> >>
> >>
> >>
> >> On Wed, Jun 1, 2016 at 2:38 AM, Sergey Beryozkin [via CXF] <
> >> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5769226&i=2>>
> wrote:
> >>
> >>> Hi
> >>>
> >>> I'll be moving it into a dedicated module in 3.2.0-SNAPSHOT, the
> current
> >>> module has both WADL and Swagger code
> >>>
> >>> Cheers, Sergey
> >>> On 01/06/16 00:35, Benson Margulies wrote:
> >>>
> >>>> Somewhere in
> >>>>
> >>>>
> >>>> [INFO]
> >>>
> >>>   org.apache.cxf:cxf-rt-rs-service-description:jar:3.1.4:provided
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> On Tue, May 31, 2016 at 7:31 PM, javaworkinggirl
> >>>> <[hidden email] <
> http:///user/SendEmail.jtp?type=node&node=5769172&i=0>>
> >>>
> >>> wrote:
> >>>>>
> >>>>> Which jar?
> >>>>>
> >>>>>
> >>>>>
> >>>>> --
> >>>>> View this message in context:
> >>>
> >>>
> >>>
> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769167.html
> >>>>>
> >>>>> Sent from the cxf-user mailing list archive at Nabble.com.
> >>>
> >>>
> >>>
> >>>
> >>> ------------------------------
> >>> If you reply to this email, your message will be added to the
> discussion
> >>> below:
> >>>
> >>>
> >>>
> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769172.html
> >>> To unsubscribe from Swagger2Feature jar and version, click here
> >>>
> >>> <
> >>> .
> >>> NAML
> >>>
> >>> <
> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>
> >>>
> >>
> >>
> >>
> >>
> >> --
> >> View this message in context:
> >>
> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769200.html
> >> Sent from the cxf-user mailing list archive at Nabble.com.
> >>
> >
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769226.html
> To unsubscribe from Swagger2Feature jar and version, click here
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5769165&code=amF2YXdvcmtpbmdnaXJsQGdtYWlsLmNvbXw1NzY5MTY1fC0xMTE1Njg5NTY4>
> .
> NAML
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769227.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Swagger2Feature jar and version

Posted by javaworkinggirl <ja...@gmail.com>.
In the description_swagger2 project I followed the Readme.txt.
This worked:

mvn install
mvn -Pserver


But none of these links worked:

http://localhost:9000/swagger.json
http://localhost:9000/swagger.yaml

http://localhost:9000/?url=/swagger.json

http://localhost:9000/?url=/swagger.yaml


Got:

Can't read from server. It may not have the appropriate
access-control-origin settings.

And this was in the logs:

Jun 02, 2016 11:05:03 AM org.apache.cxf.common.logging.LogUtils doLog
>
> WARNING: Interceptor for {http://server.swagger.jaxrs.demo/}Sample has
> thrown exception, unwinding now
>
> org.apache.cxf.interceptor.Fault:
> com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
>
> at
> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleWriteException(JAXRSOutInterceptor.java:391)
>
> at
> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:266)
>
> at
> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.processResponse(JAXRSOutInterceptor.java:120)
>
> at
> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.handleMessage(JAXRSOutInterceptor.java:83)
>
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>
> at
> org.apache.cxf.interceptor.OutgoingChainInterceptor.handleMessage(OutgoingChainInterceptor.java:83)
>
> at
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:308)
>
> at
> org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
>
> at
> org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:254)
>
> at
> org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
>
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
>
> at
> org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
>
> at
> org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:180)
>
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:299)
>
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:223)
>
> at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
>
> at
> org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:274)
>
> at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:821)
>
> at
> org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
>
> at
> org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1158)
>
> at
> org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:511)
>
> at
> org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1090)
>
> at
> org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
>
> at
> org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:119)
>
> at org.eclipse.jetty.server.Server.handle(Server.java:517)
>
> at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:306)
>
> at
> org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:242)
>
> at
> org.eclipse.jetty.io.AbstractConnection$ReadCallback.succeeded(AbstractConnection.java:261)
>
> at org.eclipse.jetty.io.FillInterest.fillable(FillInterest.java:95)
>
> at
> org.eclipse.jetty.io.SelectChannelEndPoint$2.run(SelectChannelEndPoint.java:75)
>
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.produceAndRun(ExecuteProduceConsume.java:213)
>
> at
> org.eclipse.jetty.util.thread.strategy.ExecuteProduceConsume.run(ExecuteProduceConsume.java:147)
>
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:654)
>
> at
> org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:572)
>
> at java.lang.Thread.run(Thread.java:745)
>
> Caused by: java.lang.NoSuchMethodError:
> com.fasterxml.jackson.databind.JavaType.isReferenceType()Z
>
> at
> com.fasterxml.jackson.databind.ser.BasicSerializerFactory.findSerializerByLookup(BasicSerializerFactory.java:302)
>
> at
> com.fasterxml.jackson.databind.ser.BeanSerializerFactory._createSerializer2(BeanSerializerFactory.java:218)
>
> at
> com.fasterxml.jackson.databind.ser.BeanSerializerFactory.createSerializer(BeanSerializerFactory.java:153)
>
> at
> com.fasterxml.jackson.databind.SerializerProvider._createUntypedSerializer(SerializerProvider.java:1203)
>
> at
> com.fasterxml.jackson.databind.SerializerProvider._createAndCacheUntypedSerializer(SerializerProvider.java:1157)
>
> at
> com.fasterxml.jackson.databind.SerializerProvider.findValueSerializer(SerializerProvider.java:481)
>
> at
> com.fasterxml.jackson.databind.SerializerProvider.findTypedValueSerializer(SerializerProvider.java:679)
>
> at
> com.fasterxml.jackson.databind.ser.DefaultSerializerProvider.serializeValue(DefaultSerializerProvider.java:107)
>
> at
> com.fasterxml.jackson.databind.ObjectMapper._configAndWriteValue(ObjectMapper.java:3559)
>
> at
> com.fasterxml.jackson.databind.ObjectMapper.writeValueAsString(ObjectMapper.java:2927)
>
> at
> io.swagger.jaxrs.listing.SwaggerSerializers.writeTo(SwaggerSerializers.java:52)
>
> at
> org.apache.cxf.jaxrs.swagger.Swagger2Serializers.writeTo(Swagger2Serializers.java:145)
>
> at
> org.apache.cxf.jaxrs.swagger.Swagger2Serializers.writeTo(Swagger2Serializers.java:49)
>
> at
> org.apache.cxf.jaxrs.utils.JAXRSUtils.writeMessageBody(JAXRSUtils.java:1380)
>
> at
> org.apache.cxf.jaxrs.interceptor.JAXRSOutInterceptor.serializeMessage(JAXRSOutInterceptor.java:244)
>




On Thu, Jun 2, 2016 at 10:33 AM, Tara Czutno <ja...@gmail.com>
wrote:

> Okay I will try that.
>
> On Thu, Jun 2, 2016 at 10:32 AM, Aki Yoshida-3 [via CXF] <
> ml-node+s547215n5769226h42@n5.nabble.com> wrote:
>
>> hi,
>> those swagger2 samples included in cxf's samples include README.txt
>> explaining how you can try them out.
>> In short, both description_swagger2 and description_swagger2_web are
>> the standalone/embedded-jetty and web-container samples and both
>> deploy the swagger-ui with the sample apps. description_swagger2_osgi
>> is an osgi bundle that doesn't include the swagger-ui. You can use
>> swagger-ui from elsewhere (e.g., from one of the other samples or from
>> a local file system).
>> regards, aki
>>
>> 2016-06-02 11:24 GMT+02:00 Sergey Beryozkin <[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=0>>:
>>
>> > Hi
>> >
>> > I believe one needs to add Swagger UI, Aki Youshida added 3 Swagger 2
>> demos,
>> > see this directory:
>> >
>> >
>> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs
>> >
>> > Can you please try one of them ?
>> >
>> > Actually, I've just tried
>> >
>> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot
>> >
>> > which creates a CXFServlet with a URI "/services/helloworld/*" pattern
>> > and registers the feature at
>> >
>> https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java#L49
>> >
>> > and
>> >
>> > http://localhost:8080/services/helloservice/swagger.json
>> >
>> > returns JSON,
>> >
>> > http://localhost:8080/services/helloservice/swagger.yaml
>> >
>> > return Yaml.
>> >
>> > but I guess having UI on top of it would be good, so please Aki's
>> demo's
>> > (pom.xml) on how to wire Swagger UI in
>> >
>> > HTH, Sergey
>> >
>> >
>> >
>> > On 01/06/16 21:21, javaworkinggirl wrote:
>> >>
>> >> Okay I got my code to compile and run with Swagger2Feature, but I
>> don't
>> >> see
>> >> any swagger files being generated.  Where are they supposed to be
>> >> generated
>> >> at?  Does Swagger2Feature log any status?
>> >>
>> >> <!-- CXF Swagger2Feature -->
>> >> <bean id="swagger2FeatureWebServices"
>> >> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>> >>     <property name="basePath" value="/api"/>
>> >>     <property name="contact" value="[hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=5769226&i=1>"/>
>> >>     <property name="description" value="xyz REST Services"/>
>> >>     <property name="host" value="0.0.0.0"/>
>> >>     <property name="prettyPrint" value="false"/>
>> >>     <property name="resourcePackage"
>> >> value="com.twc.ctg.xyz.service.rest"/>
>> >>     <property name="title" value="xyz REST Services"/>
>> >> </bean>
>> >>
>> >>
>> >> <!-- Depends on activemq due to tvod vendor rest service using amqp to
>> >> send notifications -->
>> >> <!-- This endpoint scans our rest.custom directory for Providers,
>> >> NameBindings etc. -->
>> >> <jaxrs:server id="ecpWebServices"
>> >> basePackages="com.twc.ctg.ecp.service.rest.custom"
>> >> address="http://0.0.0.0:8877" depends-on="activeMQConnectionFactory">
>> >>     <jaxrs:inInterceptors>
>> >>        <ref bean="validationInInterceptor"/>
>> >>     </jaxrs:inInterceptors>
>> >>     <jaxrs:outInterceptors>
>> >>        <ref bean="validationOutInterceptor"/>
>> >>     </jaxrs:outInterceptors>
>> >>     <jaxrs:serviceBeans>
>> >>        <ref bean="ecpAdminRestServiceV1"/>
>> >>        <ref bean="ecpApplicationRestServiceV1"/>
>> >>        <ref bean="ecpEntitlementRestServiceV2"/>
>> >>        <ref bean="ecpTvodRestServiceV1"/>
>> >>        <ref bean="ecpHouseholdHistoryRestServiceV1"/>
>> >>        <ref bean="ecpPromotionRestServiceV1"/>
>> >>        <ref bean="ecpTvodPromotionServiceV1"/>
>> >>        <ref bean="ecpFeatureRestServiceV1"/>
>> >>        <ref bean="ecpPpvServiceV1"/>
>> >>     </jaxrs:serviceBeans>
>> >>     <jaxrs:providers>
>> >>        <bean
>> >> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>> >>        <bean
>> >>
>> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
>> >>        <ref bean="genericRestExceptionMapper"/>
>> >>        <ref bean="customValidationExceptionMapper"/>
>> >>     </jaxrs:providers>
>> >>     <jaxrs:features>
>> >>        <ref bean="swagger2FeatureWebServices" />
>> >>     </jaxrs:features>
>> >> </jaxrs:server>
>> >>
>> >>
>> >>
>> >>
>> >> On Wed, Jun 1, 2016 at 2:38 AM, Sergey Beryozkin [via CXF] <
>> >> [hidden email] <http:///user/SendEmail.jtp?type=node&node=5769226&i=2>>
>> wrote:
>> >>
>> >>> Hi
>> >>>
>> >>> I'll be moving it into a dedicated module in 3.2.0-SNAPSHOT, the
>> current
>> >>> module has both WADL and Swagger code
>> >>>
>> >>> Cheers, Sergey
>> >>> On 01/06/16 00:35, Benson Margulies wrote:
>> >>>
>> >>>> Somewhere in
>> >>>>
>> >>>>
>> >>>> [INFO]
>> >>>
>> >>>   org.apache.cxf:cxf-rt-rs-service-description:jar:3.1.4:provided
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>>
>> >>>> On Tue, May 31, 2016 at 7:31 PM, javaworkinggirl
>> >>>> <[hidden email] <
>> http:///user/SendEmail.jtp?type=node&node=5769172&i=0>>
>> >>>
>> >>> wrote:
>> >>>>>
>> >>>>> Which jar?
>> >>>>>
>> >>>>>
>> >>>>>
>> >>>>> --
>> >>>>> View this message in context:
>> >>>
>> >>>
>> >>>
>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769167.html
>> >>>>>
>> >>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>> >>>
>> >>>
>> >>>
>> >>>
>> >>> ------------------------------
>> >>> If you reply to this email, your message will be added to the
>> discussion
>> >>> below:
>> >>>
>> >>>
>> >>>
>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769172.html
>> >>> To unsubscribe from Swagger2Feature jar and version, click here
>> >>>
>> >>> <
>> >>> .
>> >>> NAML
>> >>>
>> >>> <
>> http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>> >>>
>> >>
>> >>
>> >>
>> >>
>> >> --
>> >> View this message in context:
>> >>
>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769200.html
>> >> Sent from the cxf-user mailing list archive at Nabble.com.
>> >>
>> >
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769226.html
>> To unsubscribe from Swagger2Feature jar and version, click here
>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5769165&code=amF2YXdvcmtpbmdnaXJsQGdtYWlsLmNvbXw1NzY5MTY1fC0xMTE1Njg5NTY4>
>> .
>> NAML
>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769236.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Swagger2Feature jar and version

Posted by Aki Yoshida <el...@gmail.com>.
hi,
those swagger2 samples included in cxf's samples include README.txt
explaining how you can try them out.
In short, both description_swagger2 and description_swagger2_web are
the standalone/embedded-jetty and web-container samples and both
deploy the swagger-ui with the sample apps. description_swagger2_osgi
is an osgi bundle that doesn't include the swagger-ui. You can use
swagger-ui from elsewhere (e.g., from one of the other samples or from
a local file system).
regards, aki

2016-06-02 11:24 GMT+02:00 Sergey Beryozkin <sb...@gmail.com>:
> Hi
>
> I believe one needs to add Swagger UI, Aki Youshida added 3 Swagger 2 demos,
> see this directory:
>
> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs
>
> Can you please try one of them ?
>
> Actually, I've just tried
> https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot
>
> which creates a CXFServlet with a URI "/services/helloworld/*" pattern
> and registers the feature at
> https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java#L49
>
> and
>
> http://localhost:8080/services/helloservice/swagger.json
>
> returns JSON,
>
> http://localhost:8080/services/helloservice/swagger.yaml
>
> return Yaml.
>
> but I guess having UI on top of it would be good, so please Aki's demo's
> (pom.xml) on how to wire Swagger UI in
>
> HTH, Sergey
>
>
>
> On 01/06/16 21:21, javaworkinggirl wrote:
>>
>> Okay I got my code to compile and run with Swagger2Feature, but I don't
>> see
>> any swagger files being generated.  Where are they supposed to be
>> generated
>> at?  Does Swagger2Feature log any status?
>>
>> <!-- CXF Swagger2Feature -->
>> <bean id="swagger2FeatureWebServices"
>> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>>     <property name="basePath" value="/api"/>
>>     <property name="contact" value="changeme@changeme.com"/>
>>     <property name="description" value="xyz REST Services"/>
>>     <property name="host" value="0.0.0.0"/>
>>     <property name="prettyPrint" value="false"/>
>>     <property name="resourcePackage"
>> value="com.twc.ctg.xyz.service.rest"/>
>>     <property name="title" value="xyz REST Services"/>
>> </bean>
>>
>>
>> <!-- Depends on activemq due to tvod vendor rest service using amqp to
>> send notifications -->
>> <!-- This endpoint scans our rest.custom directory for Providers,
>> NameBindings etc. -->
>> <jaxrs:server id="ecpWebServices"
>> basePackages="com.twc.ctg.ecp.service.rest.custom"
>> address="http://0.0.0.0:8877" depends-on="activeMQConnectionFactory">
>>     <jaxrs:inInterceptors>
>>        <ref bean="validationInInterceptor"/>
>>     </jaxrs:inInterceptors>
>>     <jaxrs:outInterceptors>
>>        <ref bean="validationOutInterceptor"/>
>>     </jaxrs:outInterceptors>
>>     <jaxrs:serviceBeans>
>>        <ref bean="ecpAdminRestServiceV1"/>
>>        <ref bean="ecpApplicationRestServiceV1"/>
>>        <ref bean="ecpEntitlementRestServiceV2"/>
>>        <ref bean="ecpTvodRestServiceV1"/>
>>        <ref bean="ecpHouseholdHistoryRestServiceV1"/>
>>        <ref bean="ecpPromotionRestServiceV1"/>
>>        <ref bean="ecpTvodPromotionServiceV1"/>
>>        <ref bean="ecpFeatureRestServiceV1"/>
>>        <ref bean="ecpPpvServiceV1"/>
>>     </jaxrs:serviceBeans>
>>     <jaxrs:providers>
>>        <bean
>> class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>>        <bean
>> class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
>>        <ref bean="genericRestExceptionMapper"/>
>>        <ref bean="customValidationExceptionMapper"/>
>>     </jaxrs:providers>
>>     <jaxrs:features>
>>        <ref bean="swagger2FeatureWebServices" />
>>     </jaxrs:features>
>> </jaxrs:server>
>>
>>
>>
>>
>> On Wed, Jun 1, 2016 at 2:38 AM, Sergey Beryozkin [via CXF] <
>> ml-node+s547215n5769172h68@n5.nabble.com> wrote:
>>
>>> Hi
>>>
>>> I'll be moving it into a dedicated module in 3.2.0-SNAPSHOT, the current
>>> module has both WADL and Swagger code
>>>
>>> Cheers, Sergey
>>> On 01/06/16 00:35, Benson Margulies wrote:
>>>
>>>> Somewhere in
>>>>
>>>>
>>>> [INFO]
>>>
>>>   org.apache.cxf:cxf-rt-rs-service-description:jar:3.1.4:provided
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> On Tue, May 31, 2016 at 7:31 PM, javaworkinggirl
>>>> <[hidden email] <http:///user/SendEmail.jtp?type=node&node=5769172&i=0>>
>>>
>>> wrote:
>>>>>
>>>>> Which jar?
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> View this message in context:
>>>
>>>
>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769167.html
>>>>>
>>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>>
>>>
>>>
>>> ------------------------------
>>> If you reply to this email, your message will be added to the discussion
>>> below:
>>>
>>>
>>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769172.html
>>> To unsubscribe from Swagger2Feature jar and version, click here
>>>
>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5769165&code=amF2YXdvcmtpbmdnaXJsQGdtYWlsLmNvbXw1NzY5MTY1fC0xMTE1Njg5NTY4>
>>> .
>>> NAML
>>>
>>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>>
>>
>>
>>
>>
>> --
>> View this message in context:
>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769200.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>

Re: Swagger2Feature jar and version

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

I believe one needs to add Swagger UI, Aki Youshida added 3 Swagger 2 
demos, see this directory:

https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs

Can you please try one of them ?

Actually, I've just tried
https://github.com/apache/cxf/tree/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot

which creates a CXFServlet with a URI "/services/helloworld/*" pattern
and registers the feature at
https://github.com/apache/cxf/blob/master/distribution/src/main/release/samples/jax_rs/jaxrs_spring_boot/src/main/java/sample/rs/service/SampleRestApplication.java#L49

and

http://localhost:8080/services/helloservice/swagger.json

returns JSON,

http://localhost:8080/services/helloservice/swagger.yaml

return Yaml.

but I guess having UI on top of it would be good, so please Aki's demo's 
(pom.xml) on how to wire Swagger UI in

HTH, Sergey


On 01/06/16 21:21, javaworkinggirl wrote:
> Okay I got my code to compile and run with Swagger2Feature, but I don't see
> any swagger files being generated.  Where are they supposed to be generated
> at?  Does Swagger2Feature log any status?
>
> <!-- CXF Swagger2Feature -->
> <bean id="swagger2FeatureWebServices"
> class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
>     <property name="basePath" value="/api"/>
>     <property name="contact" value="changeme@changeme.com"/>
>     <property name="description" value="xyz REST Services"/>
>     <property name="host" value="0.0.0.0"/>
>     <property name="prettyPrint" value="false"/>
>     <property name="resourcePackage" value="com.twc.ctg.xyz.service.rest"/>
>     <property name="title" value="xyz REST Services"/>
> </bean>
>
>
> <!-- Depends on activemq due to tvod vendor rest service using amqp to
> send notifications -->
> <!-- This endpoint scans our rest.custom directory for Providers,
> NameBindings etc. -->
> <jaxrs:server id="ecpWebServices"
> basePackages="com.twc.ctg.ecp.service.rest.custom"
> address="http://0.0.0.0:8877" depends-on="activeMQConnectionFactory">
>     <jaxrs:inInterceptors>
>        <ref bean="validationInInterceptor"/>
>     </jaxrs:inInterceptors>
>     <jaxrs:outInterceptors>
>        <ref bean="validationOutInterceptor"/>
>     </jaxrs:outInterceptors>
>     <jaxrs:serviceBeans>
>        <ref bean="ecpAdminRestServiceV1"/>
>        <ref bean="ecpApplicationRestServiceV1"/>
>        <ref bean="ecpEntitlementRestServiceV2"/>
>        <ref bean="ecpTvodRestServiceV1"/>
>        <ref bean="ecpHouseholdHistoryRestServiceV1"/>
>        <ref bean="ecpPromotionRestServiceV1"/>
>        <ref bean="ecpTvodPromotionServiceV1"/>
>        <ref bean="ecpFeatureRestServiceV1"/>
>        <ref bean="ecpPpvServiceV1"/>
>     </jaxrs:serviceBeans>
>     <jaxrs:providers>
>        <bean class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
>        <bean class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
>        <ref bean="genericRestExceptionMapper"/>
>        <ref bean="customValidationExceptionMapper"/>
>     </jaxrs:providers>
>     <jaxrs:features>
>        <ref bean="swagger2FeatureWebServices" />
>     </jaxrs:features>
> </jaxrs:server>
>
>
>
>
> On Wed, Jun 1, 2016 at 2:38 AM, Sergey Beryozkin [via CXF] <
> ml-node+s547215n5769172h68@n5.nabble.com> wrote:
>
>> Hi
>>
>> I'll be moving it into a dedicated module in 3.2.0-SNAPSHOT, the current
>> module has both WADL and Swagger code
>>
>> Cheers, Sergey
>> On 01/06/16 00:35, Benson Margulies wrote:
>>
>>> Somewhere in
>>>
>>>
>>> [INFO]
>>   org.apache.cxf:cxf-rt-rs-service-description:jar:3.1.4:provided
>>>
>>>
>>>
>>>
>>>
>>> On Tue, May 31, 2016 at 7:31 PM, javaworkinggirl
>>> <[hidden email] <http:///user/SendEmail.jtp?type=node&node=5769172&i=0>>
>> wrote:
>>>> Which jar?
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769167.html
>>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the discussion
>> below:
>>
>> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769172.html
>> To unsubscribe from Swagger2Feature jar and version, click here
>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5769165&code=amF2YXdvcmtpbmdnaXJsQGdtYWlsLmNvbXw1NzY5MTY1fC0xMTE1Njg5NTY4>
>> .
>> NAML
>> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769200.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


Re: Swagger2Feature jar and version

Posted by javaworkinggirl <ja...@gmail.com>.
Okay I got my code to compile and run with Swagger2Feature, but I don't see
any swagger files being generated.  Where are they supposed to be generated
at?  Does Swagger2Feature log any status?

<!-- CXF Swagger2Feature -->
<bean id="swagger2FeatureWebServices"
class="org.apache.cxf.jaxrs.swagger.Swagger2Feature">
   <property name="basePath" value="/api"/>
   <property name="contact" value="changeme@changeme.com"/>
   <property name="description" value="xyz REST Services"/>
   <property name="host" value="0.0.0.0"/>
   <property name="prettyPrint" value="false"/>
   <property name="resourcePackage" value="com.twc.ctg.xyz.service.rest"/>
   <property name="title" value="xyz REST Services"/>
</bean>


<!-- Depends on activemq due to tvod vendor rest service using amqp to
send notifications -->
<!-- This endpoint scans our rest.custom directory for Providers,
NameBindings etc. -->
<jaxrs:server id="ecpWebServices"
basePackages="com.twc.ctg.ecp.service.rest.custom"
address="http://0.0.0.0:8877" depends-on="activeMQConnectionFactory">
   <jaxrs:inInterceptors>
      <ref bean="validationInInterceptor"/>
   </jaxrs:inInterceptors>
   <jaxrs:outInterceptors>
      <ref bean="validationOutInterceptor"/>
   </jaxrs:outInterceptors>
   <jaxrs:serviceBeans>
      <ref bean="ecpAdminRestServiceV1"/>
      <ref bean="ecpApplicationRestServiceV1"/>
      <ref bean="ecpEntitlementRestServiceV2"/>
      <ref bean="ecpTvodRestServiceV1"/>
      <ref bean="ecpHouseholdHistoryRestServiceV1"/>
      <ref bean="ecpPromotionRestServiceV1"/>
      <ref bean="ecpTvodPromotionServiceV1"/>
      <ref bean="ecpFeatureRestServiceV1"/>
      <ref bean="ecpPpvServiceV1"/>
   </jaxrs:serviceBeans>
   <jaxrs:providers>
      <bean class="com.fasterxml.jackson.jaxrs.json.JacksonJaxbJsonProvider"/>
      <bean class="org.apache.cxf.rs.security.cors.CrossOriginResourceSharingFilter"/>
      <ref bean="genericRestExceptionMapper"/>
      <ref bean="customValidationExceptionMapper"/>
   </jaxrs:providers>
   <jaxrs:features>
      <ref bean="swagger2FeatureWebServices" />
   </jaxrs:features>
</jaxrs:server>




On Wed, Jun 1, 2016 at 2:38 AM, Sergey Beryozkin [via CXF] <
ml-node+s547215n5769172h68@n5.nabble.com> wrote:

> Hi
>
> I'll be moving it into a dedicated module in 3.2.0-SNAPSHOT, the current
> module has both WADL and Swagger code
>
> Cheers, Sergey
> On 01/06/16 00:35, Benson Margulies wrote:
>
> > Somewhere in
> >
> >
> > [INFO]
>  org.apache.cxf:cxf-rt-rs-service-description:jar:3.1.4:provided
> >
> >
> >
> >
> >
> > On Tue, May 31, 2016 at 7:31 PM, javaworkinggirl
> > <[hidden email] <http:///user/SendEmail.jtp?type=node&node=5769172&i=0>>
> wrote:
> >> Which jar?
> >>
> >>
> >>
> >> --
> >> View this message in context:
> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769167.html
> >> Sent from the cxf-user mailing list archive at Nabble.com.
>
>
>
> ------------------------------
> If you reply to this email, your message will be added to the discussion
> below:
>
> http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769172.html
> To unsubscribe from Swagger2Feature jar and version, click here
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5769165&code=amF2YXdvcmtpbmdnaXJsQGdtYWlsLmNvbXw1NzY5MTY1fC0xMTE1Njg5NTY4>
> .
> NAML
> <http://cxf.547215.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>




--
View this message in context: http://cxf.547215.n5.nabble.com/Swagger2Feature-jar-and-version-tp5769165p5769200.html
Sent from the cxf-user mailing list archive at Nabble.com.