chaosblade-io / chaosblade

An easy to use and powerful chaos engineering experiment toolkit.(阿里巴巴开源的一款简单易用、功能强大的混沌实验注入工具)
https://chaosblade.io
Apache License 2.0
5.86k stars 934 forks source link

Exception when jvm return value to false #1006

Open yldylg opened 4 months ago

yldylg commented 4 months ago

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
  2. Request the corresponding HTTP interface of com.example.controller.DubboController.

Tell us your environment

CentOS 7

Anything else we need to know?

MandssS commented 4 days ago

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