You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "songlongkuan (via GitHub)" <gi...@apache.org> on 2023/05/16 10:28:45 UTC

[GitHub] [dubbo] songlongkuan opened a new issue, #12330: rest service Path no found,

songlongkuan opened a new issue, #12330:
URL: https://github.com/apache/dubbo/issues/12330

   <!-- 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.0
   * Operating System version: Mac os 13
   * Java version: openjdk 1.8
   
   ### Steps to reproduce this issue
   
   1. 提供者定义接口
   @Path("person")
   public interface PersonService {
   
       @GET // #3
       @Path("{id: \\d+}")
       String getUser(@PathParam("id") Long id);
   
       @GET
       @Path("getPerson")
       String getPerson(@QueryParam("source") String source);
   }
   
   2.提供者实现类
   @DubboService(interfaceClass = PersonService.class, protocol = {"rest", "dubbo"},version = "1.0.0",group = "dubbo-provider")
   public class DubboPersonServiceImpl implements PersonService {
   
       @Override
       public String getUser(Long id) {
           return String.valueOf(id);
       }
   
       @Override
       public String getPerson(String source) {
           return source;
       }
   }
   3. 配置文件
   dubbo:
     registry:
       protocol: zookeeper
       address: 127.0.0.1:2181
     protocol:
       rest:
         name: rest
         port: 9001
       dubbo:
         name: dubbo
         port: 8001
     consumer:
       version: 1.0.0
       timeout: 10000
       retries: 0
       check: false
     provider:
       version: 1.0.0
       group: dubbo-provider
       validation: false
     application:
       name: dubbo-provider
   
   4.. 发起curl请求
   
   curl --location --request GET 'localhost:9001/person/getPerson' \
   --header 'rest-service-version: 1.0.0' \
   --header 'rest-service-group: dubbo-provider' \
   --header 'version: 1.0.0' \
   --header 'group: dubbo-provider' \
   --header 'Content-Type: application/x-www-form-urlencoded' \
   --data-urlencode 'source=postman' \
   --data-urlencode 'version=1.0.0'
   
   响应结果是错误的:
   rest service Path no found, current path info:PathMatcher{path='/person/getPerson', version='null', group='null', port=null, hasPathVariable=false, contextPath='null'}
   
   他应该调用到getPerson接口的,但是一直调用不到
   
   ### Expected Behavior
   
   <!-- What do you expect from the above steps?-->
   
   ### Actual Behavior
   
   <!-- What actually happens? -->
   
   If there is an exception, please attach the exception trace:
   
   ```
   rest service Path no found, current path info:PathMatcher{path='/person/getPerson', version='null', group='null', port=null, hasPathVariable=false, contextPath='null'}
   ```
   


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


[GitHub] [dubbo] suncairong163 commented on issue #12330: rest service Path no found,

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

   org.apache.dubbo.rpc.protocol.rest.constans.RestConstant#REST_HEADER_PREFIX  可以看一下这个字段的值吗, 最近把之前的
   #rest#前缀改成了  rest-service-  
   这个pr https://github.com/apache/dubbo/pull/12275


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


[GitHub] [dubbo] AlbumenJ commented on issue #12330: rest service Path no found,

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

   @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


[GitHub] [dubbo] songlongkuan commented on issue #12330: rest service Path no found,

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

   这段代码已经删掉了,最后我把postman请求头groupId,version 都删掉反而好了,dubbo提供者也把groupId、version删掉


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


[GitHub] [dubbo] songlongkuan closed issue #12330: rest service Path no found,

Posted by "songlongkuan (via GitHub)" <gi...@apache.org>.
songlongkuan closed issue #12330:  rest service Path no found,
URL: https://github.com/apache/dubbo/issues/12330


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