chaosblade icon indicating copy to clipboard operation
chaosblade copied to clipboard

Exception when jvm return value to false

Open yldylg opened this issue 1 year ago • 1 comments

Issue Description

Type: bug report

Describe what happened (or what feature you want)

When chaosblade simulates a return value and the return value is false, it will throw a NullPointerException, for example, running the following command

blade c jvm return --value false --classname com.example.controller.DubboController --methodname hello --process tomcat

The injected service will throw a NullPointerException.

After investigation, it was found that the createUrl method of chaosblade's jvm Executor ignored the parameter with a value of false. image

Describe what you expected to happen

Pass the "false" value to the chaosblade-java-agent and then within the specific function inside chaosblade-java-agent, perform a check to determine if the "false" value is necessary.

How to reproduce it (as minimally and precisely as possible)

  1. Run command
blade c jvm return --value false --classname com.example.controller.DubboController --methodname hello --process tomcat
  1. Request the corresponding HTTP interface of com.example.controller.DubboController.

Tell us your environment

CentOS 7

Anything else we need to know?

yldylg avatar Mar 06 '24 12:03 yldylg

Do you run command blade p jvm --pid ** before ?

MandssS avatar Jul 12 '24 05:07 MandssS