GuanceCloud / dd-trace-java

Datadog APM client for Java
https://docs.datadoghq.com/tracing/languages/java
Apache License 2.0
9 stars 3 forks source link

java.lang.VerifyError: Bad return type #71

Closed lrwh closed 4 months ago

lrwh commented 7 months ago

ddtrace与其他探针使用冲突,导致业务异常,部分异常信息如下:

2023-12-12 14:24:26.273 [http-nio-0.0.0.0-8080-exec-9] ERROR org.apache.coyote.http11.Http11Processor - Error processing request
java.lang.VerifyError: Bad return type
Exception Details:
  Location:
    org/apache/catalina/connector/Request.getReader()Ljava/io/BufferedReader; @473: areturn
  Reason:
    Type 'java/lang/Object' (current frame, stack[0]) is not assignable to 'java/io/BufferedReader' (from method signature)
  Current Frame:
    bci: @473
    flags: { }
    locals: { 'org/apache/catalina/connector/Request', '[I', integer, '[Ljava/lang/Object;', 'datadog/trace/api/gateway/RequestContext', 'java/lang/Object' }
    stack: { 'java/lang/Object' }
  Bytecode:
    0x0000000: 014c 033d 014e b209 3a99 0021 b809 4059
    0x0000010: 4c03 2e10 087e 9a00 142b 04b8 0944 3d1c
    0x0000020: 067e 9900 0803 bd03 2b4e 013a 042a 3a05
    0x0000030: 0019 05b4 0019 9900 13bb 046b 59b2 0064
    0x0000040: 12b6 b600 66b7 00a1 bf19 05b4 0046 b600
    0x0000050: 95c7 0024 1905 b600 963a 0619 06c6 0018
    0x0000060: 1906 b900 9701 003a 0719 07c6 000a 1905
    0x0000070: 1907 b600 b719 0504 b500 1a19 05b4 0012
    0x0000080: b600 b819 05b4 0018 c700 1419 05bb 0016
    0x0000090: 5919 05b4 0012 b700 17b5 0018 1905 b400
    0x00000a0: 18a7 0003 3a05 b808 a559 c600 e5b9 08a9
    0x00000b0: 0100 59c6 00dc 59b2 08af b908 b302 00c6
lrwh commented 7 months ago

类似的异常

Caused by : java . lang . VerifyError : Bad return type Exception Details :
 Location :
 org / apache / catalina / connector / Request . getInputStream () Ljavax / servlet / ServletInputStream ;@314:areturn Reason :
 Type ' java / lang / Object '( current frame , stack [0]) is not assignable to ' javax / servlet / ServletInputStream '( from method signatu re )
 Current Frame :
 bci :@314
 flags :{}
 locals :{' org / apache / catalina / connector / Request ',' datadog / trace / api / gateway / RequestContext ',' java / lang / Object '} stack :{' java / lang /0bject'}
 Bytecode :
lrwh commented 7 months ago

通过启动指定参数处理:

-Ddd.integration.servlet-request-body.enbaled=false

export DD_INTEGRATION_SERVLET_REQEUST_BODY_ENABLED=FALSE