TakayukiKoyama Geek Blog

Create, Entertain, Experience

Play frameworkでrunしようとしてもエラーで立ち上がらないときは

Play初心者なので、ちょっとしたエラーで前に全然進まなくなります。

 下記のようなエラーが発生しました。最初は、書き換えたソースが良くないかと思いましたが、冷静によく読むとjbosslocalhost:9000にbindできないと書いてありました。

 今回、Eclipseでrun実行したもののうまく終了できず、コンソールでrunしようとして下記のようなエラーが出ていました。つまりEclipseが9000ポートを閉じずにそのままになっていたので、runできなかったようです。

 ということでEclipseを一旦終了したら無事に動きました。

※エラー文 [error] Play fork run has failed due to: [error] java.lang.reflect.InvocationTargetException [error] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [error] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) [error] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) [error] at java.lang.reflect.Method.invoke(Method.java:483) [error] at play.runsupport.Reloader$.startDevMode(Reloader.scala:207) [error] at play.forkrun.ForkRun$.startServer(ForkRun.scala:82) [error] at play.forkrun.ForkRun.run(ForkRun.scala:177) [error] at play.forkrun.ForkRun$$anonfun$settingUp$1.applyOrElse(ForkRun.scala:166) [error] at akka.actor.Actor$class.aroundReceive(Actor.scala:465) [error] at play.forkrun.ForkRun.aroundReceive(ForkRun.scala:152) [error] at akka.actor.ActorCell.receiveMessage(ActorCell.scala:516) [error] at akka.actor.ActorCell.invoke(ActorCell.scala:487) [error] at akka.dispatch.Mailbox.processMailbox(Mailbox.scala:254) [error] at akka.dispatch.Mailbox.run(Mailbox.scala:221) [error] at akka.dispatch.Mailbox.exec(Mailbox.scala:231) [error] at scala.concurrent.forkjoin.ForkJoinTask.doExec(ForkJoinTask.java:260) [error] at scala.concurrent.forkjoin.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1339) [error] at scala.concurrent.forkjoin.ForkJoinPool.runWorker(ForkJoinPool.java:1979) [error] at scala.concurrent.forkjoin.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:107) [error] Caused by: org.jboss.netty.channel.ChannelException: Failed to bind to: /0.0.0.0:9000 [error] at org.jboss.netty.bootstrap.ServerBootstrap.bind(ServerBootstrap.java:272) [error] at play.core.server.NettyServer$$anonfun$1.apply(NettyServer.scala:132) [error] at play.core.server.NettyServer$$anonfun$1.apply(NettyServer.scala:129) [error] at scala.Option.map(Option.scala:146) [error] at play.core.server.NettyServer.(NettyServer.scala:129) [error] at play.core.server.NettyServerProvider.createServer(NettyServer.scala:200) [error] at play.core.server.NettyServerProvider.createServer(NettyServer.scala:199) [error] at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:208) [error] at play.core.server.DevServerStart$$anonfun$mainDev$1.apply(DevServerStart.scala:61) [error] at play.utils.Threads$.withContextClassLoader(Threads.scala:21) [error] at play.core.server.DevServerStart$.mainDev(DevServerStart.scala:60) [error] at play.core.server.DevServerStart$.mainDevHttpMode(DevServerStart.scala:50) [error] at play.core.server.DevServerStart.mainDevHttpMode(DevServerStart.scala) [error] ... 19 more [error] Caused by: java.net.BindException: Address already in use [error] at sun.nio.ch.Net.bind0(Native Method) [error] at sun.nio.ch.Net.bind(Net.java:414) [error] at sun.nio.ch.Net.bind(Net.java:406) [error] at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:214) [error] at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:74) [error] at org.jboss.netty.channel.socket.nio.NioServerBoss$RegisterTask.run(NioServerBoss.java:193) [error] at org.jboss.netty.channel.socket.nio.AbstractNioSelector.processTaskQueue(AbstractNioSelector.java:391) [error] at org.jboss.netty.channel.socket.nio.AbstractNioSelector.run(AbstractNioSelector.java:315) [error] at org.jboss.netty.channel.socket.nio.NioServerBoss.run(NioServerBoss.java:42) [error] at org.jboss.netty.util.ThreadRenamingRunnable.run(ThreadRenamingRunnable.java:108) [error] at org.jboss.netty.util.internal.DeadLockProofWorker$1.run(DeadLockProofWorker.java:42) [error] at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [error] at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [error] at java.lang.Thread.run(Thread.java:745) [info] Stopping Play fork run ... [info] JVM exiting, shutting down Play fork run ... [info] Play fork run already stopped ...