Return-Path: Delivered-To: apmail-incubator-cxf-issues-archive@locus.apache.org Received: (qmail 96471 invoked from network); 7 Nov 2007 17:05:11 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Nov 2007 17:05:11 -0000 Received: (qmail 82019 invoked by uid 500); 7 Nov 2007 17:04:59 -0000 Delivered-To: apmail-incubator-cxf-issues-archive@incubator.apache.org Received: (qmail 82006 invoked by uid 500); 7 Nov 2007 17:04:59 -0000 Mailing-List: contact cxf-issues-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cxf-dev@incubator.apache.org Delivered-To: mailing list cxf-issues@incubator.apache.org Received: (qmail 81997 invoked by uid 99); 7 Nov 2007 17:04:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 09:04:59 -0800 X-ASF-Spam-Status: No, hits=-98.5 required=10.0 tests=ALL_TRUSTED,WEIRD_PORT X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO brutus.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 07 Nov 2007 17:05:11 +0000 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id C5DCE714233 for ; Wed, 7 Nov 2007 09:04:50 -0800 (PST) Message-ID: <227877.1194455090808.JavaMail.jira@brutus> Date: Wed, 7 Nov 2007 09:04:50 -0800 (PST) From: "Jonathan Gathman (JIRA)" To: cxf-issues@incubator.apache.org Subject: [jira] Commented: (CXF-865) CXF http-jetty transport do not call the jetty server engine shutdown when the server stop In-Reply-To: <19871851.1185867713385.JavaMail.jira@brutus> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org [ https://issues.apache.org/jira/browse/CXF-865?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12540804 ] Jonathan Gathman commented on CXF-865: -------------------------------------- I forgot to mention... JettyHTTPDestination doesn't call "shutdown" on it's JettyHTTPServerEngine server object, which should start the shutdown process rolling. > CXF http-jetty transport do not call the jetty server engine shutdown when the server stop > ------------------------------------------------------------------------------------------ > > Key: CXF-865 > URL: https://issues.apache.org/jira/browse/CXF-865 > Project: CXF > Issue Type: Bug > Components: Transports > Affects Versions: 2.0 > Reporter: willem Jiang > > It appears that stopping the server in CXF is not shutting down the Jetty engine, which causes my application to hang because Jetty's threads are still blocking on the server socket accept. After a shutdown, I still see Thread [btpool0-0 - Acceptor0 SelectChannelConnector@0.0.0.0:10001] (Running). > I have a simple test application pasted below that can reproduce the problem. At this point I had to add some calls to get the destination and cast it to a Jetty specific class to get things to exit. Is there a better way to do this? Is there something I'm not configuring correctly? Any help is appreciated. > > This is under Java 1.5 with CXF 2.0. Jetty is being included from the CXF libs directory. > > package org.mpilone.cxftest; > > import java.io.IOException; > import org.apache.cxf.endpoint.Server; > import org.apache.cxf.frontend.ServerFactoryBean; > > public class CxfJettyTest > { > public void doIt() > { > System.out.println("Running test method"); > } > > public static void main(String[] args) throws IOException > { > // Create an Service and Server > ServerFactoryBean serverFactory = new ServerFactoryBean(); > serverFactory.setServiceClass(CxfJettyTest.class); > serverFactory.setServiceBean(new CxfJettyTest()); > serverFactory.setAddress("http://localhost:10001/RemoteApi"); > Server mServer = serverFactory.create(); > > mServer.start(); > System.in.read(); > mServer.stop(); > > // Adding these lines allows the application to exit, but > // WARNING: EXCEPTION > // java.nio.channels.ClosedChannelException > // log statements are produced. > > // JettyHTTPDestination jettyDest = (JettyHTTPDestination) > // mServer.getDestination(); > // JettyHTTPServerEngine jettyEngine = (JettyHTTPServerEngine) > // jettyDest.getEngine(); > // jettyEngine.shutdown(); > > System.out.println("Exiting"); > } > } > If you looking into the code you will find there is a note in the JettyHTTPServerEngine's removeServant(URL url) > /* Bug in Jetty, we cannot do this. If we restart later, data goes off > * someplace unknown > if (servantCount == 0) { > try { > .... > }*/ > I just added the shutdown engine's code below the comments and tested it against the systest. There were some tests (such as ws.rm , mtom )failed. > It looks like if we shutdown the engine, when the engine start again , the engine can not get the request info again , specially the http keep alive message. > Current I can't reproduce this bug by adding the unit test which simply calls start and shutdown method the JettyHTTPServerEngine. > It may take some time to resolve this issue. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online.