> 去除掉dubbo是能够访问到的,我刚才测试了下,发现当使用@Refrence注解和dubbo:annotation标签扫描时,Controller类的构造方法没有被执行即该Controller没有被实例化,而当我使用dubbo:refrence标签和context:component-scan组件扫描时这个Controller是能够被实例化并可以正常访问的。难道dubbo:annotation标签不支持扫描@RestController和@controller?好像dubbox是支持的,dubbo不是已经合并了dubbox的代码吗?

`<dubbo:annotation>` 仅仅负责扫描 dubbo 自己相关的类,也就是有 @Reference 和 @Service 注解的类。其他的 
spring 的类是不会扫描的。你的工程使用的是 spring 的 rest,需要结合 `<context:component-scan>` 来触发 
spring 自己的扫描。

当当的 dubbox 中 REST 相关的注解之所以可以工作,是因为 dubbo 框架集成了 resteasy,由 resteasy 负责扫描的 JAX-RS 
的标准注解。

[ Full content available at: 
https://github.com/apache/incubator-dubbo/issues/2044 ]
This message was relayed via gitbox.apache.org for 
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to