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

注解方式注册服务,在服务包裹事务的情况下,服务注册失败. #1

Closed
xuxueli opened this issue Dec 28, 2015 · 1 comment

Comments

@xuxueli
Copy link
Owner

xuxueli commented Dec 28, 2015

注解方式注册服务,在服务包裹事务的情况下,服务注册失败.

@xuxueli
Copy link
Owner Author

xuxueli commented Dec 28, 2015

报错类:NetComServerFactory.java 行数:85
String interfaceName = serviceBean.getClass().getAnnotation(SkeletonService.class).stub().getName();
serviceMap.put(interfaceName, serviceBean);

报错原因:Spring针对事务会对Bean创建事务代理,因此通过简单的.getAnnotation(SkeletonService.class)将不会获取的到服务上的SkeletonService注解;

解决方法:在服务注解上加“@inherited”,此时SkeletonService将会被子事务代理所继承,.getAnnotation(SkeletonService.class)因此会获取到原服务的SkeletonService服务注解;

(此修复对用户透明)

@xuxueli xuxueli closed this as completed Dec 28, 2015
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