You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/07/18 09:41:26 UTC

[GitHub] hsl727261250 commented on issue #2093: dubbo注解service与spring注解service同时在一个类上使用, 无法暴露服务

hsl727261250 commented on issue #2093: dubbo注解service与spring注解service同时在一个类上使用, 无法暴露服务
URL: https://github.com/apache/incubator-dubbo/issues/2093#issuecomment-405873603
 
 
   经过调试发现是lazy-init的原因.
   我的项目指定了全局lazy-init=true, 所以一般情况下spring管理的类都会延迟加载.
   当我单独使用dubbo的service注解时, 该类不由spring管理, 启动时正常加载正常暴露服务.
   当同时使用两个注解时, spring启动时会延迟加载该类, 所以无法暴露服务.
   当同时使用两个注解, 并在其他类中Autowired该类时, 不满足延迟加载条件, 启动时正常加载正常暴露服务.
   
   为什么会同时使用dubbo和spring的service注解? 因为这个服务内部外部都要使用.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org