Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A935420049D for ; Wed, 9 Aug 2017 17:09:04 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A7CB616944D; Wed, 9 Aug 2017 15:09:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id EDBB8169455 for ; Wed, 9 Aug 2017 17:09:03 +0200 (CEST) Received: (qmail 87589 invoked by uid 500); 9 Aug 2017 15:09:03 -0000 Mailing-List: contact issues-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list issues@cxf.apache.org Received: (qmail 87577 invoked by uid 99); 9 Aug 2017 15:09:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Aug 2017 15:09:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 95F55C0047 for ; Wed, 9 Aug 2017 15:09:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.202 X-Spam-Level: X-Spam-Status: No, score=-99.202 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id XNPcP0DqDJCY for ; Wed, 9 Aug 2017 15:09:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 0A5C55F30C for ; Wed, 9 Aug 2017 15:09:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 5C84DE002C for ; Wed, 9 Aug 2017 15:09:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 195C023FFD for ; Wed, 9 Aug 2017 15:09:00 +0000 (UTC) Date: Wed, 9 Aug 2017 15:09:00 +0000 (UTC) From: "Carlos Sierra (JIRA)" To: issues@cxf.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (CXF-7409) ServiceConstructionException when adding JAX-RS application ruins existing applications MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 09 Aug 2017 15:09:04 -0000 [ https://issues.apache.org/jira/browse/CXF-7409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16120053#comment-16120053 ] 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: https://issues.apache.org/jira/browse/CXF-7409 > 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(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 (v6.4.14#64029)