[ 
https://issues.apache.org/jira/browse/DOSGI-252?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16803076#comment-16803076
 ] 

Amichai Rothman commented on DOSGI-252:
---------------------------------------

I have a question: if BaseDistributionProvider.createBus() is changed so that 
it skips the registerServlet call if a servlet was already registered for the 
given contextRoot, it seems to work as expected (in the example above, both 
/api/service1/v1 and /api/service2/v1 work properly). However I'm not 
proficient with the rest of the architecture here... would such a change have 
any other repercussions? Is this a reasonable fix? Because if the fix is as 
simple as that, I'd be happy to provide a PR.

> Unable to export RS services with same addresses and different contexts
> -----------------------------------------------------------------------
>
>                 Key: DOSGI-252
>                 URL: https://issues.apache.org/jira/browse/DOSGI-252
>             Project: CXF Distributed OSGi
>          Issue Type: Bug
>    Affects Versions: 2.0.0
>            Reporter: Dmytro Pishchukhin
>            Priority: Major
>
> I've tried to export RS services with such urls:
> {noformat}
> http://<default_host>:<default_port>/service1/v1
> http://<default_host>:<default_port>/service2/v1
> {noformat}
> if I use only 
> {noformat}
> org.apache.cxf.rs.httpservice.context=/service1/v1
> org.apache.cxf.rs.httpservice.context=/service2/v1
> {noformat}
> I receive an exception
> {noformat}
> org.apache.cxf.service.factory.ServiceConstructionException
>       at 
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:219)
> ...
> Caused by: org.apache.cxf.service.factory.ServiceConstructionException: There 
> is an endpoint already running on /.
>       at 
> org.apache.cxf.jaxrs.JAXRSBindingFactory.addListener(JAXRSBindingFactory.java:85)
> {noformat}
> If I use 
> {noformat}
> org.apache.cxf.rs.httpservice.context=/service1
> org.apache.cxf.rs.address=/v1
> org.apache.cxf.rs.httpservice.context=/service2
> org.apache.cxf.rs.address=/v1
> {noformat}
> I receive another exception
> {noformat}
> org.apache.cxf.service.factory.ServiceConstructionException
>       at 
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:219)
> ...
> Caused by: org.apache.cxf.service.factory.ServiceConstructionException: There 
> is an endpoint already running on /v1.
>       at 
> org.apache.cxf.jaxrs.JAXRSBindingFactory.addListener(JAXRSBindingFactory.java:85)
> {noformat}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to