1 Reply Latest reply on Aug 5, 2016 5:21 PM by Max Ozkin

    Junit unable to start jetty server

    ravi narayanan Expert

      my local instance of server is already running but before deploy  iam setting the below property.

       

        @BeforeDeploy

          public void setProperties() {

              System.setProperty("org.switchyard.component.http.standalone.port", "8081");

          }

       

      still iam getting below error.

      Please see the attachement for details.

      java.lang.Exception: org.apache.cxf.interceptor.Fault: Could not start Jetty server on port 8.080: Address already in use: bind

        at org.switchyard.test.SwitchYardRunner.createTest(SwitchYardRunner.java:64)

        at org.junit.runners.BlockJUnit4ClassRunner$1.runReflectiveCall(BlockJUnit4ClassRunner.java:244)

        at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)

        at org.junit.runners.BlockJUnit4ClassRunner.methodBlock(BlockJUnit4ClassRunner.java:241)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)

        at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)

        at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)

        at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)

        at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)

        at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)

        at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)

        at org.junit.runners.ParentRunner.run(ParentRunner.java:309)

        at org.switchyard.test.SwitchYardRunner.run(SwitchYardRunner.java:85)

        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)

        at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)

        at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

      Caused by: org.apache.cxf.interceptor.Fault: Could not start Jetty server on port 8.080: Address already in use: bind

        at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:386)

        at org.apache.cxf.transport.http_jetty.JettyHTTPDestination.activate(JettyHTTPDestination.java:172)

        at org.apache.cxf.transport.AbstractObservable.setMessageObserver(AbstractObservable.java:49)

        at org.apache.cxf.binding.AbstractBaseBindingFactory.addListener(AbstractBaseBindingFactory.java:97)

        at org.apache.cxf.binding.soap.SoapBindingFactory.addListener(SoapBindingFactory.java:837)

        at org.apache.cxf.endpoint.ServerImpl.start(ServerImpl.java:131)

        at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:204)

        at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:211)

        at org.switchyard.component.soap.endpoint.CXFJettyEndpoint.publish(CXFJettyEndpoint.java:112)

        at org.switchyard.component.soap.endpoint.CXFJettyEndpointPublisher.publish(CXFJettyEndpointPublisher.java:56)

        at org.switchyard.component.soap.InboundHandler.doStart(InboundHandler.java:171)

        at org.switchyard.deploy.BaseServiceHandler.start(BaseServiceHandler.java:60)

        at org.switchyard.deploy.internal.Deployment.deployServiceBindings(Deployment.java:623)

        at org.switchyard.deploy.internal.Deployment.start(Deployment.java:145)

        at org.switchyard.test.SwitchYardTestKit.deploy(SwitchYardTestKit.java:757)

        at org.switchyard.test.SwitchYardTestKit.start(SwitchYardTestKit.java:177)

        at org.switchyard.test.SwitchYardRunner.createTest(SwitchYardRunner.java:60)

        ... 18 more

      Caused by: java.net.BindException: Address already in use: bind

        at sun.nio.ch.Net.bind0(Native Method)

        at sun.nio.ch.Net.bind(Net.java:463)

        at sun.nio.ch.Net.bind(Net.java:455)

        at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223)

        at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74)

        at org.eclipse.jetty.server.nio.SelectChannelConnector.open(SelectChannelConnector.java:172)

        at org.eclipse.jetty.server.AbstractConnector.doStart(AbstractConnector.java:300)

        at org.eclipse.jetty.server.nio.SelectChannelConnector.doStart(SelectChannelConnector.java:249)

        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)

        at org.eclipse.jetty.server.Server.doStart(Server.java:272)

        at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:59)

        at org.apache.cxf.transport.http_jetty.JettyHTTPServerEngine.addServant(JettyHTTPServerEngine.java:375)

        ... 34 more