JAXBException when streaming XML response

2018-03-02 Thread doug-6
I'm using CXF 3.1.7 to create a JAXRS service that uses  with
no custom providers. I'm trying to send a stream of data back in the http
response using content-type application/custom+xml. The http response entity
is set to an instance of a class that implements
javax.ws.core.StreamingOutput. When requesting this resource, I get a http
500 error that states "JAXBException occured: class com.MyStreamingOutput
nor any of its super class is known to this context. 

I stepped thru CXF source code via remote debugger and see that the
JAXBElementProvider is being chosen, likely because of  content-type
application/custom+xml. If I change my http response to use  content-type
application/customXml, the BinaryDataProvider is used and the response body
is what is desired. 

However, I need to return content-type application/custom+xml. What is the
best way to configure  so that content-type
application/custom+xml can be returned using a http entity that implements
javax.ws.core.StreamingOutput? I prefer not to use JAXB as I know the XML is
valid/well-formed.




--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html


Followed wsdl_first_https but when I deploy to the server get not a valid service

2018-03-02 Thread David Wynter
I converted the wsdl_first_https sample for 3.2.2 to use my wsdl and 
implemntation classes. I got it running locally. Then when I deploy to my 
server with my keystore it gives this error


javax.xml.ws.WebServiceException: 
{https://qcbfetchdemo.creditswift.co.uk:8081/qcbfetch}QCBFetchService is not a 
valid service. Valid services are: 
{http://creditswift.co.uk/qcbfetch}QCBFetchService

But here is my Service setup


  QCBFetchImpl implementor = new QCBFetchImpl();

SpringBusFactory bf = new SpringBusFactory();
URL busFile = Server.class.getResource("/ServerContext.xml");
Bus bus = bf.createBus(busFile.toString());
BusFactory.setDefaultBus(bus);

String address = "https://qcbfetchdemo.creditswift.co.uk:8081/qcbfetch;;
Endpoint.publish(address, implementor);

Here is the annotation in the QCBFetchImpl.java

@javax.jws.WebService(
  serviceName = "QCBFetchService",
  portName = "QCBFetch",
  targetNamespace = 
"http://qcbfetchdemo.creditswift.co.uk/qcbfetch;,
  wsdlLocation = 
"https://demo.creditswift.co.uk/QCBFetch.wsdl;)

public class QCBFetchImpl implements QCBFetch {

You can see the wsdl at the above address.

Not sure what is changed relative to the localhost test I have run successfully 
that has caused this. I switched to my own certificates in this process but 
doubt I am even getting to that point.

Thx




Re: cxf + swagger (DOSGI 2.2.0 + cxf 3.2.1)

2018-03-02 Thread nino martinez wael
clean karaf 4.2 m2 with only CXF 3.2.3-SNAPSHOT

D:\apache-karaf-4.2.0.M2\bin>karaf
__ __  
   / //_/ __ _/ __/
  / ,<  / __ `/ ___/ __ `/ /_
 / /| |/ /_/ / /  / /_/ / __/
/_/ |_|\__,_/_/   \__,_/_/

  Apache Karaf (4.2.0.M2)

Hit '' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '' or type 'system:shutdown' or 'logout' to shutdown Karaf.

karaf@root()> feature:repo-add cxf 3.2.3-SNAPSHOT
Adding feature url
mvn:org.apache.cxf.karaf/apache-cxf/3.2.3-SNAPSHOT/xml/features
karaf@root()> feature:install cxf-rs-description-swagger2
karaf@root()> feature:install aries-blueprint
karaf@root()> install -s
mvn:org.apache.cxf.samples/jax_rs_description_swagger2_osgi/3.2.3-SNAPSHOT
Bundle ID: 127
Error executing command: Error installing bundles:
Unable to start bundle
mvn:org.apache.cxf.samples/jax_rs_description_swagger2_osgi/3.2.3-SNAPSHOT:
org.osgi.framework.BundleException: Uses c
nstraint violation. Unable to resolve resource
org.apache.cxf.samples.jax_rs_description_swagger2_osgi
[org.apache.cxf.samples.jax_rs_description_swa
ger2_osgi [127](R 127.0)] because it is exposed to package
'javax.annotation' from resources javax.annotation-api
[javax.annotation-api [54](R 54.0)]
and org.apache.felix.framework [org.apache.felix.framework [0](R 0)] via
two dependency chains.

Chain 1:
  org.apache.cxf.samples.jax_rs_description_swagger2_osgi
[org.apache.cxf.samples.jax_rs_description_swagger2_osgi [127](R 127.0)]
import:
(&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(version>=2.0.0)))
 |
export: osgi.wiring.package: javax.annotation
  javax.annotation-api [javax.annotation-api [54](R 54.0)]

Chain 2:
  org.apache.cxf.samples.jax_rs_description_swagger2_osgi
[org.apache.cxf.samples.jax_rs_description_swagger2_osgi [127](R 127.0)]
import:
(&(osgi.wiring.package=io.swagger.jaxrs.config)(version>=1.5.0)(!(version>=2.0.0)))
 |
export: osgi.wiring.package=io.swagger.jaxrs.config;
uses:=org.reflections.util
  io.swagger.jaxrs [io.swagger.jaxrs [51](R 51.0)]
import:
(&(osgi.wiring.package=org.reflections.util)(version>=0.9.0)(!(version>=1.0.0)))
 |
export: osgi.wiring.package=org.reflections.util; uses:=javax.annotation
  org.apache.servicemix.bundles.reflections
[org.apache.servicemix.bundles.reflections [81](R 81.0)]
import: (osgi.wiring.package=javax.annotation)
 |
export: osgi.wiring.package: javax.annotation
  org.apache.felix.framework [org.apache.felix.framework [0](R 0)]
Unresolved requirements:
[[org.apache.cxf.samples.jax_rs_description_swagger2_osgi
[127](R 127.0)] osgi.wiring.package;
(&(osgi.wiring.package=io.swagger.jaxrs.config)(version>=1.5.0)(!(version>=2.0.0)))]
karaf@root()>



























On Fri, Mar 2, 2018 at 12:04 PM, Jean-Baptiste Onofré 
wrote:

> Karaf features namespace 1.4 is supported by Karaf 4.x, not 3.x.
>
> Regards
> JB
>
> On 03/02/2018 12:02 PM, nino martinez wael wrote:
> > on a clean 3.0.8:
> >
> > Microsoft Windows [Version 6.1.7601]
> > Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
> >
> > D:\apache-karaf-3.0.8\bin>karaf
> > __ __  
> >/ //_/ __ _/ __/
> >   / ,<  / __ `/ ___/ __ `/ /_
> >  / /| |/ /_/ / /  / /_/ / __/
> > /_/ |_|\__,_/_/   \__,_/_/
> >
> >   Apache Karaf (3.0.8)
> >
> > Hit '' for a list of available commands
> > and '[cmd] --help' for help on a specific command.
> > Hit '' or type 'system:shutdown' or 'logout' to shutdown Karaf.
> >
> > karaf@root()> feature:install cxf-rs-description-swagger2
> > Error executing command: Unrecognized root element: {
> > http://karaf.apache.org/xmlns/features/v1.4.0}features
> > karaf@root()>
> >
> >
> > I will also get a clean karaf 4.2.0 m2
> >
> > On Fri, Mar 2, 2018 at 11:44 AM, Jean-Baptiste Onofré 
> > wrote:
> >
> >> It seems you are mixing swagger 1 and 2 features, can you try a refresh
> or
> >> from
> >> a clean install ?
> >>
> >> Regards
> >> JB
> >>
> >> On 03/02/2018 11:40 AM, nino martinez wael wrote:
> >>> I get this:
> >>>
> >>> karaf@root()> feature:install aries-blueprint
> >>> karaf@root()> install -s
> >>> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
> >> osgi/3.2.3-SNAPSHOT
> >>> Bundle ID: 116
> >>> Error executing command: Error installing bundles:
> >>> Unable to start bundle
> >>> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
> >> osgi/3.2.3-SNAPSHOT:
> >>> org.osgi.framework.BundleException: Uses co
> >>> nstraint violation. Unable to resolve resource
> >>> org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> >>> [org.apache.cxf.samples.jax_rs_description_swag
> >>> ger2_osgi [116](R 116.0)] because it is exposed to package
> >>> 'javax.annotation' from resources javax.annotation-api
> >>> [javax.annotation-api [54](R 54.0)]
> >>> and org.apache.felix.framework [org.apache.felix.framework 

Re: cxf + swagger (DOSGI 2.2.0 + cxf 3.2.1)

2018-03-02 Thread Jean-Baptiste Onofré
Karaf features namespace 1.4 is supported by Karaf 4.x, not 3.x.

Regards
JB

On 03/02/2018 12:02 PM, nino martinez wael wrote:
> on a clean 3.0.8:
> 
> Microsoft Windows [Version 6.1.7601]
> Copyright (c) 2009 Microsoft Corporation.  All rights reserved.
> 
> D:\apache-karaf-3.0.8\bin>karaf
> __ __  
>/ //_/ __ _/ __/
>   / ,<  / __ `/ ___/ __ `/ /_
>  / /| |/ /_/ / /  / /_/ / __/
> /_/ |_|\__,_/_/   \__,_/_/
> 
>   Apache Karaf (3.0.8)
> 
> Hit '' for a list of available commands
> and '[cmd] --help' for help on a specific command.
> Hit '' or type 'system:shutdown' or 'logout' to shutdown Karaf.
> 
> karaf@root()> feature:install cxf-rs-description-swagger2
> Error executing command: Unrecognized root element: {
> http://karaf.apache.org/xmlns/features/v1.4.0}features
> karaf@root()>
> 
> 
> I will also get a clean karaf 4.2.0 m2
> 
> On Fri, Mar 2, 2018 at 11:44 AM, Jean-Baptiste Onofré 
> wrote:
> 
>> It seems you are mixing swagger 1 and 2 features, can you try a refresh or
>> from
>> a clean install ?
>>
>> Regards
>> JB
>>
>> On 03/02/2018 11:40 AM, nino martinez wael wrote:
>>> I get this:
>>>
>>> karaf@root()> feature:install aries-blueprint
>>> karaf@root()> install -s
>>> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
>> osgi/3.2.3-SNAPSHOT
>>> Bundle ID: 116
>>> Error executing command: Error installing bundles:
>>> Unable to start bundle
>>> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
>> osgi/3.2.3-SNAPSHOT:
>>> org.osgi.framework.BundleException: Uses co
>>> nstraint violation. Unable to resolve resource
>>> org.apache.cxf.samples.jax_rs_description_swagger2_osgi
>>> [org.apache.cxf.samples.jax_rs_description_swag
>>> ger2_osgi [116](R 116.0)] because it is exposed to package
>>> 'javax.annotation' from resources javax.annotation-api
>>> [javax.annotation-api [54](R 54.0)]
>>> and org.apache.felix.framework [org.apache.felix.framework [0](R 0)] via
>>> two dependency chains.
>>>
>>> Chain 1:
>>>   org.apache.cxf.samples.jax_rs_description_swagger2_osgi
>>> [org.apache.cxf.samples.jax_rs_description_swagger2_osgi [116](R 116.0)]
>>> import:
>>> (&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(
>> version>=2.0.0)))
>>>  |
>>> export: osgi.wiring.package: javax.annotation
>>>   javax.annotation-api [javax.annotation-api [54](R 54.0)]
>>>
>>> Chain 2:
>>>   org.apache.cxf.samples.jax_rs_description_swagger2_osgi
>>> [org.apache.cxf.samples.jax_rs_description_swagger2_osgi [116](R 116.0)]
>>> import:
>>> (&(osgi.wiring.package=io.swagger.jaxrs.config)(version>
>> =1.5.0)(!(version>=2.0.0)))
>>>  |
>>> export: osgi.wiring.package=io.swagger.jaxrs.config;
>>> uses:=org.reflections.util
>>>   io.swagger.jaxrs [io.swagger.jaxrs [51](R 51.0)]
>>> import:
>>> (&(osgi.wiring.package=org.reflections.util)(version>=0.
>> 9.0)(!(version>=1.0.0)))
>>>  |
>>> export: osgi.wiring.package=org.reflections.util;
>> uses:=javax.annotation
>>>   org.apache.servicemix.bundles.reflections
>>> [org.apache.servicemix.bundles.reflections [155](R 155.0)]
>>> import: (osgi.wiring.package=javax.annotation)
>>>  |
>>> export: osgi.wiring.package: javax.annotation
>>>   org.apache.felix.framework [org.apache.felix.framework [0](R 0)]
>>> Unresolved requirements:
>>> [[org.apache.cxf.samples.jax_rs_description_swagger2_osgi
>>> [116](R 116.0)] osgi.wiring.package;
>>> (&(osgi.wiring.package=io.swagger.jaxrs.config)(version>
>> =1.5.0)(!(version>=2.0.0)))]
>>> karaf@root()>
>>>
>>>
>>> Will try a karaf 3.0.x
>>>
>>> On Fri, Mar 2, 2018 at 8:57 AM, Jean-Baptiste Onofré 
>>> wrote:
>>>
 Hi Nino,

 you have to install aries-blueprint feature.

 Actually, CXF feature repo should define this in order to have a smooth
 installation.

 I also proposed to install jackson bundles with cxfrs. I will prepare a
>> PR
 about
 that.

 Regards
 JB

 On 03/02/2018 07:43 AM, nino martinez wael wrote:
> Okay using latest karaf 4.2 m2 I get this:
>
> karaf@root()> feature:install cxf
> Error executing command: No matching features for cxf/0
> karaf@root()> feature:repo-add cxf 3.2.2
> Adding feature url mvn:org.apache.cxf.karaf/
 apache-cxf/3.2.2/xml/features
> karaf@root()> feature:install cxf-rs-description-swagger2
> karaf@root()> install -s
> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
 osgi/3.2.3-SNAPSHOT
> Bundle ID: 116
> Error executing command: Error installing bundles:
> Unable to start bundle
> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
 osgi/3.2.3-SNAPSHOT:
> org.osgi.framework.BundleException: Unable
> to resolve org.apache.cxf.samples.jax_rs_description_swagger2_osgi
 [116](R
> 116.0): missing requirement [org.apache.cxf.samples.jax_
 rs_description_swag
> ger2_osgi 

Re: cxf + swagger (DOSGI 2.2.0 + cxf 3.2.1)

2018-03-02 Thread nino martinez wael
on a clean 3.0.8:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

D:\apache-karaf-3.0.8\bin>karaf
__ __  
   / //_/ __ _/ __/
  / ,<  / __ `/ ___/ __ `/ /_
 / /| |/ /_/ / /  / /_/ / __/
/_/ |_|\__,_/_/   \__,_/_/

  Apache Karaf (3.0.8)

Hit '' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '' or type 'system:shutdown' or 'logout' to shutdown Karaf.

karaf@root()> feature:install cxf-rs-description-swagger2
Error executing command: Unrecognized root element: {
http://karaf.apache.org/xmlns/features/v1.4.0}features
karaf@root()>


I will also get a clean karaf 4.2.0 m2

On Fri, Mar 2, 2018 at 11:44 AM, Jean-Baptiste Onofré 
wrote:

> It seems you are mixing swagger 1 and 2 features, can you try a refresh or
> from
> a clean install ?
>
> Regards
> JB
>
> On 03/02/2018 11:40 AM, nino martinez wael wrote:
> > I get this:
> >
> > karaf@root()> feature:install aries-blueprint
> > karaf@root()> install -s
> > mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
> osgi/3.2.3-SNAPSHOT
> > Bundle ID: 116
> > Error executing command: Error installing bundles:
> > Unable to start bundle
> > mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
> osgi/3.2.3-SNAPSHOT:
> > org.osgi.framework.BundleException: Uses co
> > nstraint violation. Unable to resolve resource
> > org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> > [org.apache.cxf.samples.jax_rs_description_swag
> > ger2_osgi [116](R 116.0)] because it is exposed to package
> > 'javax.annotation' from resources javax.annotation-api
> > [javax.annotation-api [54](R 54.0)]
> > and org.apache.felix.framework [org.apache.felix.framework [0](R 0)] via
> > two dependency chains.
> >
> > Chain 1:
> >   org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> > [org.apache.cxf.samples.jax_rs_description_swagger2_osgi [116](R 116.0)]
> > import:
> > (&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(
> version>=2.0.0)))
> >  |
> > export: osgi.wiring.package: javax.annotation
> >   javax.annotation-api [javax.annotation-api [54](R 54.0)]
> >
> > Chain 2:
> >   org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> > [org.apache.cxf.samples.jax_rs_description_swagger2_osgi [116](R 116.0)]
> > import:
> > (&(osgi.wiring.package=io.swagger.jaxrs.config)(version>
> =1.5.0)(!(version>=2.0.0)))
> >  |
> > export: osgi.wiring.package=io.swagger.jaxrs.config;
> > uses:=org.reflections.util
> >   io.swagger.jaxrs [io.swagger.jaxrs [51](R 51.0)]
> > import:
> > (&(osgi.wiring.package=org.reflections.util)(version>=0.
> 9.0)(!(version>=1.0.0)))
> >  |
> > export: osgi.wiring.package=org.reflections.util;
> uses:=javax.annotation
> >   org.apache.servicemix.bundles.reflections
> > [org.apache.servicemix.bundles.reflections [155](R 155.0)]
> > import: (osgi.wiring.package=javax.annotation)
> >  |
> > export: osgi.wiring.package: javax.annotation
> >   org.apache.felix.framework [org.apache.felix.framework [0](R 0)]
> > Unresolved requirements:
> > [[org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> > [116](R 116.0)] osgi.wiring.package;
> > (&(osgi.wiring.package=io.swagger.jaxrs.config)(version>
> =1.5.0)(!(version>=2.0.0)))]
> > karaf@root()>
> >
> >
> > Will try a karaf 3.0.x
> >
> > On Fri, Mar 2, 2018 at 8:57 AM, Jean-Baptiste Onofré 
> > wrote:
> >
> >> Hi Nino,
> >>
> >> you have to install aries-blueprint feature.
> >>
> >> Actually, CXF feature repo should define this in order to have a smooth
> >> installation.
> >>
> >> I also proposed to install jackson bundles with cxfrs. I will prepare a
> PR
> >> about
> >> that.
> >>
> >> Regards
> >> JB
> >>
> >> On 03/02/2018 07:43 AM, nino martinez wael wrote:
> >>> Okay using latest karaf 4.2 m2 I get this:
> >>>
> >>> karaf@root()> feature:install cxf
> >>> Error executing command: No matching features for cxf/0
> >>> karaf@root()> feature:repo-add cxf 3.2.2
> >>> Adding feature url mvn:org.apache.cxf.karaf/
> >> apache-cxf/3.2.2/xml/features
> >>> karaf@root()> feature:install cxf-rs-description-swagger2
> >>> karaf@root()> install -s
> >>> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
> >> osgi/3.2.3-SNAPSHOT
> >>> Bundle ID: 116
> >>> Error executing command: Error installing bundles:
> >>> Unable to start bundle
> >>> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
> >> osgi/3.2.3-SNAPSHOT:
> >>> org.osgi.framework.BundleException: Unable
> >>> to resolve org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> >> [116](R
> >>> 116.0): missing requirement [org.apache.cxf.samples.jax_
> >> rs_description_swag
> >>> ger2_osgi [116](R 116.0)] osgi.wiring.package;
> >>> (&(osgi.wiring.package=org.osgi.service.blueprint)(
> >> version>=1.0.0)(!(version>=2.0.0)))
> >>> Unresolved requi
> >>> rements: 

Re: cxf + swagger (DOSGI 2.2.0 + cxf 3.2.1)

2018-03-02 Thread Jean-Baptiste Onofré
It seems you are mixing swagger 1 and 2 features, can you try a refresh or from
a clean install ?

Regards
JB

On 03/02/2018 11:40 AM, nino martinez wael wrote:
> I get this:
> 
> karaf@root()> feature:install aries-blueprint
> karaf@root()> install -s
> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_osgi/3.2.3-SNAPSHOT
> Bundle ID: 116
> Error executing command: Error installing bundles:
> Unable to start bundle
> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_osgi/3.2.3-SNAPSHOT:
> org.osgi.framework.BundleException: Uses co
> nstraint violation. Unable to resolve resource
> org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> [org.apache.cxf.samples.jax_rs_description_swag
> ger2_osgi [116](R 116.0)] because it is exposed to package
> 'javax.annotation' from resources javax.annotation-api
> [javax.annotation-api [54](R 54.0)]
> and org.apache.felix.framework [org.apache.felix.framework [0](R 0)] via
> two dependency chains.
> 
> Chain 1:
>   org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> [org.apache.cxf.samples.jax_rs_description_swagger2_osgi [116](R 116.0)]
> import:
> (&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(version>=2.0.0)))
>  |
> export: osgi.wiring.package: javax.annotation
>   javax.annotation-api [javax.annotation-api [54](R 54.0)]
> 
> Chain 2:
>   org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> [org.apache.cxf.samples.jax_rs_description_swagger2_osgi [116](R 116.0)]
> import:
> (&(osgi.wiring.package=io.swagger.jaxrs.config)(version>=1.5.0)(!(version>=2.0.0)))
>  |
> export: osgi.wiring.package=io.swagger.jaxrs.config;
> uses:=org.reflections.util
>   io.swagger.jaxrs [io.swagger.jaxrs [51](R 51.0)]
> import:
> (&(osgi.wiring.package=org.reflections.util)(version>=0.9.0)(!(version>=1.0.0)))
>  |
> export: osgi.wiring.package=org.reflections.util; uses:=javax.annotation
>   org.apache.servicemix.bundles.reflections
> [org.apache.servicemix.bundles.reflections [155](R 155.0)]
> import: (osgi.wiring.package=javax.annotation)
>  |
> export: osgi.wiring.package: javax.annotation
>   org.apache.felix.framework [org.apache.felix.framework [0](R 0)]
> Unresolved requirements:
> [[org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> [116](R 116.0)] osgi.wiring.package;
> (&(osgi.wiring.package=io.swagger.jaxrs.config)(version>=1.5.0)(!(version>=2.0.0)))]
> karaf@root()>
> 
> 
> Will try a karaf 3.0.x
> 
> On Fri, Mar 2, 2018 at 8:57 AM, Jean-Baptiste Onofré 
> wrote:
> 
>> Hi Nino,
>>
>> you have to install aries-blueprint feature.
>>
>> Actually, CXF feature repo should define this in order to have a smooth
>> installation.
>>
>> I also proposed to install jackson bundles with cxfrs. I will prepare a PR
>> about
>> that.
>>
>> Regards
>> JB
>>
>> On 03/02/2018 07:43 AM, nino martinez wael wrote:
>>> Okay using latest karaf 4.2 m2 I get this:
>>>
>>> karaf@root()> feature:install cxf
>>> Error executing command: No matching features for cxf/0
>>> karaf@root()> feature:repo-add cxf 3.2.2
>>> Adding feature url mvn:org.apache.cxf.karaf/
>> apache-cxf/3.2.2/xml/features
>>> karaf@root()> feature:install cxf-rs-description-swagger2
>>> karaf@root()> install -s
>>> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
>> osgi/3.2.3-SNAPSHOT
>>> Bundle ID: 116
>>> Error executing command: Error installing bundles:
>>> Unable to start bundle
>>> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
>> osgi/3.2.3-SNAPSHOT:
>>> org.osgi.framework.BundleException: Unable
>>> to resolve org.apache.cxf.samples.jax_rs_description_swagger2_osgi
>> [116](R
>>> 116.0): missing requirement [org.apache.cxf.samples.jax_
>> rs_description_swag
>>> ger2_osgi [116](R 116.0)] osgi.wiring.package;
>>> (&(osgi.wiring.package=org.osgi.service.blueprint)(
>> version>=1.0.0)(!(version>=2.0.0)))
>>> Unresolved requi
>>> rements: [[org.apache.cxf.samples.jax_rs_description_swagger2_osgi
>> [116](R
>>> 116.0)] osgi.wiring.package; (&(osgi.wiring.package=org.
>> osgi.service.bluepr
>>> int)(version>=1.0.0)(!(version>=2.0.0)))]
>>> karaf@root()> feature:install scr
>>> karaf@root()> install -s
>>> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
>> osgi/3.2.3-SNAPSHOT
>>> Bundle ID: 116
>>> Error executing command: Error installing bundles:
>>> Unable to start bundle
>>> mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
>> osgi/3.2.3-SNAPSHOT:
>>> org.osgi.framework.BundleException: Unable
>>> to resolve org.apache.cxf.samples.jax_rs_description_swagger2_osgi
>> [116](R
>>> 116.0): missing requirement [org.apache.cxf.samples.jax_
>> rs_description_swag
>>> ger2_osgi [116](R 116.0)] osgi.wiring.package;
>>> (&(osgi.wiring.package=org.osgi.service.blueprint)(
>> version>=1.0.0)(!(version>=2.0.0)))
>>> Unresolved requi
>>> rements: [[org.apache.cxf.samples.jax_rs_description_swagger2_osgi
>> [116](R
>>> 116.0)] osgi.wiring.package; (&(osgi.wiring.package=org.
>> 

Re: cxf + swagger (DOSGI 2.2.0 + cxf 3.2.1)

2018-03-02 Thread nino martinez wael
I get this:

karaf@root()> feature:install aries-blueprint
karaf@root()> install -s
mvn:org.apache.cxf.samples/jax_rs_description_swagger2_osgi/3.2.3-SNAPSHOT
Bundle ID: 116
Error executing command: Error installing bundles:
Unable to start bundle
mvn:org.apache.cxf.samples/jax_rs_description_swagger2_osgi/3.2.3-SNAPSHOT:
org.osgi.framework.BundleException: Uses co
nstraint violation. Unable to resolve resource
org.apache.cxf.samples.jax_rs_description_swagger2_osgi
[org.apache.cxf.samples.jax_rs_description_swag
ger2_osgi [116](R 116.0)] because it is exposed to package
'javax.annotation' from resources javax.annotation-api
[javax.annotation-api [54](R 54.0)]
and org.apache.felix.framework [org.apache.felix.framework [0](R 0)] via
two dependency chains.

Chain 1:
  org.apache.cxf.samples.jax_rs_description_swagger2_osgi
[org.apache.cxf.samples.jax_rs_description_swagger2_osgi [116](R 116.0)]
import:
(&(osgi.wiring.package=javax.annotation)(version>=1.2.0)(!(version>=2.0.0)))
 |
export: osgi.wiring.package: javax.annotation
  javax.annotation-api [javax.annotation-api [54](R 54.0)]

Chain 2:
  org.apache.cxf.samples.jax_rs_description_swagger2_osgi
[org.apache.cxf.samples.jax_rs_description_swagger2_osgi [116](R 116.0)]
import:
(&(osgi.wiring.package=io.swagger.jaxrs.config)(version>=1.5.0)(!(version>=2.0.0)))
 |
export: osgi.wiring.package=io.swagger.jaxrs.config;
uses:=org.reflections.util
  io.swagger.jaxrs [io.swagger.jaxrs [51](R 51.0)]
import:
(&(osgi.wiring.package=org.reflections.util)(version>=0.9.0)(!(version>=1.0.0)))
 |
export: osgi.wiring.package=org.reflections.util; uses:=javax.annotation
  org.apache.servicemix.bundles.reflections
[org.apache.servicemix.bundles.reflections [155](R 155.0)]
import: (osgi.wiring.package=javax.annotation)
 |
export: osgi.wiring.package: javax.annotation
  org.apache.felix.framework [org.apache.felix.framework [0](R 0)]
Unresolved requirements:
[[org.apache.cxf.samples.jax_rs_description_swagger2_osgi
[116](R 116.0)] osgi.wiring.package;
(&(osgi.wiring.package=io.swagger.jaxrs.config)(version>=1.5.0)(!(version>=2.0.0)))]
karaf@root()>


Will try a karaf 3.0.x

On Fri, Mar 2, 2018 at 8:57 AM, Jean-Baptiste Onofré 
wrote:

> Hi Nino,
>
> you have to install aries-blueprint feature.
>
> Actually, CXF feature repo should define this in order to have a smooth
> installation.
>
> I also proposed to install jackson bundles with cxfrs. I will prepare a PR
> about
> that.
>
> Regards
> JB
>
> On 03/02/2018 07:43 AM, nino martinez wael wrote:
> > Okay using latest karaf 4.2 m2 I get this:
> >
> > karaf@root()> feature:install cxf
> > Error executing command: No matching features for cxf/0
> > karaf@root()> feature:repo-add cxf 3.2.2
> > Adding feature url mvn:org.apache.cxf.karaf/
> apache-cxf/3.2.2/xml/features
> > karaf@root()> feature:install cxf-rs-description-swagger2
> > karaf@root()> install -s
> > mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
> osgi/3.2.3-SNAPSHOT
> > Bundle ID: 116
> > Error executing command: Error installing bundles:
> > Unable to start bundle
> > mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
> osgi/3.2.3-SNAPSHOT:
> > org.osgi.framework.BundleException: Unable
> > to resolve org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> [116](R
> > 116.0): missing requirement [org.apache.cxf.samples.jax_
> rs_description_swag
> > ger2_osgi [116](R 116.0)] osgi.wiring.package;
> > (&(osgi.wiring.package=org.osgi.service.blueprint)(
> version>=1.0.0)(!(version>=2.0.0)))
> > Unresolved requi
> > rements: [[org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> [116](R
> > 116.0)] osgi.wiring.package; (&(osgi.wiring.package=org.
> osgi.service.bluepr
> > int)(version>=1.0.0)(!(version>=2.0.0)))]
> > karaf@root()> feature:install scr
> > karaf@root()> install -s
> > mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
> osgi/3.2.3-SNAPSHOT
> > Bundle ID: 116
> > Error executing command: Error installing bundles:
> > Unable to start bundle
> > mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
> osgi/3.2.3-SNAPSHOT:
> > org.osgi.framework.BundleException: Unable
> > to resolve org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> [116](R
> > 116.0): missing requirement [org.apache.cxf.samples.jax_
> rs_description_swag
> > ger2_osgi [116](R 116.0)] osgi.wiring.package;
> > (&(osgi.wiring.package=org.osgi.service.blueprint)(
> version>=1.0.0)(!(version>=2.0.0)))
> > Unresolved requi
> > rements: [[org.apache.cxf.samples.jax_rs_description_swagger2_osgi
> [116](R
> > 116.0)] osgi.wiring.package; (&(osgi.wiring.package=org.
> osgi.service.bluepr
> > int)(version>=1.0.0)(!(version>=2.0.0)))]
> > karaf@root()> feature:install blueprint-web
> > karaf@root()> install -s
> > mvn:org.apache.cxf.samples/jax_rs_description_swagger2_
> osgi/3.2.3-SNAPSHOT
> > Bundle ID: 116
> > Error executing command: Error installing bundles:
> > 

Programmatic approach for Circuit-Breaker feature is not working

2018-03-02 Thread ranadeep.sha...@gmail.com
As per the documentation -
https://cwiki.apache.org/confluence/display/CXF20DOC/JAX-RS+Failover#JAX-RSFailover-Code.1,
I tried running the following code along with associated configurations, but
the circuit breaker mechanism is not opening up once the threshold count for
connectivity failures have exceeded. As the circuit stays closed, the
invocation attempts are still being accepted which is against expected
behaviour.
public class CustomerRestClient {private CustomerRestClientFactory
customerRestClientFactory;public List filterByFirstName(String
firstName) {List filteredCustomers = new ArrayList<>();   
CircuitBreakerFailoverFeature cbFailoverFeature = new
CircuitBreakerFailoverFeature(4, 18L);SequentialStrategy
strategy = new SequentialStrategy();   
cbFailoverFeature.setStrategy(strategy);List featureList =
new ArrayList();featureList.add(cbFailoverFeature);WebClient
client = customerRestClientFactory.getClient(featureList).path("/");   
// Call service to get all customersList customers = client.get(new
GenericType>() {});return filteredCustomers;}   
public void setCustomerRestClientFactory(CustomerRestClientFactory
customerRestClientFactory) {this.customerRestClientFactory =
customerRestClientFactory;}}public class CustomerRestClientFactory
implements InitializingBean {private List providerList;  // Value is
injected by Springprivate String serviceUrl;  // Value is injected by
Springpublic WebClient getClient(List featureList) { 
  
if (featureList == null || featureList.isEmpty()) {throw new
IllegalArgumentException("featureList is not initialized.");}   
JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean();   
bean.setAddress(serviceUrl);bean.setServiceClass(WebClient.class);  
 
bean.setProviders(providerList);bean.setFeatures(featureList);   
return bean.createWebClient();}} 
NON_NULL  
 Log containing stack traces (attached).After a lot of debugging, I came to
an understanding that the counter for connection failures never exceeds the
threshold limit because the state of the data (including the counter) is
specific to each of the WebClient objects, instantiated for each call. I
assumed that if the same instance of a WebClient is used across multiple
calls that fail, then the counter would have been updated and eventually
open the circuit. Please find attached screenshot for details 

 
app.log   .1) Is my
understanding correct?2) Kindly help with a working example, as the one
mentioned in CWIKI documentation is not working.



--
Sent from: http://cxf.547215.n5.nabble.com/cxf-user-f547216.html