bytekit icon indicating copy to clipboard operation
bytekit copied to clipboard

目标类的target是 jdk 1.6,然后使用jdk 1.8来编译instrument类,可能会出现下面的错误

Open hengyunabc opened this issue 4 years ago • 1 comments

记录一下:

Exception in thread "main" java.lang.VerifyError: Illegal type at constant pool entry 328 in class org.apache.http.impl.client.InternalHttpClient
Exception Details:
  Location:
    org/apache/http/impl/client/InternalHttpClient.doExecute(Lorg/apache/http/HttpHost;Lorg/apache/http/HttpRequest;Lorg/apache/http/protocol/HttpContext;)Lorg/apache/http/client/methods/CloseableHttpResponse; @29: invokestatic
  Reason:
    Constant pool index 328 is invalid
  Bytecode:
    0000000: b201 2dbb 012f 59b7 0130 1301 32b6 0136
    0000010: 2bb6 0139 b601 36b6 013c b601 42b8 0148
    0000020: 572a 2b2c 2d3a 073a 063a 053a 0419 0612
    0000030: 22b8 0007 5701 3a08 1906 c100 8299 000a
    0000040: 1906 c000 823a 0819 0619 05b8 0024 3a09
    0000050: 1907 c600 0819 07a7 000a bb00 2559 b700
    0000060: 26b8 0027 3a0a 013a 0b19 06c1 0028 9900
    0000070: 0f19 06c0 0028 b900 2901 003a 0b19 0bc7
    0000080: 0041 1906 b900 1201 003a 0c19 0cc1 002a
    0000090: 9900 2419 0cc0 002a b900 2b01 00b9 002c
    00000a0: 0100 9a00 1e19 0c19 04b4 0010 b800 2d3a
    00000b0: 0ba7 000f 190c 1904 b400 10b8 002d 3a0b
    00000c0: 190b c600 0a19 0a19 0bb6 002e 1904 190a
    00000d0: b700 2f19 0419 0519 0919 0ab7 0030 3a0c
    00000e0: 1904 b400 0a19 0c19 0919 0a19 08b9 0031
    00000f0: 0500 a700 0f3a 09bb 0033 5919 09b7 0034
    0000100: bfb0                                   
  Exception Handler Table:
    bci [71, 242] => handler: 245
  Stackmap Table:
    full_frame(@71,{Object[#136],Object[#111],Object[#186],Object[#132],Object[#136],Object[#111],Object[#186],Object[#132],Object[#130]},{})
    append_frame(@90,Object[#207])
    same_locals_1_stack_item_frame(@97,Object[#132])
    append_frame(@125,Object[#195],Object[#134])
    append_frame(@180,Object[#189])
    chop_frame(@192,1)
    same_frame(@204)
    full_frame(@245,{Object[#136],Object[#111],Object[#186],Object[#132],Object[#136],Object[#111],Object[#186],Object[#132],Object[#130]},{Object[#138]})
    full_frame(@257,{Object[#136],Object[#111],Object[#186],Object[#132],Object[#136],Object[#111],Object[#186],Object[#132],Object[#130],Object[#207],Object[#195],Object[#134],Object[#330]},{Object[#332]})

	at org.apache.http.impl.client.HttpClientBuilder.build(HttpClientBuilder.java:1250)
	at org.apache.http.impl.client.HttpClients.createDefault(HttpClients.java:56)
	at com.trace.demo.httpclient.TTT.test(TTT.java:22)
	at com.trace.demo.httpclient.HttpClientDemo.main(HttpClientDemo.java:21)

hengyunabc avatar Sep 13 '21 13:09 hengyunabc

I'm not sure why this is supposed to work. doesn't seem an issue to me.

zinking avatar May 19 '22 13:05 zinking