You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cxf.apache.org by "Rob Li (Jira)" <ji...@apache.org> on 2022/05/17 18:26:00 UTC

[jira] [Commented] (CXF-7409) ServiceConstructionException when adding JAX-RS application ruins existing applications

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

Rob Li commented on CXF-7409:
-----------------------------

Hi [~csierra] 

I met the same issue migrating from 2.x to 3.x, could you please give me some pointers on how you work around this by "using a custom destination Factory to detect the conflict before it gets to destroy the server"? 

thanks a lot!

Rob

> ServiceConstructionException when adding JAX-RS application ruins existing applications
> ---------------------------------------------------------------------------------------
>
>                 Key: CXF-7409
>                 URL: https://issues.apache.org/jira/browse/CXF-7409
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS
>    Affects Versions: 3.1.10
>            Reporter: Carlos Sierra Andrés
>            Priority: Major
>
> 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(JAXRSBindingFactory.java:86)
>       at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:123)
>       at
> org.apache.cxf.jaxrs.JAXRSServerFactoryBean.create(JAXRSServerFactoryBean.java:206)
> ---
> 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
(v8.20.7#820007)