Caused by: java.lang.VerifyError: Bad invokespecial instruction: current class isn't assignable to reference class.
Exception Details:
Location: org/springframework/cloud/netflix/eureka/EurekaClientAutoConfiguration.setupJmxPort(Lorg/springframework/cloud/netflix/eureka/EurekaInstanceConfigBean;Ljava/lang/Integer;)V @1: invokespecial
Reason:
Error exists in the bytecode
Bytecode:
…………
…………
…………
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2701)
at java.lang.Class.getDeclaredMethods(Class.java:1975)
at org.springframework.util.ReflectionUtils.getDeclaredMethods(ReflectionUtils.java:489)
... 22 common frames omitted
java -jar -javaagent:demo.jar
今天我java -jar -javaagent執(zhí)行一個(gè)jar包的時(shí)候出現(xiàn)如題報(bào)錯(cuò)竭望,具體如上報(bào)錯(cuò)代碼怖辆。網(wǎng)上查了半天是复,換了jdk版本删顶,換了maven依賴庫(kù),各種方式嘗試之后都沒(méi)法解決淑廊,后來(lái)啟動(dòng)命令加了-noverify之后即可運(yùn)行起來(lái)逗余,即:
java -jar -noverify -javaagent:demo.jar
在此記錄一下,至于為何報(bào)錯(cuò)還沒(méi)能找到真正原因季惩,有知道的伙伴也可以留言告知一下录粱,謝謝!