H5W3
当前位置:H5W3 > 其他技术问题 > 正文

main方法执行异常退出程序一直不退出

main方法执行异常退出程序一直不退出

  • 类的静态代码块中抛出了一个RuntimeException,Spring容器启动中断,但是程序一直未终止,不知道什么原因,能不能帮忙分析一下,多谢
  • DestroyJavaVM线程已经启动但在等待Condition
  • main代码

    public static void main(String[] args) {
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("classpath*:/applicationContext.xml");
        System.exit(0);
    } 
C:\Users\admin>jstack 6276
2018-05-11 16:31:22
Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.144-b01 mixed mode):

"logback-3" #38 daemon prio=5 os_prio=0 tid=0x000000002a238000 nid=0x45a4 waiting on condition [0x000000003341e000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000006419b1750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1088)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

"DestroyJavaVM" #37 prio=5 os_prio=0 tid=0x000000002a236800 nid=0x24f4 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"logback-2" #36 daemon prio=5 os_prio=0 tid=0x000000002a235000 nid=0x4228 waiting on condition [0x000000003331e000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000006419b1750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

"CleanCursors-1-thread-1" #35 daemon prio=5 os_prio=0 tid=0x000000002a230000 nid=0x3f34 waiting on condition [0x0000000032fee000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000749073370> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1093)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

"cluster-ClusterId{value='5af5545b908f1f1884936a21', description='null'}-localhost:27017" #34 daemon prio=5 os_prio=0 tid=0x000000002a232000 nid=0x4380 waiting on condition [0x0000000032eee000]
   java.lang.Thread.State: TIMED_WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000748ff2180> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:215)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.awaitNanos(AbstractQueuedSynchronizer.java:2078)
        at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.waitForSignalOrTimeout(DefaultServerMonitor.java:222)
        at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.waitForNext(DefaultServerMonitor.java:203)
        at com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable.run(DefaultServerMonitor.java:151)
        - locked <0x000000074900be50> (a com.mongodb.connection.DefaultServerMonitor$ServerMonitorRunnable)
        at java.lang.Thread.run(Thread.java:748)

"Timer-0" #33 daemon prio=5 os_prio=0 tid=0x000000002a230800 nid=0x2bd0 in Object.wait() [0x0000000032aef000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x00000007874d7e68> (a java.util.TaskQueue)
        at java.util.TimerThread.mainLoop(Timer.java:552)
        - locked <0x00000007874d7e68> (a java.util.TaskQueue)
        at java.util.TimerThread.run(Timer.java:505)

"schedulerFactoryBean_QuartzSchedulerThread" #32 prio=5 os_prio=0 tid=0x000000002a234800 nid=0x1188 in Object.wait() [0x00000000329ef000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.quartz.core.QuartzSchedulerThread.run(QuartzSchedulerThread.java:410)
        - locked <0x00000007874d78f0> (a java.lang.Object)

"schedulerFactoryBean_Worker-10" #31 prio=5 os_prio=0 tid=0x000000002a236000 nid=0x2ad4 in Object.wait() [0x00000000328ef000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
        - locked <0x00000007874d6228> (a java.lang.Object)

"schedulerFactoryBean_Worker-9" #30 prio=5 os_prio=0 tid=0x000000002a233800 nid=0x3da0 in Object.wait() [0x00000000327ef000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
        - locked <0x00000007874d5f30> (a java.lang.Object)

"schedulerFactoryBean_Worker-8" #29 prio=5 os_prio=0 tid=0x000000002d407800 nid=0x2f70 in Object.wait() [0x00000000326ef000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
        - locked <0x00000007874d5c38> (a java.lang.Object)

"schedulerFactoryBean_Worker-7" #28 prio=5 os_prio=0 tid=0x000000002d404800 nid=0x13b4 in Object.wait() [0x00000000325ef000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
        - locked <0x00000007874d5940> (a java.lang.Object)

"schedulerFactoryBean_Worker-6" #27 prio=5 os_prio=0 tid=0x000000002d403000 nid=0x1c74 in Object.wait() [0x00000000324ee000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
        - locked <0x00000007874d5648> (a java.lang.Object)

"schedulerFactoryBean_Worker-5" #26 prio=5 os_prio=0 tid=0x000000002d405000 nid=0x192c in Object.wait() [0x00000000323ef000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
        - locked <0x00000007874d5350> (a java.lang.Object)

"schedulerFactoryBean_Worker-4" #25 prio=5 os_prio=0 tid=0x000000002d400800 nid=0x408c in Object.wait() [0x00000000322ef000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
        - locked <0x00000007874d5058> (a java.lang.Object)

"schedulerFactoryBean_Worker-3" #24 prio=5 os_prio=0 tid=0x000000002d402000 nid=0x27c4 in Object.wait() [0x00000000321ef000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
        - locked <0x00000007874d4d60> (a java.lang.Object)

"schedulerFactoryBean_Worker-2" #23 prio=5 os_prio=0 tid=0x000000002d406000 nid=0x3cb4 in Object.wait() [0x00000000320ef000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
        - locked <0x00000007874d4a68> (a java.lang.Object)

"schedulerFactoryBean_Worker-1" #22 prio=5 os_prio=0 tid=0x000000002d401800 nid=0x2c58 in Object.wait() [0x0000000031fef000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        at org.quartz.simpl.SimpleThreadPool$WorkerThread.run(SimpleThreadPool.java:568)
        - locked <0x00000007874d4770> (a java.lang.Object)

"Druid-ConnectionPool-Destroy-1526482966" #21 daemon prio=5 os_prio=0 tid=0x000000002ae05000 nid=0x3d88 waiting on condition [0x0000000031eef000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2257)

"Druid-ConnectionPool-Create-1526482966" #20 daemon prio=5 os_prio=0 tid=0x000000002ae04000 nid=0x3fac waiting on condition [0x0000000031def000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000642057f68> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2164)

"Druid-ConnectionPool-Destroy-1774014171" #19 daemon prio=5 os_prio=0 tid=0x000000002826d000 nid=0x5cc waiting on condition [0x0000000030d1f000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at com.alibaba.druid.pool.DruidDataSource$DestroyConnectionThread.run(DruidDataSource.java:2257)

"Druid-ConnectionPool-Create-1774014171" #18 daemon prio=5 os_prio=0 tid=0x000000002af00000 nid=0x2260 waiting on condition [0x0000000030c1f000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x0000000641b0b518> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at com.alibaba.druid.pool.DruidDataSource$CreateConnectionThread.run(DruidDataSource.java:2164)

"OracleTimeoutPollingThread" #17 daemon prio=10 os_prio=2 tid=0x000000002c41f000 nid=0x42b0 waiting on condition [0x00000000302af000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
        at java.lang.Thread.sleep(Native Method)
        at oracle.jdbc.driver.OracleTimeoutPollingThread.run(OracleTimeoutPollingThread.java:148)

"oracle.jdbc.driver.BlockSource.ThreadedCachingBlockSource.BlockReleaser" #16 daemon prio=4 os_prio=-1 tid=0x000000002bc27800 nid=0x3f84 in Object.wait() [0x000000002b91e000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x000000064200f348> (a oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource$BlockReleaser)
        at oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource$BlockReleaser.run(BlockSource.java:327)
        - locked <0x000000064200f348> (a oracle.jdbc.driver.BlockSource$ThreadedCachingBlockSource$BlockReleaser)

"logback-1" #15 daemon prio=5 os_prio=0 tid=0x0000000028584800 nid=0x44f4 waiting on condition [0x0000000027e6e000]
   java.lang.Thread.State: WAITING (parking)
        at sun.misc.Unsafe.park(Native Method)
        - parking to wait for  <0x00000006419b1750> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
        at java.util.concurrent.locks.LockSupport.park(LockSupport.java:175)
        at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2039)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:1088)
        at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take(ScheduledThreadPoolExecutor.java:809)
        at java.util.concurrent.ThreadPoolExecutor.getTask(ThreadPoolExecutor.java:1074)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1134)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
        at java.lang.Thread.run(Thread.java:748)

"Service Thread" #13 daemon prio=9 os_prio=0 tid=0x000000002605e000 nid=0x47f0 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C1 CompilerThread3" #12 daemon prio=9 os_prio=2 tid=0x000000002604d000 nid=0xba8 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread2" #11 daemon prio=9 os_prio=2 tid=0x000000002604c000 nid=0x1e9c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread1" #10 daemon prio=9 os_prio=2 tid=0x0000000026049800 nid=0x476c waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"C2 CompilerThread0" #9 daemon prio=9 os_prio=2 tid=0x0000000026046800 nid=0x25c8 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Command Reader" #8 daemon prio=10 os_prio=0 tid=0x000000002545a000 nid=0x2900 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Event Helper Thread" #7 daemon prio=10 os_prio=0 tid=0x0000000025458800 nid=0x2e48 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JDWP Transport Listener: dt_socket" #6 daemon prio=10 os_prio=0 tid=0x00000000234ea800 nid=0x40f4 runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Attach Listener" #5 daemon prio=5 os_prio=2 tid=0x00000000253f4000 nid=0x2dd4 waiting on condition [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Signal Dispatcher" #4 daemon prio=9 os_prio=2 tid=0x00000000253de800 nid=0x18fc runnable [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Finalizer" #3 daemon prio=8 os_prio=1 tid=0x00000000234e3000 nid=0x300c in Object.wait() [0x00000000258af000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x0000000641646c88> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:143)
        - locked <0x0000000641646c88> (a java.lang.ref.ReferenceQueue$Lock)
        at java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:164)
        at java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:209)

"Reference Handler" #2 daemon prio=10 os_prio=2 tid=0x00000000234dc000 nid=0x47f8 in Object.wait() [0x00000000253ae000]
   java.lang.Thread.State: WAITING (on object monitor)
        at java.lang.Object.wait(Native Method)
        - waiting on <0x0000000641647fd8> (a java.lang.ref.Reference$Lock)
        at java.lang.Object.wait(Object.java:502)
        at java.lang.ref.Reference.tryHandlePending(Reference.java:191)
        - locked <0x0000000641647fd8> (a java.lang.ref.Reference$Lock)
        at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:153)

"VM Thread" os_prio=2 tid=0x0000000004f5d000 nid=0x2ccc runnable

"GC task thread#0 (ParallelGC)" os_prio=0 tid=0x0000000004e7c000 nid=0x10e8 runnable

"GC task thread#1 (ParallelGC)" os_prio=0 tid=0x0000000004e7d800 nid=0x1044 runnable

"GC task thread#2 (ParallelGC)" os_prio=0 tid=0x0000000004e7f000 nid=0x3634 runnable

"GC task thread#3 (ParallelGC)" os_prio=0 tid=0x0000000004e80800 nid=0x1120 runnable

"GC task thread#4 (ParallelGC)" os_prio=0 tid=0x0000000004e83800 nid=0x2b20 runnable

"GC task thread#5 (ParallelGC)" os_prio=0 tid=0x0000000004e85000 nid=0x4584 runnable

"GC task thread#6 (ParallelGC)" os_prio=0 tid=0x0000000004e88000 nid=0x1a10 runnable

"GC task thread#7 (ParallelGC)" os_prio=0 tid=0x0000000004e89000 nid=0x2e88 runnable

"VM Periodic Task Thread" os_prio=2 tid=0x0000000026211000 nid=0x4604 waiting on condition

JNI global references: 22095

本文地址:H5W3 » main方法执行异常退出程序一直不退出

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址