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

KeyUtil.getKey() 里面 limitEntity.getLimitType() 空指针异常 #1

Open
hyede opened this issue Oct 12, 2019 · 6 comments
Open

Comments

@hyede
Copy link

hyede commented Oct 12, 2019

java.lang.NullPointerException: null
at io.github.forezp.distributedlimitcore.util.KeyUtil.getKey(KeyUtil.java:20) ~[distributed-limit-core-1.0.4.jar:na]
at io.github.forezp.distributedlimitcore.limit.RedisLimitExcutor.tryAccess(RedisLimitExcutor.java:43) ~[distributed-limit-core-1.0.4.jar:na]
at io.github.forezp.distributedlimitcore.aop.LimitAop.before(LimitAop.java:77) ~[distributed-limit-core-1.0.4.jar:na]
at sun.reflect.GeneratedMethodAccessor526.invoke(Unknown Source) ~[na:na]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:45005) ~[na:1.8.0_112]
at java.lang.reflect.Method.invoke(Method.java:498) ~[na:1.8.0_112]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644) ~[spring-aop-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:626) ~[spring-aop-5.0.5.RELEASE.jar:5.0.5.RELEASE]
at org.springframework.aop.aspectj.AspectJMethodBeforeAdvice.before(AspectJMethodBeforeAdvice.java:44) ~[spring-aop-5.0.5.RELEASE.jar:5.0.5.RELEASE]

@zhengjianfeng1103
Copy link

limit.type = redis/local 你需要在配置文件一下

@Xiaoah
Copy link

Xiaoah commented Aug 19, 2020

已经在配置文件配置了,但还是报了空指针异常

@docvirt
Copy link

docvirt commented Oct 19, 2020

解决了吗

已经在配置文件配置了,但还是报了空指针异常

@hdtopku
Copy link

hdtopku commented Jan 26, 2021

同遇到

@YczYanchengzhe
Copy link

我也遇到了这个问题, 通过查看官方的example,发现需要在配置文件中指定限制规则 ;

limit.filter=true
limit.rule.url.num=100
limit.rule.url.seconds=2
limit.rule.identifier.key=userId

上面会按照url的规则来拦截 ,希望能够提供一个默认的拦截方式,否则如果不配置会出现上面的NPE问题

@liuyi-stack
Copy link

我配置了,还是空指针
image

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

7 participants