Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keys 使用Spel 时候报错 EL1007E: Property or field 'name' cannot be found on null #15

Open
rellocs opened this issue Jul 14, 2024 · 2 comments

Comments

@rellocs
Copy link

rellocs commented Jul 14, 2024

Enviroment

JDK Version: 21

SpringBoot Version: 3.2.4

DynamicDatasourceStarter Version:

Describe

按照README文档里面的使用方式, 希望通过spel指定keys值,
@Lock4j(name = "MY_NAME", keys = {"#request.name"}, expire = 10000, autoRelease = false)
@PostMapping("/test")
public void test(@RequestBody TestRequest request) {
// other codes
}
带上参数请求接口时候,报以下错误:
EL1007E: Property or field 'name' cannot be found on null

Expected Result: 希望能正确解析到body中的字段作为key的一部分

Actual Result:
EL1007E: Property or field 'name' cannot be found on null

Steps to reproduce

  • Step 1

  • Step 2

  • Step 3

@rellocs
Copy link
Author

rellocs commented Jul 22, 2024

hello 有官方人员跟进么

@huadahuang1983
Copy link

感觉不像是lock4j的问题,有点像没有取到值。如果参数值本身是null,需要校验业务逻辑;如果参数传的没有问题,确定有值,有很大可能是编译的时候没有带-parameters参数,代理类可能取个参数名代替原参数名,导致取到的值为null,出现了上面文本描述的错误。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants