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

对springbean的方法使用@Cached注解导致获取spingbean上的自定义注解获取不到 #830

Open
ivanmissu opened this issue Oct 16, 2023 · 0 comments

Comments

@ivanmissu
Copy link

我有一个类
@Compoent
@Api //这是自定义注解
public class APerson implements Person {

@Cached(cacheType = CacheType.LOCAL,key = "params[areaCode]",expire = 120)
public void service() {

}

}

然后我业务是在spring启动后会扫描标有Api注解的类
Map<String, Object> classes = event.getApplicationContext().getBeansWithAnnotation(Api.class);

现在问题是 classes 里面获取到了对应的类,但因为是代理类 所以获取的annotation是null
去掉@cached就好了

这是冲突吗

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

1 participant