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/07 16:16:34 UTC

[GitHub] SkyDriveCN opened a new issue #2044: dubbo:annotation标签在消费者端无法实例化Controller

SkyDriveCN opened a new issue #2044: dubbo:annotation标签在消费者端无法实例化Controller
URL: https://github.com/apache/incubator-dubbo/issues/2044
 
 
   您好,我使用dubbo2.6.2版本时在服务端使用**dubbo:annotation**标签能够正常将服务注册到zookeeper。
   但是在消费端使用**dubbo:annotation**标签扫描controller类所在包时,访问该controller中的方法一直404,改成使用dubbo:reference标签引用服务就可以了。请问这个问题是由什么原因造成的?
   **这是服务端的配置:**
   ![1](https://user-images.githubusercontent.com/23717846/42412599-e38fc7c6-8241-11e8-8d43-53b827b31184.png)
   ![image](https://user-images.githubusercontent.com/23717846/42412607-0a7d7aae-8242-11e8-9f51-5794ac6d9788.png)
   ![image](https://user-images.githubusercontent.com/23717846/42412610-23f7d5a6-8242-11e8-84b9-05c87cf7f513.png)
   **这是消费端的配置:**
   ![image](https://user-images.githubusercontent.com/23717846/42412665-31114186-8243-11e8-928c-31cc3f7f3684.png)
   ![image](https://user-images.githubusercontent.com/23717846/42412673-5d07fc44-8243-11e8-9149-3d92f10408a3.png)
   ![image](https://user-images.githubusercontent.com/23717846/42412678-836dcd8c-8243-11e8-9284-257005feb092.png)
   **这是访问结果:**
   ![image](https://user-images.githubusercontent.com/23717846/42412696-d849a326-8243-11e8-976a-382e5e999b7b.png)
   
   **这是消费端启动时的SpringMVC日志:**
   `信息: Initializing Spring FrameworkServlet 'dispatcherServlet'
   [INFO] Refreshing WebApplicationContext for namespace 'dispatcherServlet-servlet': startup date [Sun Jul 08 00:10:28 CST 2018]; root of context hierarchy
   [INFO] Loading XML bean definitions from class path resource [spring-servlet.xml]
   00:10:28,752  INFO LoggerFactory:? - using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter
   00:10:28,868  INFO ServiceAnnotationBeanPostProcessor:190 -  [DUBBO] BeanNameGenerator bean can't be found in BeanFactory with name [org.springframework.context.annotation.internalConfigurationBeanNameGenerator], dubbo version: 2.6.2, current host: 192.168.110.2
   00:10:28,869  INFO ServiceAnnotationBeanPostProcessor:192 -  [DUBBO] BeanNameGenerator will be a instance of org.springframework.context.annotation.AnnotationBeanNameGenerator , it maybe a potential problem on bean name generation., dubbo version: 2.6.2, current host: 192.168.110.2
   00:10:28,898  WARN ServiceAnnotationBeanPostProcessor:155 -  [DUBBO] No Spring Bean annotating Dubbo's @Service was found under package[com.pinyougou.controller], dubbo version: 2.6.2, current host: 192.168.110.2
   [INFO] JSR-330 'javax.inject.Inject' annotation found and supported for autowiring
   [INFO] Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcherServlet-servlet': startup date [Sun Jul 08 00:10:28 CST 2018]; root of context hierarchy
   [INFO] Looking for @ControllerAdvice: WebApplicationContext for namespace 'dispatcherServlet-servlet': startup date [Sun Jul 08 00:10:28 CST 2018]; root of context hierarchy
   [INFO] Mapped URL path [/**] onto handler 'org.springframework.web.servlet.resource.DefaultServletHttpRequestHandler#0'
   [INFO] FrameworkServlet 'dispatcherServlet': initialization completed in 996 ms`

----------------------------------------------------------------
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