cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chris Wilson (JIRA)" <>
Subject [jira] Commented: (CXF-2775) CLONE -CXF http-jetty transport do not call the jetty server engine shutdown when the server stop
Date Wed, 21 Apr 2010 14:35:52 GMT


Chris Wilson commented on CXF-2775:

The comments in this thread:


say that:

Setting the property to ensure that we don't call into jetty on shutdown makes the test work,
without it the second call to doJaxwsClientServerWork() will hang and eventually timeout with
a socket read error.

which is exactly what we're seeing, and:

We tried to resolve this problem by setting the reuseAddress flage to the connector's socket.
You can find more information at []
and in CXF-1134

CXF-1134 was implemented and we don't see socket binding errors, but we do still see the "hang
and eventually timeout with a socket read error."

> CLONE -CXF http-jetty transport do not call the jetty server engine shutdown when the
server stop
> -------------------------------------------------------------------------------------------------
>                 Key: CXF-2775
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: Transports
>            Reporter: Chris Wilson
>            Assignee: Willem Jiang
>         Attachments:
> 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@]
> 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;
> 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();
>     mServer.stop();
>     // Adding these lines allows the application to exit, but
>     // 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.

View raw message