Starting a second instance of cobra does not use the next available port or at least handles the error nicely but instead shows an exception stacktrace on the console and seems to just crash the application:
$ cobra
____ _
/ ___|___ | |__ _ __ __ _ TM
| | / _ \| '_ \| '__/ _` |
| |__| (_) | |_) | | | (_| |
\____\___/|_.__/|_| \__,_|
________________________________________
| version 1.0.5 - (c) 2016 Martin Ring |
[ERROR] [10/10/2016 12:18:44.350] [01_Einleitung-akka.actor.default-dispatcher-2] [akka://01_Einleitung/system/IO-TCP/selectors/$a/0] Bind failed for TCP channel on endpoint [localhost/127.0.0.1:8080]
java.net.BindException: Die Adresse wird bereits verwendet
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 akka.io.TcpListener.liftedTree1$1(TcpListener.scala:55)
at akka.io.TcpListener.<init>(TcpListener.scala:52)
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 akka.util.Reflect$.instantiate(Reflect.scala:65)
at akka.actor.ArgsReflectConstructor.produce(IndirectActorProducer.scala:96)
at akka.actor.Props.newActor(Props.scala:213)
at akka.actor.ActorCell.newActor(ActorCell.scala:562)
at akka.actor.ActorCell.create(ActorCell.scala:588)
at akka.actor.ActorCell.invokeAll$1(ActorCell.scala:461)
at akka.actor.ActorCell.systemInvoke(ActorCell.scala:483)
at akka.dispatch.Mailbox.processAllSystemMessages(Mailbox.scala:282)
at akka.dispatch.Mailbox.run(Mailbox.scala:223)
at akka.dispatch.Mailbox.exec(Mailbox.scala:234)
at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260)
at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339)
at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979)
at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107)
[ERROR] [10/10/2016 12:18:44.351] [01_Einleitung-akka.actor.default-dispatcher-5] [01_Einleitung] binding failed with bind failed
Starting a second instance of cobra does not use the next available port or at least handles the error nicely but instead shows an exception stacktrace on the console and seems to just crash the application: