You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Liu-YanP (via GitHub)" <gi...@apache.org> on 2023/10/11 12:48:29 UTC

[I] 使用rest协议,当path注解在接口上,并且实现类有切面生成动态代理类时,doublePathCheck()会报错 [dubbo]

Liu-YanP opened a new issue, #13187:
URL: https://github.com/apache/dubbo/issues/13187

   <!-- If you need to report a security issue please visit https://github.com/apache/dubbo/security/policy -->
   
   - [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
   
   ### Environment
   
   * Dubbo version: 3.2.6
   * Operating System version: win11
   * Java version: jdk 11
   
   ### Steps to reproduce this issue
   
   1. 使用dubbo rest协议
   2. @path @post等注解标注在接口上
   3. 实现类方法有切面,生成动态代理类
   
   Pls. provide [GitHub address] to reproduce this issue.
   
   If there is an exception, please attach the exception trace:
   
   ```
   Caused by: java.lang.IllegalArgumentException: dubbo rest metadata resolve double path error,and do not  contain path variable  is: PathMatcher{path='/api/XXXXX, codeStyle=class org.apache.dubbo.metadata.rest.jaxrs.JAXRSServiceRestMetadataResolver}
   	at org.apache.dubbo.metadata.rest.ServiceRestMetadata.doublePathCheck(ServiceRestMetadata.java:149)
   	at org.apache.dubbo.metadata.rest.ServiceRestMetadata.addPathToServiceMap(ServiceRestMetadata.java:134)
   	at org.apache.dubbo.metadata.rest.ServiceRestMetadata.addRestMethodMetadata(ServiceRestMetadata.java:115)
   	at org.apache.dubbo.metadata.rest.AbstractServiceRestMetadataResolver.processRestMethodMetadata(AbstractServiceRestMetadataResolver.java:302)
   	at org.apache.dubbo.metadata.rest.AbstractServiceRestMetadataResolver.processAllRestMethodMetadata(AbstractServiceRestMetadataResolver.java:159)
   	at org.apache.dubbo.metadata.rest.AbstractServiceRestMetadataResolver.resolve(AbstractServiceRestMetadataResolver.java:121)
   	at org.apache.dubbo.rpc.protocol.rest.annotation.metadata.MetadataResolver.resolveProviderServiceMetadata(MetadataResolver.java:63)
   	at org.apache.dubbo.rpc.protocol.rest.RestProtocol.export(RestProtocol.java:89)
   	at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:83)
   	at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:79)
   	at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:73)
   	at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:61)
   	at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:47)
   	at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.export(InvokerCountWrapper.java:42)
   	at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java)
   	at org.apache.dubbo.registry.integration.RegistryProtocol.lambda$doLocalExport$5(RegistryProtocol.java:333)
   	at org.apache.dubbo.registry.integration.ExporterFactory.lambda$createExporter$0(ExporterFactory.java:32)
   	... 39 more
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [I] 使用rest协议,当path注解在接口上,并且实现类有切面生成动态代理类时,doublePathCheck()会报错 [dubbo]

Posted by "Liu-YanP (via GitHub)" <gi...@apache.org>.
Liu-YanP commented on issue #13187:
URL: https://github.com/apache/dubbo/issues/13187#issuecomment-1757631700

   `resolveServiceMethodsMap(serviceType, serviceInterfaceClass);`中使用了
   `getAllMethods(serviceType, excludedDeclaredClass(Object.class) `
   方法返回代理类方法、以及目标类方法。但是path注解在接口上,因此实现类找不到path注解,便都去 
   `Method declaredServiceMethod = entry.getValue();` 接口类查找注册,因此会找两次,两次都是同一接口相同的path


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [I] 使用rest协议,当path注解在接口上,并且实现类有切面生成动态代理类时,doublePathCheck()会报错 [dubbo]

Posted by "Liu-YanP (via GitHub)" <gi...@apache.org>.
Liu-YanP commented on issue #13187:
URL: https://github.com/apache/dubbo/issues/13187#issuecomment-1759603307

   ![image](https://github.com/apache/dubbo/assets/24852616/70e76bb5-b055-416e-99b0-7953dc5bdc2c)
   这里为什么要注释掉, 找到了两个继承同一标有path接口的方法。从而导致错误


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [I] 使用rest协议,当path注解在接口上,并且实现类有切面生成动态代理类时,doublePathCheck()会报错 [dubbo]

Posted by "AlbumenJ (via GitHub)" <gi...@apache.org>.
AlbumenJ commented on issue #13187:
URL: https://github.com/apache/dubbo/issues/13187#issuecomment-1761225599

   @suncairong163 PTAL


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [I] 使用rest协议,当path注解在接口上,并且实现类有切面生成动态代理类时,doublePathCheck()会报错 [dubbo]

Posted by "CrazyHZM (via GitHub)" <gi...@apache.org>.
CrazyHZM closed issue #13187: 使用rest协议,当path注解在接口上,并且实现类有切面生成动态代理类时,doublePathCheck()会报错
URL: https://github.com/apache/dubbo/issues/13187


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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


Re: [I] 使用rest协议,当path注解在接口上,并且实现类有切面生成动态代理类时,doublePathCheck()会报错 [dubbo]

Posted by "Liu-YanP (via GitHub)" <gi...@apache.org>.
Liu-YanP commented on issue #13187:
URL: https://github.com/apache/dubbo/issues/13187#issuecomment-1762506480

   ![image](https://github.com/apache/dubbo/assets/24852616/f52ea363-ed7f-44a1-b578-4af629d8206c)
   3.2.6版本为什么只有netty了,之前的都不兼容了


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


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