You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Peter De Winter <pe...@mijathi.be> on 2015/10/01 14:11:51 UTC

Auto discover providers JAXRSServerFactoryBean

Hello all,

In regards to https://issues.apache.org/jira/browse/CXF-4199 

I would like to investigate auto discovery for providers and resource
endpoints.

It's kind of difficult to identify the solution which was implemented.
Is there any documentation or example to read?





--
View this message in context: http://cxf.547215.n5.nabble.com/Auto-discover-providers-JAXRSServerFactoryBean-tp5761393.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Auto discover providers JAXRSServerFactoryBean

Posted by "peter.de.winter peter.de.winter" <pe...@mijathi.be>.
Hi Sergey,

We are not using the jaxrs xsd, simple spring bean config of the jaxrsserverfactorybean.
Probably autodiscovery has to be activated differently of some sort? By linking to the 
SpringComponentScanServer.java .

I will have a look at your proposal.

Thanks!

> Op 3 okt. 2015 om 17:42 heeft Sergey Beryozkin <sb...@gmail.com> het volgende geschreven:
> 
> Please also check this code:
> 
> https://github.com/apache/cxf/blob/master/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringComponentScanServer.java
> 
> jaxrs:server option below delegates to the code used by SpringComponentScanServer, it was awhile I looked into this code but I think I'll need to invest more time into it...
> 
> Cheers, Sergey
> 
>> On 03/10/15 16:54, Sergey Beryozkin wrote:
>> Hi Peter
>> 
>> Have you tried
>> 
>> <jaxrs:server address="/someaddress"/>
>> <context:component-scan base-package="a.b.c"/>
>> 
>> ?
>> 
>> Cheers, Sergey
>>> On 02/10/15 18:43, Peter De Winter wrote:
>>> Hi Sergey,
>>> 
>>> 
>>> Thanks for the info.
>>> Could you just tell me if auto discovered providers, we are using the
>>> spring discovery method, should also automatically be registered in
>>> the jaxrsserverfactorybean? That would be expected behavior, not?
>>> 
>>> This does not seem to happen in our case. We are using cxf 3.0.4 .
>>> 
>>> The jaxrsserverfactorybean is registered as a regular spring bean
>>> (plain <bean> in xml application context ) and we still need to inject
>>> the providers into the factory’s providers property. Otherwise they do
>>> not get picked up. Same goes for resources.
>>> 
>>> There is @provider and @Component annotation on it and spring
>>> component scan picks them up correctly.
>>> 
>>> Any advice on where we should start looking?
>>> 
>>> Thanks
>>> 
>>>> Op 2 okt. 2015, om 17:47 heeft Sergey Beryozkin
>>>> <sb...@gmail.com> het volgende geschreven:
>>>> 
>>>> Hi
>>>> 
>>>> Some info is here:
>>>> 
>>>> http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-Auto-discoveryofrootresourcesandproviders
>>>> 
>>>> 
>>>> Also, the last sentence at
>>>> 
>>>> http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ServletandApplicationContainerConfiguration
>>>> 
>>>> 
>>>> needs to be expanded, Andriy Redko worked on having Application
>>>> and/or providers optionally auto-discovered without Spring (per 2.0
>>>> spec).
>>>> 
>>>> Perhaps we need to spend more time on expanding a Spring Boot section
>>>> too, given that we have a utility code support for @Bean, etc
>>>> 
>>>> Sergey
>>>> 
>>>>> On 01/10/15 14:11, Peter De Winter wrote:
>>>>> Hello all,
>>>>> 
>>>>> In regards to https://issues.apache.org/jira/browse/CXF-4199
>>>>> 
>>>>> I would like to investigate auto discovery for providers and resource
>>>>> endpoints.
>>>>> 
>>>>> It's kind of difficult to identify the solution which was implemented.
>>>>> Is there any documentation or example to read?
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> 
>>>>> --
>>>>> View this message in context:
>>>>> http://cxf.547215.n5.nabble.com/Auto-discover-providers-JAXRSServerFactoryBean-tp5761393.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: Auto discover providers JAXRSServerFactoryBean

Posted by Sergey Beryozkin <sb...@gmail.com>.
Please also check this code:

https://github.com/apache/cxf/blob/master/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/spring/SpringComponentScanServer.java

jaxrs:server option below delegates to the code used by 
SpringComponentScanServer, it was awhile I looked into this code but I 
think I'll need to invest more time into it...

Cheers, Sergey

On 03/10/15 16:54, Sergey Beryozkin wrote:
> Hi Peter
>
> Have you tried
>
> <jaxrs:server address="/someaddress"/>
> <context:component-scan base-package="a.b.c"/>
>
> ?
>
> Cheers, Sergey
> On 02/10/15 18:43, Peter De Winter wrote:
>> Hi Sergey,
>>
>>
>> Thanks for the info.
>> Could you just tell me if auto discovered providers, we are using the
>> spring discovery method, should also automatically be registered in
>> the jaxrsserverfactorybean? That would be expected behavior, not?
>>
>> This does not seem to happen in our case. We are using cxf 3.0.4 .
>>
>> The jaxrsserverfactorybean is registered as a regular spring bean
>> (plain <bean> in xml application context ) and we still need to inject
>> the providers into the factory’s providers property. Otherwise they do
>> not get picked up. Same goes for resources.
>>
>> There is @provider and @Component annotation on it and spring
>> component scan picks them up correctly.
>>
>> Any advice on where we should start looking?
>>
>> Thanks
>>
>>> Op 2 okt. 2015, om 17:47 heeft Sergey Beryozkin
>>> <sb...@gmail.com> het volgende geschreven:
>>>
>>> Hi
>>>
>>> Some info is here:
>>>
>>> http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-Auto-discoveryofrootresourcesandproviders
>>>
>>>
>>> Also, the last sentence at
>>>
>>> http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ServletandApplicationContainerConfiguration
>>>
>>>
>>> needs to be expanded, Andriy Redko worked on having Application
>>> and/or providers optionally auto-discovered without Spring (per 2.0
>>> spec).
>>>
>>> Perhaps we need to spend more time on expanding a Spring Boot section
>>> too, given that we have a utility code support for @Bean, etc
>>>
>>> Sergey
>>>
>>> On 01/10/15 14:11, Peter De Winter wrote:
>>>> Hello all,
>>>>
>>>> In regards to https://issues.apache.org/jira/browse/CXF-4199
>>>>
>>>> I would like to investigate auto discovery for providers and resource
>>>> endpoints.
>>>>
>>>> It's kind of difficult to identify the solution which was implemented.
>>>> Is there any documentation or example to read?
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> View this message in context:
>>>> http://cxf.547215.n5.nabble.com/Auto-discover-providers-JAXRSServerFactoryBean-tp5761393.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: Auto discover providers JAXRSServerFactoryBean

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

Have you tried

<jaxrs:server address="/someaddress"/>
<context:component-scan base-package="a.b.c"/>

?

Cheers, Sergey
On 02/10/15 18:43, Peter De Winter wrote:
> Hi Sergey,
>
>
> Thanks for the info.
> Could you just tell me if auto discovered providers, we are using the spring discovery method, should also automatically be registered in the jaxrsserverfactorybean? That would be expected behavior, not?
>
> This does not seem to happen in our case. We are using cxf 3.0.4 .
>
> The jaxrsserverfactorybean is registered as a regular spring bean (plain <bean> in xml application context ) and we still need to inject the providers into the factory’s providers property. Otherwise they do not get picked up. Same goes for resources.
>
> There is @provider and @Component annotation on it and spring component scan picks them up correctly.
>
> Any advice on where we should start looking?
>
> Thanks
>
>> Op 2 okt. 2015, om 17:47 heeft Sergey Beryozkin <sb...@gmail.com> het volgende geschreven:
>>
>> Hi
>>
>> Some info is here:
>>
>> http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-Auto-discoveryofrootresourcesandproviders
>>
>> Also, the last sentence at
>>
>> http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ServletandApplicationContainerConfiguration
>>
>> needs to be expanded, Andriy Redko worked on having Application and/or providers optionally auto-discovered without Spring (per 2.0 spec).
>>
>> Perhaps we need to spend more time on expanding a Spring Boot section too, given that we have a utility code support for @Bean, etc
>>
>> Sergey
>>
>> On 01/10/15 14:11, Peter De Winter wrote:
>>> Hello all,
>>>
>>> In regards to https://issues.apache.org/jira/browse/CXF-4199
>>>
>>> I would like to investigate auto discovery for providers and resource
>>> endpoints.
>>>
>>> It's kind of difficult to identify the solution which was implemented.
>>> Is there any documentation or example to read?
>>>
>>>
>>>
>>>
>>>
>>> --
>>> View this message in context: http://cxf.547215.n5.nabble.com/Auto-discover-providers-JAXRSServerFactoryBean-tp5761393.html
>>> Sent from the cxf-user mailing list archive at Nabble.com.
>>>
>>
>>
>> --
>> Sergey Beryozkin
>>
>> Talend Community Coders
>> http://coders.talend.com/
>


Re: Auto discover providers JAXRSServerFactoryBean

Posted by Peter De Winter <pe...@mijathi.be>.
Hi Sergey,


Thanks for the info.
Could you just tell me if auto discovered providers, we are using the spring discovery method, should also automatically be registered in the jaxrsserverfactorybean? That would be expected behavior, not?

This does not seem to happen in our case. We are using cxf 3.0.4 .

The jaxrsserverfactorybean is registered as a regular spring bean (plain <bean> in xml application context ) and we still need to inject the providers into the factory’s providers property. Otherwise they do not get picked up. Same goes for resources.

There is @provider and @Component annotation on it and spring component scan picks them up correctly.

Any advice on where we should start looking?

Thanks

> Op 2 okt. 2015, om 17:47 heeft Sergey Beryozkin <sb...@gmail.com> het volgende geschreven:
> 
> Hi
> 
> Some info is here:
> 
> http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-Auto-discoveryofrootresourcesandproviders
> 
> Also, the last sentence at
> 
> http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ServletandApplicationContainerConfiguration
> 
> needs to be expanded, Andriy Redko worked on having Application and/or providers optionally auto-discovered without Spring (per 2.0 spec).
> 
> Perhaps we need to spend more time on expanding a Spring Boot section too, given that we have a utility code support for @Bean, etc
> 
> Sergey
> 
> On 01/10/15 14:11, Peter De Winter wrote:
>> Hello all,
>> 
>> In regards to https://issues.apache.org/jira/browse/CXF-4199
>> 
>> I would like to investigate auto discovery for providers and resource
>> endpoints.
>> 
>> It's kind of difficult to identify the solution which was implemented.
>> Is there any documentation or example to read?
>> 
>> 
>> 
>> 
>> 
>> --
>> View this message in context: http://cxf.547215.n5.nabble.com/Auto-discover-providers-JAXRSServerFactoryBean-tp5761393.html
>> Sent from the cxf-user mailing list archive at Nabble.com.
>> 
> 
> 
> -- 
> Sergey Beryozkin
> 
> Talend Community Coders
> http://coders.talend.com/


Re: Auto discover providers JAXRSServerFactoryBean

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

Some info is here:

http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-Auto-discoveryofrootresourcesandproviders

Also, the last sentence at

http://cxf.apache.org/docs/jaxrs-services-configuration.html#JAXRSServicesConfiguration-ServletandApplicationContainerConfiguration

needs to be expanded, Andriy Redko worked on having Application and/or 
providers optionally auto-discovered without Spring (per 2.0 spec).

Perhaps we need to spend more time on expanding a Spring Boot section 
too, given that we have a utility code support for @Bean, etc

Sergey

On 01/10/15 14:11, Peter De Winter wrote:
> Hello all,
>
> In regards to https://issues.apache.org/jira/browse/CXF-4199
>
> I would like to investigate auto discovery for providers and resource
> endpoints.
>
> It's kind of difficult to identify the solution which was implemented.
> Is there any documentation or example to read?
>
>
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Auto-discover-providers-JAXRSServerFactoryBean-tp5761393.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>


-- 
Sergey Beryozkin

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