cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Carlos Sierra (JIRA)" <>
Subject [jira] [Commented] (CXF-7409) ServiceConstructionException when adding JAX-RS application ruins existing applications
Date Wed, 09 Aug 2017 15:09:00 GMT


Carlos Sierra commented on CXF-7409:

In our case this address is coming from a property on a OSGi service reference. 

We are avoiding it at the moment using a custom destination Factory to detect the conflict
before it gets to destroy the server. 
To be honest I did not think having several applications per servlet would be a problem. Would
you suggest we spawn a servlet for each of the applications? If you think CXF does not support
other way I will refactor and make sure there is only one application per servlet (if no other
considerations apply)

I will try and find some time to create a test for you. I need to get acquainted with your
tree. But with you comments I guess you encouraged me to change our implementation and completely
work around this problem from the root.  

> ServiceConstructionException when adding JAX-RS application ruins existing applications
> ---------------------------------------------------------------------------------------
>                 Key: CXF-7409
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.10
>            Reporter: Carlos Sierra
> if a new application conflicts with
> an existing one, an Exception:
> ---
> Caused by: org.apache.cxf.service.factory.ServiceConstructionException:
> There is an endpoint already running on /test-application.
>       at
> org.apache.cxf.jaxrs.JAXRSBindingFactory.addListener(
>       at org.apache.cxf.endpoint.ServerImpl.start(
>       at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(
> ---
> is raised, which is expected. The problem is that the already existing
> application ceases to work in the bus.
> Following [~sergeyb]'s advice I tried removing 
> {code:java}
> server.destroy()
> {code}
> from the 
> {code:java}
> catch(RuntimeException e) {}
> {code}
> block in JAXRSServerFactoryBean's create method. However there is a comment saying that
that invocation is there to prevent leaks. Also, invocations to server.destroy() in other
moments don't affect other existing applications in the bus. 

This message was sent by Atlassian JIRA

View raw message