Forum Discussion

zlaser's avatar
zlaser
New Contributor
14 years ago

java.net.BindException when running SoapUITestCaseRunner

Hello,
i have a problem when i try to run a testSuite with the Testrunner (i.e the SoapUITestCaseRunner). Everything seems to be ok when i run it by clicking the green arrow button in the testSuite window.

My TestSuite is as follow:
1. TestCase A (Disabled)
-> testStep: mockResponse test step
2. TestCase B
-> groovy script which launch TestCaseA :
testRunner.testCase.testSuite.testCases["TestCase A"].run(null, true);

-> delay 5000
-> groovy script which send a message for TestCase A

def fileName = "c:/requestToBeHandledByTestCaseA.xml";
SoapClient.sendMessageToTestRobot("mySoapAction", fileName);


The "sendMessageToTestRobot" method actually send a message for the listening mockResponse test step in "TestCase A".

And here is the stack trace for the error i have :

15:16:37,173 INFO  [SoapUITestCaseRunner] Running soapUI testcase [TestCase B]
15:16:37,201 INFO [SoapUITestCaseRunner] running step [testCaseLauncher]
15:16:37,226 INFO [SoapUITestCaseRunner] Running soapUI testcase [TestCase A]
15:16:37,226 INFO [SoapUITestCaseRunner] running step [receiveNotification]
15:16:37,232 INFO [SoapUITestCaseRunner] running step [Delay]
15:16:37,263 INFO [WsdlMockRunner] Mounted WSDL for interface [ecrisServiceBinding-v1.0] at [/mockResponseTestCaseService?WSDL]
15:16:37,454 ERROR [SoapUI] An error occured [Address already in use: JVM_Bind], see error log for details
java.net.BindException: Address already in use: JVM_Bind
at java.net.PlainSocketImpl.socketBind(Native Method)
at java.net.PlainSocketImpl.bind(PlainSocketImpl.java:383)
at java.net.ServerSocket.bind(ServerSocket.java:328)
at java.net.ServerSocket.<init>(ServerSocket.java:194)
at java.net.ServerSocket.<init>(ServerSocket.java:150)
at javax.net.ssl.SSLServerSocket.<init>(SSLServerSocket.java:84)
at com.sun.net.ssl.internal.ssl.SSLServerSocketImpl.<init>(SSLServerSocketImpl.java:81)
at com.sun.net.ssl.internal.ssl.SSLServerSocketFactoryImpl.createServerSocket(SSLServerSocketFactoryImpl.java:65)
at org.mortbay.jetty.security.SslSocketConnector.newServerSocket(SslSocketConnector.java:478)
at org.mortbay.jetty.bio.SocketConnector.open(SocketConnector.java:73)
at org.mortbay.jetty.AbstractConnector.doStart(AbstractConnector.java:283)
at org.mortbay.jetty.bio.SocketConnector.doStart(SocketConnector.java:147)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at org.mortbay.jetty.Server.doStart(Server.java:235)
at org.mortbay.component.AbstractLifeCycle.start(AbstractLifeCycle.java:50)
at com.eviware.soapui.monitor.JettyMockEngine.startMockService(JettyMockEngine.java:154)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.start(WsdlMockRunner.java:672)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockRunner.<init>(WsdlMockRunner.java:100)
at com.eviware.soapui.impl.wsdl.mock.WsdlMockService.start(WsdlMockService.java:208)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlMockResponseTestStep.internalRun(WsdlMockResponseTestStep.java:460)
at com.eviware.soapui.impl.wsdl.teststeps.WsdlMockResponseTestStep.run(WsdlMockResponseTestStep.java:418)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.runTestStep(AbstractTestCaseRunner.java:232)
at com.eviware.soapui.impl.wsdl.testcase.WsdlTestCaseRunner.runCurrentTestStep(WsdlTestCaseRunner.java:48)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:141)
at com.eviware.soapui.impl.wsdl.support.AbstractTestCaseRunner.internalRun(AbstractTestCaseRunner.java:42)
at com.eviware.soapui.impl.wsdl.support.AbstractTestRunner.run(AbstractTestRunner.java:135)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)



I think the problem comes from the line testRunner.testCase.testSuite.testCases["TestCase A"].run(null, true);

Am i correct ?

Actually i'm trying to send automatically a soap message to a mockResponse test step, but if i do it sequentially, the testSuite will end up with the mockResponse waiting.

Is there any other way to do what i want ?

Thank you for your help !
  • zlaser's avatar
    zlaser
    New Contributor
    More information about my problem.
    It seems to be caused by the SSL Settings of the mockService : when i uncheck "Enable Mock SSL" in the preferences, i don't have the problem anymore. But, i really need to enable SSL, so this is problematic.

    So, to put it simple: if "Enable Mock SSL" is checked in SoapUI preferences, launching SoapUITestCaseRunner on a TestSuite/TestCase having a "mockResponse testStep" will end up with an exception : "java.net.BindException: Address already in use: bind"

    Dear SoapUI Team, can you please check tha point ?

    Thanks in advance !
  • zlaser's avatar
    zlaser
    New Contributor
    Some more input: actually i'm able to make it run with the SoapUITestCaseRunner in SSL mode, but if i cancel the Test by clicking the "cancel" button in the TestCaseRunner window "soapUI TestRunner", and try to launch the runner again with the "Launch" button in the TestCaseRunner window "Launch TestRunner", it fails again with the Bind Exception.
    The interesting part is that if i change the SSL port for the mock service to any other port it works !
    I send a "netstat -a" command in dos and here the result :

    Proto Local Address Foreign Address State
    TCP 0.0.0.0:135 w110379:0 LISTENING
    TCP 0.0.0.0:443 w110379:0 LISTENING
    TCP 0.0.0.0:445 w110379:0 LISTENING
    TCP 0.0.0.0:1198 w110379:0 LISTENING
    TCP 0.0.0.0:2864 w110379:0 LISTENING
    TCP 0.0.0.0:3389 w110379:0 LISTENING
    TCP 0.0.0.0:5357 w110379:0 LISTENING
    TCP 0.0.0.0:5432 w110379:0 LISTENING
    TCP 0.0.0.0:8080 w110379:0 LISTENING
    TCP 0.0.0.0:8080 w110379:0 LISTENING
    TCP 0.0.0.0:8443 w110379:0 LISTENING
    TCP 0.0.0.0:8443 w110379:0 LISTENING



    It seems that Mockresponses test step are not stopped and are still listening ! That explains the exception "java.net.BindException: Address already in use" i receive if i keep the same port.
  • I came across this while searching for a solution to the same issue. I am using version SoapUI 5.4.0.

     

    It seems that SoapUI is holding ports open when an exception occurs. The only way to fix the issue is to Exit SoapUI or kill its process.

     

    In my case the exception was caused by SSL Preference "Enable Mock SSL" being checked with a missing KeyStore certificate. SoapUI gave a not very helpful "...\SoapUI-5.4.0\bin ...File not found (Access Denied)" error when starting a mock service. I unchecked the option and all it resolved the issue (someone else installed SoapUI with the missing certificate specified).