2017-09-30 10 views
-1

Scalaのリバース・サーバこれは、私が、テストアッカ+私は質問 を持っているエラー

パッケージorg.reversestr.client

次実行のsbt runコマンドでサーバを実行すると、これは私のクライアント https://github.com/vladimirkozhaev/string-reverse-client である私のサーバー https://github.com/vladimirkozhaev/reverse-str です
import org.scalatest.concurrent.PatienceConfiguration.Timeout 
import org.scalatest.{FunSpecLike, Matchers} 
import org.scalatest.concurrent.ScalaFutures 
import scala.concurrent.duration._ 

class RClientIntegrationSpec extends FunSpecLike with Matchers with ScalaFutures { 
    val client:RClient = new RClient("127.0.0.1:2552") 
    describe("reverse str Scala Client") { 
    describe("set method") { 
     it("should set a value") { 
     whenReady(client.setStr("123"), Timeout(1 second)) { 
      r => r shouldBe "321" 
     } 
     } 
    } 


    } 
} 

この奇妙なエラーメッセージが表示されます どこが間違っていますか?

[INFO] [09/30/2017 22:34:52.985] [pool-4-thread-9] [akka.remote.Remoting] Starting remoting [ERROR] [09/30/2017 22:34:53.466] [LocalSystem-akka.remote.default-remote-dispatcher-13] [NettyTransport(akka://LocalSys tem)] failed to bind to /127.0.0.1:2552, shutting down Netty transport [ERROR] [09/30/2017 22:34:53.516] [pool-4-thread-9] [akka.remote.Remoting] Remoting error: [Startup failed] [ akka.remote.RemoteTransportException: Startup failed at akka.remote.Remoting.akka$remote$Remoting$$notifyError(Remoting.scala:146) at akka.remote.Remoting.start(Remoting.scala:212) at akka.remote.RemoteActorRefProvider.init(RemoteActorRefProvider.scala:212) at akka.actor.ActorSystemImpl.liftedTree2$1(ActorSystem.scala:796) at akka.actor.ActorSystemImpl._start$lzycompute(ActorSystem.scala:793) at akka.actor.ActorSystemImpl._start(ActorSystem.scala:793) at akka.actor.ActorSystemImpl.start(ActorSystem.scala:809) at akka.actor.ActorSystem$.apply(ActorSystem.scala:244) at akka.actor.ActorSystem$.apply(ActorSystem.scala:287) at akka.actor.ActorSystem$.apply(ActorSystem.scala:232) at org.reversestr.client.RClient.(RClient.scala:11) at org.reversestr.client.RClientIntegrationSpec.(RClientIntegrationSpec.scala:9) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.lang.reflect.Constructor.newInstance(Constructor.java:423) at java.lang.Class.newInstance(Class.java:442) at org.scalatest.tools.Framework$ScalaTestTask.execute(Framework.scala:646) at sbt.TestRunner.runTest$1(TestFramework.scala:76) at sbt.TestRunner.run(TestFramework.scala:85) at sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:202) at sbt.TestFramework$$anon$2$$anonfun$$init$$1$$anonfun$apply$8.apply(TestFramework.scala:202) at sbt.TestFramework$.sbt$TestFramework$$withContextLoader(TestFramework.scala:185) at sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:202) at sbt.TestFramework$$anon$2$$anonfun$$init$$1.apply(TestFramework.scala:202) at sbt.TestFunction.apply(TestFramework.scala:207) at sbt.Tests$$anonfun$9.apply(Tests.scala:216) at sbt.Tests$$anonfun$9.apply(Tests.scala:216) at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44) at sbt.std.Transform$$anon$3$$anonfun$apply$2.apply(System.scala:44) at sbt.std.Transform$$anon$4.work(System.scala:63) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226) at sbt.Execute$$anonfun$submit$1$$anonfun$apply$1.apply(Execute.scala:226) at sbt.ErrorHandling$.wideConvert(ErrorHandling.scala:17) at sbt.Execute.work(Execute.scala:235) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226) at sbt.Execute$$anonfun$submit$1.apply(Execute.scala:226) at sbt.ConcurrentRestrictions$$anon$4$$anonfun$1.apply(ConcurrentRestrictions.scala:159) at sbt.CompletionService$$anon$2.call(CompletionService.scala:28) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) at java.util.concurrent.FutureTask.run(FutureTask.java:266) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745) Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: /127.0.0.1:2552 at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272) at akka.remote.transport.netty.NettyTransport$$anonfun$listen$1.apply(NettyTransport.scala:417) at akka.remote.transport.netty.NettyTransport$$anonfun$listen$1.apply(NettyTransport.scala:413) at scala.util.Success$$anonfun$map$1.apply(Try.scala:236) at scala.util.Try$.apply(Try.scala:191) at scala.util.Success.map(Try.scala:236) at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235) at scala.concurrent.Future$$anonfun$map$1.apply(Future.scala:235) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:32) at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:55) at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply$mcV$sp(BatchingExecutor.scala:91) at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91) at akka.dispatch.BatchingExecutor$BlockableBatch$$anonfun$run$1.apply(BatchingExecutor.scala:91) at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:72) at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:90) at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:40) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:43) at akka.dispatch.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) at akka.dispatch.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) at akka.dispatch.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) at akka.dispatch.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) 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:433) at sun.nio.ch.Net.bind(Net.java:425) at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:223) at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:391) at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:315) at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42) at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) at java.lang.Thread.run(Thread.java:745)

答えて

0

指定されたポートで実行している別のアプリケーションがすでに存在しているようだ:2552 例外が明確にあることを示しています。java.net.BindException: Address already in use:

は、迅速な解決が、その時に実行するアプリケーションを殺すことによってポートをオフにしていますポート。お使いのシェル(またはターミナル)で次のコマンドを実行し、ポートをクリアする

kill -9 $(lsof -t -i:2552) 

次に、あなたのテストを実行している再試行してください。

Explanation of the commands:

  • lsof -t -i:2552 returns the process id of the application that runs on port 2552
  • kill -9 process_id kills the application with given process id
関連する問題