初次启动应用,一直报如下错误,起初怀疑引入pandora-boot 版本冲突。
Exception in thread "main" java.lang.NoSuchMethodError: com.taobao.pandora.boot.loader.jmx.mbean.Health.registMBean()V
at com.taobao.pandora.boot.loader.ReLaunchMainLauncher.launch(ReLaunchMainLauncher.java:39)
at com.taobao.pandora.boot.PandoraBootstrap.run(PandoraBootstrap.java:41)
at com.cainiao.wmpooc.OOCApplication.main(OOCApplication.java:27)
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:497)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Process finished with exit code 1
方式一:通过mvn tree查看
mvn dependency:tree
方式二:通过在启动过程中查看类文件位置
- 查看Health 具体类路径
查看到具体类路径,辅助分析实际运行路径
或者
Health.class.getProtectionDomain().getCodeSource().getLocation()