Jean-Sebastien Delfino wrote:
Raymond Feng wrote:
Looks like the port is in use. Do you have an orphan java process
running from the previous build?
Thanks,
Raymond
--------------------------------------------------
From: "Jean-Sebastien Delfino" <[EMAIL PROTECTED]>
Sent: Friday, April 25, 2008 12:03 PM
To: "tuscany-dev" <[email protected]>
Subject: Build error in itest/oneway
Is anyone else seeing this build error in itest/oneway?
Tests run: 2, Failures: 0, Errors: 1, Skipped: 0, Time elapsed:
10.702 sec <<< FAILURE!
testOneWayUsingNonBlockingInterceptorThrowsAnException(org.apache.tuscany.sca.itest.oneway.OneWayTestCase)
Time elapsed: 0.445 sec <<< ERROR!
org.apache.tuscany.sca.host.http.ServletMappingException:
java.net.BindException: Address already in use
at
org.apache.tuscany.sca.http.jetty.JettyServer.addServletMapping(JettyServer.java:206)
at
org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceProvider.start(Axis2ServiceProvider.java:249)
at
org.apache.tuscany.sca.binding.ws.axis2.Axis2ServiceBindingProvider.start(Axis2ServiceBindingProvider.java:94)
at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl$2.run(CompositeActivatorImpl.java:556)
at java.security.AccessController.doPrivileged(Native Method)
at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.start(CompositeActivatorImpl.java:554)
at
org.apache.tuscany.sca.core.assembly.CompositeActivatorImpl.start(CompositeActivatorImpl.java:500)
at
org.apache.tuscany.sca.node.impl.NodeImpl.start(NodeImpl.java:312)
at
org.apache.tuscany.sca.itest.oneway.OneWayTestCase.setUp(OneWayTestCase.java:70)
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:597)
at
org.junit.internal.runners.BeforeAndAfterRunner.invokeMethod(BeforeAndAfterRunner.java:74)
at
org.junit.internal.runners.BeforeAndAfterRunner.runBefores(BeforeAndAfterRunner.java:50)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:33)
at
org.junit.internal.runners.TestMethodRunner.runMethod(TestMethodRunner.java:75)
at
org.junit.internal.runners.TestMethodRunner.run(TestMethodRunner.java:45)
at
org.junit.internal.runners.TestClassMethodsRunner.invokeTestMethod(TestClassMethodsRunner.java:75)
at
org.junit.internal.runners.TestClassMethodsRunner.run(TestClassMethodsRunner.java:36)
at
org.junit.internal.runners.TestClassRunner$1.runUnprotected(TestClassRunner.java:42)
at
org.junit.internal.runners.BeforeAndAfterRunner.runProtected(BeforeAndAfterRunner.java:34)
at
org.junit.internal.runners.TestClassRunner.run(TestClassRunner.java:52)
at
org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:138)
at
org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:125)
at org.apache.maven.surefire.Surefire.run(Surefire.java:132)
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:597)
at
org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:308)
at
org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:879)
Caused by: java.net.BindException: Address already in use
at sun.nio.ch.Net.bind(Native Method)
at
sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:119)
at
sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:59)
at
org.mortbay.jetty.nio.SelectChannelConnector.open(SelectChannelConnector.java:205)
at
org.mortbay.jetty.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:304)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at org.mortbay.jetty.Server.doStart(Server.java:233)
at
org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:40)
at
org.apache.tuscany.sca.http.jetty.JettyServer.addServletMapping(JettyServer.java:199)
... 32 more
I'm trying to build on Linux RHEL5.
Thanks.
--
Jean-Sebastien
Hmmm, no orphan process, port 8085 not in use before starting the test,
and reproduced on two different machines, RHEL5 and Fedora core 6.
I'll investigate a bit more, my guess is that the test starts/stops/runs
multiple servers and Jetty tries to bind to port 8085 before it's
completely released from a previous run (after running the test, netstat
shows port 8085 in TIME_WAIT state).
Another thought is that the test runs async invocations in parallel
threads, which may contribute to hold port 8085 for a bit while the next
server instance is already starting in the main thread.
SVN revision r651790 contains a workaround for that issue - using a
single node for the two test methods in the test case works around the
issue with a second node trying to bind to the same port :).
SVN revision r651796 contains a real fix. The problem was that
NodeImpl.stop() was missing a call to runtime.stop(), so the Jetty
server created for the first test was never stopped and still holding
port 8085 preventing the second node to bind to it.
I have no idea why this worked on Windows before, this was not a timing
issue and should have failed on Windows too. Anyway, revision r651796
works on Linux RHEL6, Fedora core 6, Ubuntu 8.04 and Windows XP.
I'll post later on how I'm able to build and test on all these platforms
in a few minutes, with a single laptop :)
--
Jean-Sebastien