Exception in thread “main” java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:108)
at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
Caused by: java.lang.IllegalStateException: Expected the service PushConsumerImpl [FAILED] to be RUNNING, but the service has FAILED
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractService.checkCurrentState(AbstractService.java:381)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractService.awaitRunning(AbstractService.java:305)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractIdleService.awaitRunning(AbstractIdleService.java:165)
at org.apache.rocketmq.client.java.impl.consumer.PushConsumerBuilderImpl.build(PushConsumerBuilderImpl.java:128)
at com.osd.ynwrkj.OrganizationApplication.main(OrganizationApplication.java:57)
… 8 more
Caused by: java.lang.NullPointerException
at org.apache.rocketmq.client.java.impl.consumer.PushConsumerImpl.shutDown(PushConsumerImpl.java:190)
at org.apache.rocketmq.client.java.impl.consumer.PushConsumerImpl.startUp(PushConsumerImpl.java:178)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.AbstractIdleService$DelegateService$1.run(AbstractIdleService.java:62)
at org.apache.rocketmq.shaded.com.google.common.util.concurrent.Callables.lambda$threadRenaming$3(Callables.java:103)
at java.lang.Thread.run(Thread.java:750)
https://developer.aliyun.com/ask/480595?spm=5176.21213303.J_6704733920.10.795953c9ALCbGh&scm=20140722.S_community%40%40%E9%97%AE%E7%AD%94%40%40480595._.ID_community%40%40%E9%97%AE%E7%AD%94%40%40480595-RL_PushConsumerImpl-LOC_main-OR_ser-V_2-P0_1
这里有个同样的问题呢,我看到有人回答了:
根据错误信息来看的话,首先来看最明显的错误信息java.lang.NullPointerException,在PushConsumerImpl.java类的190行报空指针异常,也就是程序在执行PushConsumerImpl.shutDown()的时候报空指针,那么首先你检查一下PushConsumerImpl对象是否为空,debug排查程序中什么操作导致PushConsumerImpl对象为空。
如果没有解决问题,能不能把代码段po一下看看呢?