You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cxf.apache.org by Freeman Fang <fr...@iona.com> on 2006/08/25 09:31:55 UTC

system test sometimes hang

Hi all,

When I build cxf code I checked out from apache, system test sometimes 
hang at ProxyTest

When it hang, the exception is

java.net.ConnectException: Connection refused
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native 
Method)
        at 
sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 

        at 
sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 

        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
        at 
sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1202) 

        at java.security.AccessController.doPrivileged(Native Method)
        at 
sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1196) 

        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:885) 

        at 
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
        at 
org.apache.cxf.transports.http.HTTPConduit.getResponseCode(HTTPConduit.java:315) 

        at 
org.apache.cxf.transports.http.HTTPConduit.access$200(HTTPConduit.java:44)
        at 
org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:399) 

        at 
org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.doClose(HTTPConduit.java:386) 

        at 
org.apache.cxf.messaging.AbstractCachedOutputStream.close(AbstractCachedOutputStream.java:48) 

        at 
org.apache.cxf.transports.http.HTTPConduit.close(HTTPConduit.java:196)
        at 
org.apache.cxf.interceptors.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:32) 

        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:112) 

        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:116)
        at 
org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:57) 

        at $Proxy30.sayHi(Unknown Source)
        at org.apache.cxf.jaxws.ProxyTest.testCreatePort(ProxyTest.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 

        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 

        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
   at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 

        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 

        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242) 

        at 
org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216) 

        at 
org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 

        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 

        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
Caused by: java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at 
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.Socket.connect(Socket.java:507)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:152)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
        at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:676)
        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554)
        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:936) 

        at 
sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(HttpURLConnection.java:1888) 

        at 
org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:398) 

        ... 36 more


If it pass, the expected exception should be

java.net.ConnectException: Connection refused
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
        at 
java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
        at java.net.Socket.connect(Socket.java:507)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:152)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
        at sun.net.www.http.HttpClient.New(HttpClient.java:287)
        at sun.net.www.http.HttpClient.New(HttpClient.java:299)
        at 
sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792) 

        at 
sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744) 

        at 
sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669) 

        at 
sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836) 

        at 
sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:895) 

        at 
java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
        at 
org.apache.cxf.transports.http.HTTPConduit.getResponseCode(HTTPConduit.java:315) 

        at 
org.apache.cxf.transports.http.HTTPConduit.access$200(HTTPConduit.java:44)
        at 
org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:399) 

        at 
org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.doClose(HTTPConduit.java:386) 

        at 
org.apache.cxf.messaging.AbstractCachedOutputStream.close(AbstractCachedOutputStream.java:48) 

        at 
org.apache.cxf.transports.http.HTTPConduit.close(HTTPConduit.java:196)
        at 
org.apache.cxf.interceptors.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:32) 

        at 
org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:112) 

        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:116)
        at 
org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:57) 

        at $Proxy30.sayHi(Unknown Source)
   at org.apache.cxf.jaxws.ProxyTest.testCreatePort(ProxyTest.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 

        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 

        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 

        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 

        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242) 

        at 
org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216) 

        at 
org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 

        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 

        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
java.lang.RuntimeException
        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:120)
        at 
org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:57) 

        at $Proxy30.sayHi(Unknown Source)
        at org.apache.cxf.jaxws.ProxyTest.testCreatePort(ProxyTest.java:31)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 

        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 

        at java.lang.reflect.Method.invoke(Method.java:585)
        at junit.framework.TestCase.runTest(TestCase.java:154)
        at junit.framework.TestCase.runBare(TestCase.java:127)
        at junit.framework.TestResult$1.protect(TestResult.java:106)
        at junit.framework.TestResult.runProtected(TestResult.java:124)
        at junit.framework.TestResult.run(TestResult.java:109)
        at junit.framework.TestCase.run(TestCase.java:118)
        at junit.framework.TestSuite.runTest(TestSuite.java:208)
        at junit.framework.TestSuite.run(TestSuite.java:203)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 

        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 

        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242) 

        at 
org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216) 

        at 
org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
        at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 

        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 

        at java.lang.reflect.Method.invoke(Method.java:585)
        at 
org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)


I guess the problem is caused by some previous used server listening 
port 9000 in other test was not reclaimed when  ProxyTest run, so I will 
change port ProxyTest try to connect from 9000 to 7000 as work around to 
fix this problem. Of course we should figure out the root cause to make 
sure listening port would be reclaim in time.

Thanks very much

Freeman

-- 
Freeman Fang
Software Engineer

IONA Asia Pacific Software Development Center
No.2 Floor A Unit Information Center
Zhongguancun Software Park Haidian District,
Beijing, P.R.China

Tel.: +86-10-82825151 -  ex. 551
Fax: +86-10-8282-5210
freeman.fang@iona.com
-------------------------------------------------
Making Software Work Together TM




Re: system test sometimes hang

Posted by Daniel Kulp <da...@iona.com>.
Andrea,

The system tests were set to "forkmode once" so there probably was a resource 
conflict (port in use) or something from a previous test.    I had some 
issues on my machine with the new dispatch tests failing.   I've changed the 
system tests to pertest and things seem to work better.

Dan


On Wednesday September 06 2006 8:50 am, Andrea Smyth wrote:
> I have removed the EndpointTest and Proxytest as they are superseded now
> by the ClientServerTest.
> System tests still fail though because the ProviderClientServerTest's
> server fails to start up with:
>
> java.lang.NullPointerException
>     at
> org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.setServiceClass(JaxWsS
>erviceFactoryBean.java:144) at
> org.apache.cxf.jaxws.EndpointImpl.<init>(EndpointImpl.java:71) at
> org.apache.cxf.jaxws.spi.ProviderImpl.createEndpoint(ProviderImpl.java:57)
>     at
> org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl
>.java:66) at javax.xml.ws.Endpoint.publish(Endpoint.java:156)
>     at
> org.apache.cxf.systest.provider.ProviderClientServerTest$Server.run(Provide
>rClientServerTest.java:43) at
> org.apache.cxf.testutil.common.AbstractTestServerBase.start(AbstractTestSer
>verBase.java:61) at
> org.apache.cxf.systest.provider.ProviderClientServerTest$Server.main(Provid
>erClientServerTest.java:73) server startup failed (not a log message)
> Have disabled this test for now.
>
> Andrea.
>
> Jiang Ning wrote:
> > Hi
> >
> > I went through the trunk system test and found out there some thing
> > missing about the bus.shutdown().
> > The endpoint would no be shutdown when the bus.shutdown was called.
> > When the ProxyTest run, it will attempt to connect the unshutdown
> > port. It could be the reason why the ProxyTest could be hanged.
> >
> > Cheers,
> > Willem.
> >
> > Freeman Fang wrote:
> >> Hi all,
> >>
> >> When I build cxf code I checked out from apache, system test
> >> sometimes hang at ProxyTest
> >>
> >> When it hang, the exception is
> >>
> >> java.net.ConnectException: Connection refused
> >>        at
> >> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> >>        at
> >> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorA
> >>ccessorImpl.java:39)
> >>
> >>        at
> >> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingCons
> >>tructorAccessorImpl.java:27)
> >>
> >>        at
> >> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> >>        at
> >> sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java
> >>:1202)
> >>
> >>        at java.security.AccessController.doPrivileged(Native Method)
> >>        at
> >> sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLC
> >>onnection.java:1196)
> >>
> >>        at
> >> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnec
> >>tion.java:885)
> >>
> >>        at
> >> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
> >>        at
> >> org.apache.cxf.transports.http.HTTPConduit.getResponseCode(HTTPConduit.j
> >>ava:315)
> >>
> >>        at
> >> org.apache.cxf.transports.http.HTTPConduit.access$200(HTTPConduit.java:4
> >>4)
> >>
> >>        at
> >> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.handleRes
> >>ponse(HTTPConduit.java:399)
> >>
> >>        at
> >> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.doClose(H
> >>TTPConduit.java:386)
> >>
> >>        at
> >> org.apache.cxf.messaging.AbstractCachedOutputStream.close(AbstractCached
> >>OutputStream.java:48)
> >>
> >>        at
> >> org.apache.cxf.transports.http.HTTPConduit.close(HTTPConduit.java:196)
> >>        at
> >> org.apache.cxf.interceptors.MessageSenderInterceptor.handleMessage(Messa
> >>geSenderInterceptor.java:32)
> >>
> >>        at
> >> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
> >>hain.java:112)
> >>
> >>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:116)
> >>        at
> >> org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocation
> >>Handler.java:57)
> >>
> >>        at $Proxy30.sayHi(Unknown Source)
> >>        at
> >> org.apache.cxf.jaxws.ProxyTest.testCreatePort(ProxyTest.java:31)
> >>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>        at
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> >>a:39)
> >>
> >>        at
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> >>Impl.java:25)
> >>
> >>        at java.lang.reflect.Method.invoke(Method.java:585)
> >>        at junit.framework.TestCase.runTest(TestCase.java:154)
> >>        at junit.framework.TestCase.runBare(TestCase.java:127)
> >>        at junit.framework.TestResult$1.protect(TestResult.java:106)
> >>        at junit.framework.TestResult.runProtected(TestResult.java:124)
> >>   at junit.framework.TestResult.run(TestResult.java:109)
> >>        at junit.framework.TestCase.run(TestCase.java:118)
> >>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
> >>        at junit.framework.TestSuite.run(TestSuite.java:203)
> >>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>        at
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> >>a:39)
> >>
> >>        at
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> >>Impl.java:25)
> >>
> >>        at java.lang.reflect.Method.invoke(Method.java:585)
> >>        at
> >> org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery
> >>.java:242)
> >>
> >>        at
> >> org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java
> >>:216)
> >>
> >>        at
> >> org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
> >>        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
> >>        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
> >>        at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
> >>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>        at
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> >>a:39)
> >>
> >>        at
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> >>Impl.java:25)
> >>
> >>        at java.lang.reflect.Method.invoke(Method.java:585)
> >>        at
> >> org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
> >> Caused by: java.net.ConnectException: Connection refused
> >>        at java.net.PlainSocketImpl.socketConnect(Native Method)
> >>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> >>        at
> >> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> >>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> >>        at java.net.Socket.connect(Socket.java:507)
> >>        at sun.net.NetworkClient.doConnect(NetworkClient.java:152)
> >>        at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
> >>        at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
> >>        at
> >> sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:676)
> >>        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554)
> >>        at
> >> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnec
> >>tion.java:936)
> >>
> >>        at
> >> sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(HttpURLConne
> >>ction.java:1888)
> >>
> >>        at
> >> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.handleRes
> >>ponse(HTTPConduit.java:398)
> >>
> >>        ... 36 more
> >>
> >>
> >> If it pass, the expected exception should be
> >>
> >> java.net.ConnectException: Connection refused
> >>        at java.net.PlainSocketImpl.socketConnect(Native Method)
> >>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
> >>        at
> >> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
> >>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
> >>        at java.net.Socket.connect(Socket.java:507)
> >>        at sun.net.NetworkClient.doConnect(NetworkClient.java:152)
> >>        at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
> >>        at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
> >>        at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
> >>        at sun.net.www.http.HttpClient.New(HttpClient.java:287)
> >>        at sun.net.www.http.HttpClient.New(HttpClient.java:299)
> >>        at
> >> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConn
> >>ection.java:792)
> >>
> >>        at
> >> sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnecti
> >>on.java:744)
> >>
> >>        at
> >> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.ja
> >>va:669)
> >>
> >>        at
> >> sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConne
> >>ction.java:836)
> >>
> >>        at
> >> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnec
> >>tion.java:895)
> >>
> >>        at
> >> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
> >>        at
> >> org.apache.cxf.transports.http.HTTPConduit.getResponseCode(HTTPConduit.j
> >>ava:315)
> >>
> >>        at
> >> org.apache.cxf.transports.http.HTTPConduit.access$200(HTTPConduit.java:4
> >>4)
> >>
> >>        at
> >> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.handleRes
> >>ponse(HTTPConduit.java:399)
> >>
> >>        at
> >> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.doClose(H
> >>TTPConduit.java:386)
> >>
> >>        at
> >> org.apache.cxf.messaging.AbstractCachedOutputStream.close(AbstractCached
> >>OutputStream.java:48)
> >>
> >>        at
> >> org.apache.cxf.transports.http.HTTPConduit.close(HTTPConduit.java:196)
> >>        at
> >> org.apache.cxf.interceptors.MessageSenderInterceptor.handleMessage(Messa
> >>geSenderInterceptor.java:32)
> >>
> >>        at
> >> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorC
> >>hain.java:112)
> >>
> >>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:116)
> >>        at
> >> org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocation
> >>Handler.java:57)
> >>
> >>        at $Proxy30.sayHi(Unknown Source)
> >>   at org.apache.cxf.jaxws.ProxyTest.testCreatePort(ProxyTest.java:31)
> >>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>        at
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> >>a:39)
> >>
> >>        at
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> >>Impl.java:25)
> >>
> >>        at java.lang.reflect.Method.invoke(Method.java:585)
> >>        at junit.framework.TestCase.runTest(TestCase.java:154)
> >>        at junit.framework.TestCase.runBare(TestCase.java:127)
> >>        at junit.framework.TestResult$1.protect(TestResult.java:106)
> >>        at junit.framework.TestResult.runProtected(TestResult.java:124)
> >>        at junit.framework.TestResult.run(TestResult.java:109)
> >>        at junit.framework.TestCase.run(TestCase.java:118)
> >>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
> >>        at junit.framework.TestSuite.run(TestSuite.java:203)
> >>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>        at
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> >>a:39)
> >>
> >>        at
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> >>Impl.java:25)
> >>
> >>        at java.lang.reflect.Method.invoke(Method.java:585)
> >>        at
> >> org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery
> >>.java:242)
> >>
> >>        at
> >> org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java
> >>:216)
> >>
> >>        at
> >> org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
> >>        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
> >>        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
> >>        at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
> >>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>        at
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> >>a:39)
> >>
> >>        at
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> >>Impl.java:25)
> >>
> >>        at java.lang.reflect.Method.invoke(Method.java:585)
> >>        at
> >> org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
> >> java.lang.RuntimeException
> >>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:120)
> >>        at
> >> org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocation
> >>Handler.java:57)
> >>
> >>        at $Proxy30.sayHi(Unknown Source)
> >>        at
> >> org.apache.cxf.jaxws.ProxyTest.testCreatePort(ProxyTest.java:31)
> >>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>        at
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> >>a:39)
> >>
> >>        at
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> >>Impl.java:25)
> >>
> >>        at java.lang.reflect.Method.invoke(Method.java:585)
> >>        at junit.framework.TestCase.runTest(TestCase.java:154)
> >>        at junit.framework.TestCase.runBare(TestCase.java:127)
> >>        at junit.framework.TestResult$1.protect(TestResult.java:106)
> >>        at junit.framework.TestResult.runProtected(TestResult.java:124)
> >>        at junit.framework.TestResult.run(TestResult.java:109)
> >>        at junit.framework.TestCase.run(TestCase.java:118)
> >>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
> >>        at junit.framework.TestSuite.run(TestSuite.java:203)
> >>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>        at
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> >>a:39)
> >>
> >>        at
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> >>Impl.java:25)
> >>
> >>        at java.lang.reflect.Method.invoke(Method.java:585)
> >>        at
> >> org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery
> >>.java:242)
> >>
> >>        at
> >> org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java
> >>:216)
> >>
> >>        at
> >> org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
> >>        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
> >>        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
> >>        at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
> >>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> >>        at
> >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.jav
> >>a:39)
> >>
> >>        at
> >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessor
> >>Impl.java:25)
> >>
> >>        at java.lang.reflect.Method.invoke(Method.java:585)
> >>        at
> >> org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
> >>
> >>
> >> I guess the problem is caused by some previous used server listening
> >> port 9000 in other test was not reclaimed when  ProxyTest run, so I
> >> will change port ProxyTest try to connect from 9000 to 7000 as work
> >> around to fix this problem. Of course we should figure out the root
> >> cause to make sure listening port would be reclaim in time.
> >>
> >> Thanks very much
> >>
> >> Freeman

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194   F:781-902-8001
daniel.kulp@iona.com

Re: system test sometimes hang

Posted by Andrea Smyth <an...@iona.com>.
I have removed the EndpointTest and Proxytest as they are superseded now 
by the ClientServerTest.
System tests still fail though because the ProviderClientServerTest's 
server fails to start up with:

java.lang.NullPointerException
    at 
org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.setServiceClass(JaxWsServiceFactoryBean.java:144)
    at org.apache.cxf.jaxws.EndpointImpl.<init>(EndpointImpl.java:71)
    at 
org.apache.cxf.jaxws.spi.ProviderImpl.createEndpoint(ProviderImpl.java:57)
    at 
org.apache.cxf.jaxws.spi.ProviderImpl.createAndPublishEndpoint(ProviderImpl.java:66)
    at javax.xml.ws.Endpoint.publish(Endpoint.java:156)
    at 
org.apache.cxf.systest.provider.ProviderClientServerTest$Server.run(ProviderClientServerTest.java:43)
    at 
org.apache.cxf.testutil.common.AbstractTestServerBase.start(AbstractTestServerBase.java:61)
    at 
org.apache.cxf.systest.provider.ProviderClientServerTest$Server.main(ProviderClientServerTest.java:73)
server startup failed (not a log message)
Have disabled this test for now.

Andrea.

Jiang Ning wrote:

> Hi
>
> I went through the trunk system test and found out there some thing 
> missing about the bus.shutdown().
> The endpoint would no be shutdown when the bus.shutdown was called.
> When the ProxyTest run, it will attempt to connect the unshutdown 
> port. It could be the reason why the ProxyTest could be hanged.
>
> Cheers,
> Willem.
>
> Freeman Fang wrote:
>
>> Hi all,
>>
>> When I build cxf code I checked out from apache, system test 
>> sometimes hang at ProxyTest
>>
>> When it hang, the exception is
>>
>> java.net.ConnectException: Connection refused
>>        at 
>> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>>        at 
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
>>
>>        at 
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
>>
>>        at 
>> java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>>        at 
>> sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1202) 
>>
>>        at java.security.AccessController.doPrivileged(Native Method)
>>        at 
>> sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1196) 
>>
>>        at 
>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:885) 
>>
>>        at 
>> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
>>        at 
>> org.apache.cxf.transports.http.HTTPConduit.getResponseCode(HTTPConduit.java:315) 
>>
>>        at 
>> org.apache.cxf.transports.http.HTTPConduit.access$200(HTTPConduit.java:44) 
>>
>>        at 
>> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:399) 
>>
>>        at 
>> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.doClose(HTTPConduit.java:386) 
>>
>>        at 
>> org.apache.cxf.messaging.AbstractCachedOutputStream.close(AbstractCachedOutputStream.java:48) 
>>
>>        at 
>> org.apache.cxf.transports.http.HTTPConduit.close(HTTPConduit.java:196)
>>        at 
>> org.apache.cxf.interceptors.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:32) 
>>
>>        at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:112) 
>>
>>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:116)
>>        at 
>> org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:57) 
>>
>>        at $Proxy30.sayHi(Unknown Source)
>>        at 
>> org.apache.cxf.jaxws.ProxyTest.testCreatePort(ProxyTest.java:31)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>        at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>        at java.lang.reflect.Method.invoke(Method.java:585)
>>        at junit.framework.TestCase.runTest(TestCase.java:154)
>>        at junit.framework.TestCase.runBare(TestCase.java:127)
>>        at junit.framework.TestResult$1.protect(TestResult.java:106)
>>        at junit.framework.TestResult.runProtected(TestResult.java:124)
>>   at junit.framework.TestResult.run(TestResult.java:109)
>>        at junit.framework.TestCase.run(TestCase.java:118)
>>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>        at junit.framework.TestSuite.run(TestSuite.java:203)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>        at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>        at java.lang.reflect.Method.invoke(Method.java:585)
>>        at 
>> org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242) 
>>
>>        at 
>> org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216) 
>>
>>        at 
>> org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
>>        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
>>        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
>>        at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>        at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>        at java.lang.reflect.Method.invoke(Method.java:585)
>>        at 
>> org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
>> Caused by: java.net.ConnectException: Connection refused
>>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>>        at 
>> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>>        at java.net.Socket.connect(Socket.java:507)
>>        at sun.net.NetworkClient.doConnect(NetworkClient.java:152)
>>        at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
>>        at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
>>        at 
>> sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:676)
>>        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554)
>>        at 
>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:936) 
>>
>>        at 
>> sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(HttpURLConnection.java:1888) 
>>
>>        at 
>> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:398) 
>>
>>        ... 36 more
>>
>>
>> If it pass, the expected exception should be
>>
>> java.net.ConnectException: Connection refused
>>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>>        at 
>> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>>        at java.net.Socket.connect(Socket.java:507)
>>        at sun.net.NetworkClient.doConnect(NetworkClient.java:152)
>>        at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
>>        at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
>>        at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
>>        at sun.net.www.http.HttpClient.New(HttpClient.java:287)
>>        at sun.net.www.http.HttpClient.New(HttpClient.java:299)
>>        at 
>> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792) 
>>
>>        at 
>> sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744) 
>>
>>        at 
>> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669) 
>>
>>        at 
>> sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836) 
>>
>>        at 
>> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:895) 
>>
>>        at 
>> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
>>        at 
>> org.apache.cxf.transports.http.HTTPConduit.getResponseCode(HTTPConduit.java:315) 
>>
>>        at 
>> org.apache.cxf.transports.http.HTTPConduit.access$200(HTTPConduit.java:44) 
>>
>>        at 
>> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:399) 
>>
>>        at 
>> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.doClose(HTTPConduit.java:386) 
>>
>>        at 
>> org.apache.cxf.messaging.AbstractCachedOutputStream.close(AbstractCachedOutputStream.java:48) 
>>
>>        at 
>> org.apache.cxf.transports.http.HTTPConduit.close(HTTPConduit.java:196)
>>        at 
>> org.apache.cxf.interceptors.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:32) 
>>
>>        at 
>> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:112) 
>>
>>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:116)
>>        at 
>> org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:57) 
>>
>>        at $Proxy30.sayHi(Unknown Source)
>>   at org.apache.cxf.jaxws.ProxyTest.testCreatePort(ProxyTest.java:31)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>        at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>        at java.lang.reflect.Method.invoke(Method.java:585)
>>        at junit.framework.TestCase.runTest(TestCase.java:154)
>>        at junit.framework.TestCase.runBare(TestCase.java:127)
>>        at junit.framework.TestResult$1.protect(TestResult.java:106)
>>        at junit.framework.TestResult.runProtected(TestResult.java:124)
>>        at junit.framework.TestResult.run(TestResult.java:109)
>>        at junit.framework.TestCase.run(TestCase.java:118)
>>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>        at junit.framework.TestSuite.run(TestSuite.java:203)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>        at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>        at java.lang.reflect.Method.invoke(Method.java:585)
>>        at 
>> org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242) 
>>
>>        at 
>> org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216) 
>>
>>        at 
>> org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
>>        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
>>        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
>>        at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>        at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>        at java.lang.reflect.Method.invoke(Method.java:585)
>>        at 
>> org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
>> java.lang.RuntimeException
>>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:120)
>>        at 
>> org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:57) 
>>
>>        at $Proxy30.sayHi(Unknown Source)
>>        at 
>> org.apache.cxf.jaxws.ProxyTest.testCreatePort(ProxyTest.java:31)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>        at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>        at java.lang.reflect.Method.invoke(Method.java:585)
>>        at junit.framework.TestCase.runTest(TestCase.java:154)
>>        at junit.framework.TestCase.runBare(TestCase.java:127)
>>        at junit.framework.TestResult$1.protect(TestResult.java:106)
>>        at junit.framework.TestResult.runProtected(TestResult.java:124)
>>        at junit.framework.TestResult.run(TestResult.java:109)
>>        at junit.framework.TestCase.run(TestCase.java:118)
>>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
>>        at junit.framework.TestSuite.run(TestSuite.java:203)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>        at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>        at java.lang.reflect.Method.invoke(Method.java:585)
>>        at 
>> org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242) 
>>
>>        at 
>> org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216) 
>>
>>        at 
>> org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
>>        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
>>        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
>>        at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
>>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>>        at 
>> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>>
>>        at 
>> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>>
>>        at java.lang.reflect.Method.invoke(Method.java:585)
>>        at 
>> org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
>>
>>
>> I guess the problem is caused by some previous used server listening 
>> port 9000 in other test was not reclaimed when  ProxyTest run, so I 
>> will change port ProxyTest try to connect from 9000 to 7000 as work 
>> around to fix this problem. Of course we should figure out the root 
>> cause to make sure listening port would be reclaim in time.
>>
>> Thanks very much
>>
>> Freeman
>>
>
>


Re: system test sometimes hang

Posted by Jiang Ning <ni...@iona.com>.
Hi

I went through the trunk system test and found out there some thing 
missing about the bus.shutdown().
The endpoint would no be shutdown when the bus.shutdown was called.
When the ProxyTest run, it will attempt to connect the unshutdown port. 
It could be the reason why the ProxyTest could be hanged.

Cheers,
Willem.

Freeman Fang wrote:

> Hi all,
>
> When I build cxf code I checked out from apache, system test sometimes 
> hang at ProxyTest
>
> When it hang, the exception is
>
> java.net.ConnectException: Connection refused
>        at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
>        at 
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) 
>
>        at 
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) 
>
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
>        at 
> sun.net.www.protocol.http.HttpURLConnection$6.run(HttpURLConnection.java:1202) 
>
>        at java.security.AccessController.doPrivileged(Native Method)
>        at 
> sun.net.www.protocol.http.HttpURLConnection.getChainedException(HttpURLConnection.java:1196) 
>
>        at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:885) 
>
>        at 
> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
>        at 
> org.apache.cxf.transports.http.HTTPConduit.getResponseCode(HTTPConduit.java:315) 
>
>        at 
> org.apache.cxf.transports.http.HTTPConduit.access$200(HTTPConduit.java:44) 
>
>        at 
> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:399) 
>
>        at 
> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.doClose(HTTPConduit.java:386) 
>
>        at 
> org.apache.cxf.messaging.AbstractCachedOutputStream.close(AbstractCachedOutputStream.java:48) 
>
>        at 
> org.apache.cxf.transports.http.HTTPConduit.close(HTTPConduit.java:196)
>        at 
> org.apache.cxf.interceptors.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:32) 
>
>        at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:112) 
>
>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:116)
>        at 
> org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:57) 
>
>        at $Proxy30.sayHi(Unknown Source)
>        at 
> org.apache.cxf.jaxws.ProxyTest.testCreatePort(ProxyTest.java:31)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at junit.framework.TestCase.runTest(TestCase.java:154)
>        at junit.framework.TestCase.runBare(TestCase.java:127)
>        at junit.framework.TestResult$1.protect(TestResult.java:106)
>        at junit.framework.TestResult.runProtected(TestResult.java:124)
>   at junit.framework.TestResult.run(TestResult.java:109)
>        at junit.framework.TestCase.run(TestCase.java:118)
>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
>        at junit.framework.TestSuite.run(TestSuite.java:203)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at 
> org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242) 
>
>        at 
> org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216) 
>
>        at 
> org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at 
> org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
> Caused by: java.net.ConnectException: Connection refused
>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>        at 
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>        at java.net.Socket.connect(Socket.java:507)
>        at sun.net.NetworkClient.doConnect(NetworkClient.java:152)
>        at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
>        at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
>        at 
> sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:676)
>        at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554)
>        at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:936) 
>
>        at 
> sun.net.www.protocol.http.HttpURLConnection.getHeaderFields(HttpURLConnection.java:1888) 
>
>        at 
> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:398) 
>
>        ... 36 more
>
>
> If it pass, the expected exception should be
>
> java.net.ConnectException: Connection refused
>        at java.net.PlainSocketImpl.socketConnect(Native Method)
>        at java.net.PlainSocketImpl.doConnect(PlainSocketImpl.java:333)
>        at 
> java.net.PlainSocketImpl.connectToAddress(PlainSocketImpl.java:195)
>        at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:182)
>        at java.net.Socket.connect(Socket.java:507)
>        at sun.net.NetworkClient.doConnect(NetworkClient.java:152)
>        at sun.net.www.http.HttpClient.openServer(HttpClient.java:365)
>        at sun.net.www.http.HttpClient.openServer(HttpClient.java:477)
>        at sun.net.www.http.HttpClient.<init>(HttpClient.java:214)
>        at sun.net.www.http.HttpClient.New(HttpClient.java:287)
>        at sun.net.www.http.HttpClient.New(HttpClient.java:299)
>        at 
> sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:792) 
>
>        at 
> sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:744) 
>
>        at 
> sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:669) 
>
>        at 
> sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:836) 
>
>        at 
> sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:895) 
>
>        at 
> java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:367)
>        at 
> org.apache.cxf.transports.http.HTTPConduit.getResponseCode(HTTPConduit.java:315) 
>
>        at 
> org.apache.cxf.transports.http.HTTPConduit.access$200(HTTPConduit.java:44) 
>
>        at 
> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.handleResponse(HTTPConduit.java:399) 
>
>        at 
> org.apache.cxf.transports.http.HTTPConduit$WrappedOutputStream.doClose(HTTPConduit.java:386) 
>
>        at 
> org.apache.cxf.messaging.AbstractCachedOutputStream.close(AbstractCachedOutputStream.java:48) 
>
>        at 
> org.apache.cxf.transports.http.HTTPConduit.close(HTTPConduit.java:196)
>        at 
> org.apache.cxf.interceptors.MessageSenderInterceptor.handleMessage(MessageSenderInterceptor.java:32) 
>
>        at 
> org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:112) 
>
>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:116)
>        at 
> org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:57) 
>
>        at $Proxy30.sayHi(Unknown Source)
>   at org.apache.cxf.jaxws.ProxyTest.testCreatePort(ProxyTest.java:31)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at junit.framework.TestCase.runTest(TestCase.java:154)
>        at junit.framework.TestCase.runBare(TestCase.java:127)
>        at junit.framework.TestResult$1.protect(TestResult.java:106)
>        at junit.framework.TestResult.runProtected(TestResult.java:124)
>        at junit.framework.TestResult.run(TestResult.java:109)
>        at junit.framework.TestCase.run(TestCase.java:118)
>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
>        at junit.framework.TestSuite.run(TestSuite.java:203)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at 
> org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242) 
>
>        at 
> org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216) 
>
>        at 
> org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at 
> org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
> java.lang.RuntimeException
>        at org.apache.cxf.endpoint.ClientImpl.invoke(ClientImpl.java:120)
>        at 
> org.apache.cxf.jaxws.EndpointInvocationHandler.invoke(EndpointInvocationHandler.java:57) 
>
>        at $Proxy30.sayHi(Unknown Source)
>        at 
> org.apache.cxf.jaxws.ProxyTest.testCreatePort(ProxyTest.java:31)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at junit.framework.TestCase.runTest(TestCase.java:154)
>        at junit.framework.TestCase.runBare(TestCase.java:127)
>        at junit.framework.TestResult$1.protect(TestResult.java:106)
>        at junit.framework.TestResult.runProtected(TestResult.java:124)
>        at junit.framework.TestResult.run(TestResult.java:109)
>        at junit.framework.TestCase.run(TestCase.java:118)
>        at junit.framework.TestSuite.runTest(TestSuite.java:208)
>        at junit.framework.TestSuite.run(TestSuite.java:203)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at 
> org.apache.maven.surefire.battery.JUnitBattery.executeJUnit(JUnitBattery.java:242) 
>
>        at 
> org.apache.maven.surefire.battery.JUnitBattery.execute(JUnitBattery.java:216) 
>
>        at 
> org.apache.maven.surefire.Surefire.executeBattery(Surefire.java:215)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:163)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:87)
>        at org.apache.maven.surefire.Surefire.run(Surefire.java:63)
>        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>        at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>        at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) 
>
>        at java.lang.reflect.Method.invoke(Method.java:585)
>        at 
> org.apache.maven.surefire.SurefireBooter.main(SurefireBooter.java:785)
>
>
> I guess the problem is caused by some previous used server listening 
> port 9000 in other test was not reclaimed when  ProxyTest run, so I 
> will change port ProxyTest try to connect from 9000 to 7000 as work 
> around to fix this problem. Of course we should figure out the root 
> cause to make sure listening port would be reclaim in time.
>
> Thanks very much
>
> Freeman
>