SpringBootの勉強でSTSから出力したjarをWindowsのコマンドプロンプトから実行。
原因調査中だけどメモ代わりに
単に実行可能jarデスクトップ上でダブルクリックしていたのが残っていただけでした。。。。
java -jar C:\Users\epea.pc01\Desktop\mrs-0.0.1-SNAPSHOT.jar
すると、portが埋まっていると言われて起動できなかった。
2017-04-20 17:08:24.561 ERROR 10048 --- [ main] o.a.coyote.http11.Http11NioProtocol : Failed to start end point associated with ProtocolHandler [http-nio-8080] java.net.BindException: Address already in use: bind at sun.nio.ch.Net.bind0(Native Method) ~[na:1.8.0_131] at sun.nio.ch.Net.bind(Unknown Source) ~[na:1.8.0_131] at sun.nio.ch.Net.bind(Unknown Source) ~[na:1.8.0_131]
確認すると確かに使用されている。
PS C:\Users\epea.pc01> netstat -oan|Select-String "8080"
TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING
TCP [::]:8080 [::]:0 LISTENING
PS C:\Users\epea.pc01> Get-Process -Id "2664"
Handles NPM(K) PM(K) WS(K) CPU(s) Id SI ProcessName
------- ------ ----- ----- ------ -- -- -----------
380 39 570384 365884 34.33 2664 1 javaw
PS C:\Users\epea.pc01> Get-Process javaw | Form Name : javaw Id : 2664 PriorityClass : Normal FileVersion : 8.0.1310.11 HandleCount : 376 WorkingSet : 57143296 PagedMemorySize : 588607488 PrivateMemorySize : 588607488 VirtualMemorySize : -427937792 TotalProcessorTime : 00:00:34.5312500 SI : 1 Handles : 376 VM : 3867029504 WS : 57143296 PM : 588607488 NPM : 40056 Path : C:\Program Files\Ja Company : Oracle Corporation CPU : 34.53125 ProductVersion : 8.0.1310.11 Description : Java(TM) Platform S Product : Java(TM) Platform S __NounName : Process BasePriority : 8 ExitCode : HasExited : False ExitTime : Handle : 1564 SafeHandle : Microsoft.Win32.Saf MachineName : . MainWindowHandle : 0 MainWindowTitle : MainModule : System.Diagnostics. MaxWorkingSet : 1413120 MinWorkingSet : 204800 Modules : {System.Diagnostics ), System.Diagnosti ELBASE.dll)...} NonpagedSystemMemorySize : 40056 NonpagedSystemMemorySize64 : 40056 PagedMemorySize64 : 588607488 PagedSystemMemorySize : 207872 PagedSystemMemorySize64 : 207872 PeakPagedMemorySize : 668753920 PeakPagedMemorySize64 : 668753920 PeakWorkingSet : 454303744 PeakWorkingSet64 : 454303744 PeakVirtualMemorySize : -357683200 PeakVirtualMemorySize64 : 3937284096 PriorityBoostEnabled : True PrivateMemorySize64 : 588607488 PrivilegedProcessorTime : 00:00:03.6250000 ProcessName : javaw ProcessorAffinity : 15 Responding : True SessionId : 1 StartInfo : System.Diagnostics. StartTime : 2017/04/20 16:51:46 SynchronizingObject : Threads : {10604, 11860, 7328 UserProcessorTime : 00:00:30.9062500 VirtualMemorySize64 : 3867029504 EnableRaisingEvents : False StandardInput : StandardOutput : StandardError : WorkingSet64 : 57143296 Site : Container :
スレッドダンプ
2017-04-20 18:31:47 Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode): "DestroyJavaVM" #24 prio=5 os_prio=0 tid=0x000000001ac06000 nid=0x2e54 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "http-nio-8080-AsyncTimeout" #22 daemon prio=5 os_prio=0 tid=0x000000001ac09000 nid=0x1e0 waiting on condition [0x000000002459f000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at org.apache.coyote.AbstractProtocol$AsyncTimeout.run(AbstractProtocol.java:1138) at java.lang.Thread.run(Unknown Source) "http-nio-8080-Acceptor-0" #21 daemon prio=5 os_prio=0 tid=0x000000001ac08800 nid=0x2080 runnable [0x000000002449f000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method) at sun.nio.ch.ServerSocketChannelImpl.accept(Unknown Source) at sun.nio.ch.ServerSocketChannelImpl.accept(Unknown Source) - locked (a java.lang.Object) at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:443) at java.lang.Thread.run(Unknown Source) "http-nio-8080-ClientPoller-1" #20 daemon prio=5 os_prio=0 tid=0x000000001ac07800 nid=0x12b8 runnable [0x000000002439f000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method) at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source) at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source) at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source) at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source) - locked (a sun.nio.ch.Util$3) - locked (a java.util.Collections$UnmodifiableSet) - locked (a sun.nio.ch.WindowsSelectorImpl) at sun.nio.ch.SelectorImpl.select(Unknown Source) at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:775) at java.lang.Thread.run(Unknown Source) "http-nio-8080-ClientPoller-0" #19 daemon prio=5 os_prio=0 tid=0x000000001ac0d000 nid=0x2a8c runnable [0x000000002429f000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method) at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source) at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source) at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source) at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source) - locked (a sun.nio.ch.Util$3) - locked (a java.util.Collections$UnmodifiableSet) - locked (a sun.nio.ch.WindowsSelectorImpl) at sun.nio.ch.SelectorImpl.select(Unknown Source) at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:775) at java.lang.Thread.run(Unknown Source) "NioBlockingSelector.BlockPoller-1" #18 daemon prio=5 os_prio=0 tid=0x000000001ac0b800 nid=0x12a0 runnable [0x000000002419e000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method) at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source) at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source) at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source) at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source) - locked (a sun.nio.ch.Util$3) - locked (a java.util.Collections$UnmodifiableSet) - locked (a sun.nio.ch.WindowsSelectorImpl) at sun.nio.ch.SelectorImpl.select(Unknown Source) at org.apache.tomcat.util.net.NioBlockingSelector$BlockPoller.run(NioBlockingSelector.java:339) "Tomcat JDBC Pool Cleaner[791452441:1492674713173]" #17 daemon prio=5 os_prio=0 tid=0x000000001a5ec800 nid=0x2478 in Object.wait() [0x0000000020a1f000] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) at java.util.TimerThread.mainLoop(Unknown Source) - locked (a java.util.TaskQueue) at java.util.TimerThread.run(Unknown Source) "container-0" #16 prio=5 os_prio=0 tid=0x0000000018f8e000 nid=0x1c9c waiting on condition [0x00000000207af000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at org.apache.catalina.core.StandardServer.await(StandardServer.java:427) at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer$1.run(TomcatEmbeddedServletContainer.java:174) "ContainerBackgroundProcessor[StandardEngine[Tomcat]]" #15 daemon prio=5 os_prio=0 tid=0x0000000019690000 nid=0x15a4 waiting on condition [0x00000000206af000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1355) at java.lang.Thread.run(Unknown Source) "Service Thread" #9 daemon prio=9 os_prio=0 tid=0x0000000018cf8800 nid=0x2500 runnable [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C1 CompilerThread2" #8 daemon prio=9 os_prio=2 tid=0x0000000018c86000 nid=0x275c waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C2 CompilerThread1" #7 daemon prio=9 os_prio=2 tid=0x000000001766d800 nid=0x27e8 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C2 CompilerThread0" #6 daemon prio=9 os_prio=2 tid=0x000000001766a800 nid=0x21e0 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x0000000017669000 nid=0x528 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x0000000017668800 nid=0x2a60 runnable [0x0000000000000000] java.lang.Thread.State: RUNNABLE "Finalizer" #3 daemon prio=8 os_prio=1 tid=0x00000000175fa800 nid=0x1e6c in Object.wait() [0x000000001897f000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(Unknown Source) - locked (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(Unknown Source) at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source) "Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x00000000015bf000 nid=0x254c in Object.wait() [0x000000001887e000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(Unknown Source) at java.lang.ref.Reference.tryHandlePending(Unknown Source) - locked (a java.lang.ref.Reference$Lock) at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source) "VM Thread" os_prio=2 tid=0x00000000175d7800 nid=0x2600 runnable "GC task thread#0 (ParallelGC)" os_prio=0 tid=0x00000000014e7000 nid=0x1ca0 runnable "GC task thread#1 (ParallelGC)" os_prio=0 tid=0x00000000014e8800 nid=0x1428 runnable "GC task thread#2 (ParallelGC)" os_prio=0 tid=0x00000000014ea000 nid=0x1950 runnable "GC task thread#3 (ParallelGC)" os_prio=0 tid=0x00000000014ec800 nid=0x10cc runnable "VM Periodic Task Thread" os_prio=2 tid=0x0000000018d55800 nid=0xaec waiting on condition JNI global references: 288 2017-04-20 18:31:47 Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.131-b11 mixed mode): "DestroyJavaVM" #24 prio=5 os_prio=0 tid=0x000000001ac06000 nid=0x2e54 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "http-nio-8080-AsyncTimeout" #22 daemon prio=5 os_prio=0 tid=0x000000001ac09000 nid=0x1e0 waiting on condition [0x000000002459f000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at org.apache.coyote.AbstractProtocol$AsyncTimeout.run(AbstractProtocol.java:1138) at java.lang.Thread.run(Unknown Source) "http-nio-8080-Acceptor-0" #21 daemon prio=5 os_prio=0 tid=0x000000001ac08800 nid=0x2080 runnable [0x000000002449f000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.ServerSocketChannelImpl.accept0(Native Method) at sun.nio.ch.ServerSocketChannelImpl.accept(Unknown Source) at sun.nio.ch.ServerSocketChannelImpl.accept(Unknown Source) - locked <0x00000000e4d21c20> (a java.lang.Object) at org.apache.tomcat.util.net.NioEndpoint$Acceptor.run(NioEndpoint.java:443) at java.lang.Thread.run(Unknown Source) "http-nio-8080-ClientPoller-1" #20 daemon prio=5 os_prio=0 tid=0x000000001ac07800 nid=0x12b8 runnable [0x000000002439f000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method) at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source) at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source) at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source) at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source) - locked <0x00000000e4d221b0> (a sun.nio.ch.Util$3) - locked <0x00000000e4d221a0> (a java.util.Collections$UnmodifiableSet) - locked <0x00000000e4d22040> (a sun.nio.ch.WindowsSelectorImpl) at sun.nio.ch.SelectorImpl.select(Unknown Source) at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:775) at java.lang.Thread.run(Unknown Source) "http-nio-8080-ClientPoller-0" #19 daemon prio=5 os_prio=0 tid=0x000000001ac0d000 nid=0x2a8c runnable [0x000000002429f000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method) at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source) at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source) at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source) at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source) - locked <0x00000000e4d25e00> (a sun.nio.ch.Util$3) - locked <0x00000000e4d25df0> (a java.util.Collections$UnmodifiableSet) - locked <0x00000000e4d25c90> (a sun.nio.ch.WindowsSelectorImpl) at sun.nio.ch.SelectorImpl.select(Unknown Source) at org.apache.tomcat.util.net.NioEndpoint$Poller.run(NioEndpoint.java:775) at java.lang.Thread.run(Unknown Source) "NioBlockingSelector.BlockPoller-1" #18 daemon prio=5 os_prio=0 tid=0x000000001ac0b800 nid=0x12a0 runnable [0x000000002419e000] java.lang.Thread.State: RUNNABLE at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll0(Native Method) at sun.nio.ch.WindowsSelectorImpl$SubSelector.poll(Unknown Source) at sun.nio.ch.WindowsSelectorImpl$SubSelector.access$400(Unknown Source) at sun.nio.ch.WindowsSelectorImpl.doSelect(Unknown Source) at sun.nio.ch.SelectorImpl.lockAndDoSelect(Unknown Source) - locked <0x00000000e4d2a6f0> (a sun.nio.ch.Util$3) - locked <0x00000000e4d2a6e0> (a java.util.Collections$UnmodifiableSet) - locked <0x00000000e4d2a590> (a sun.nio.ch.WindowsSelectorImpl) at sun.nio.ch.SelectorImpl.select(Unknown Source) at org.apache.tomcat.util.net.NioBlockingSelector$BlockPoller.run(NioBlockingSelector.java:339) "Tomcat JDBC Pool Cleaner[791452441:1492674713173]" #17 daemon prio=5 os_prio=0 tid=0x000000001a5ec800 nid=0x2478 in Object.wait() [0x0000000020a1f000] java.lang.Thread.State: TIMED_WAITING (on object monitor) at java.lang.Object.wait(Native Method) at java.util.TimerThread.mainLoop(Unknown Source) - locked <0x0000000081412b20> (a java.util.TaskQueue) at java.util.TimerThread.run(Unknown Source) "container-0" #16 prio=5 os_prio=0 tid=0x0000000018f8e000 nid=0x1c9c waiting on condition [0x00000000207af000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at org.apache.catalina.core.StandardServer.await(StandardServer.java:427) at org.springframework.boot.context.embedded.tomcat.TomcatEmbeddedServletContainer$1.run(TomcatEmbeddedServletContainer.java:174) "ContainerBackgroundProcessor[StandardEngine[Tomcat]]" #15 daemon prio=5 os_prio=0 tid=0x0000000019690000 nid=0x15a4 waiting on condition [0x00000000206af000] java.lang.Thread.State: TIMED_WAITING (sleeping) at java.lang.Thread.sleep(Native Method) at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1355) at java.lang.Thread.run(Unknown Source) "Service Thread" #9 daemon prio=9 os_prio=0 tid=0x0000000018cf8800 nid=0x2500 runnable [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C1 CompilerThread2" #8 daemon prio=9 os_prio=2 tid=0x0000000018c86000 nid=0x275c waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C2 CompilerThread1" #7 daemon prio=9 os_prio=2 tid=0x000000001766d800 nid=0x27e8 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "C2 CompilerThread0" #6 daemon prio=9 os_prio=2 tid=0x000000001766a800 nid=0x21e0 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x0000000017669000 nid=0x528 waiting on condition [0x0000000000000000] java.lang.Thread.State: RUNNABLE "Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x0000000017668800 nid=0x2a60 runnable [0x0000000000000000] java.lang.Thread.State: RUNNABLE "Finalizer" #3 daemon prio=8 os_prio=1 tid=0x00000000175fa800 nid=0x1e6c in Object.wait() [0x000000001897f000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x0000000080bbf448> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(Unknown Source) - locked <0x0000000080bbf448> (a java.lang.ref.ReferenceQueue$Lock) at java.lang.ref.ReferenceQueue.remove(Unknown Source) at java.lang.ref.Finalizer$FinalizerThread.run(Unknown Source) "Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x00000000015bf000 nid=0x254c in Object.wait() [0x000000001887e000] java.lang.Thread.State: WAITING (on object monitor) at java.lang.Object.wait(Native Method) - waiting on <0x0000000080b2dda8> (a java.lang.ref.Reference$Lock) at java.lang.Object.wait(Unknown Source) at java.lang.ref.Reference.tryHandlePending(Unknown Source) - locked <0x0000000080b2dda8> (a java.lang.ref.Reference$Lock) at java.lang.ref.Reference$ReferenceHandler.run(Unknown Source) "VM Thread" os_prio=2 tid=0x00000000175d7800 nid=0x2600 runnable "GC task thread#0 (ParallelGC)" os_prio=0 tid=0x00000000014e7000 nid=0x1ca0 runnable "GC task thread#1 (ParallelGC)" os_prio=0 tid=0x00000000014e8800 nid=0x1428 runnable "GC task thread#2 (ParallelGC)" os_prio=0 tid=0x00000000014ea000 nid=0x1950 runnable "GC task thread#3 (ParallelGC)" os_prio=0 tid=0x00000000014ec800 nid=0x10cc runnable "VM Periodic Task Thread" os_prio=2 tid=0x0000000018d55800 nid=0xaec waiting on condition JNI global references: 288
FinalizerとReference HandlerのオブジェクトIDが同じなのはそんなものらしい。