Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] Doubb 3 trip 协议 出现Duplicate mapping for '/role/{id}' 错误 #14359

Closed
4 tasks done
smalltalkhyb opened this issue Jun 22, 2024 · 1 comment
Closed
4 tasks done
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage

Comments

@smalltalkhyb
Copy link

Pre-check

  • I am sure that all the content I provide is in English.

Search before asking

  • I had searched in the issues and found no similar issues.

Apache Dubbo Component

Java SDK (apache/dubbo)

Dubbo Version

JDK17
Dubbo 3.3.0-beta.2

Steps to reproduce this issue

定义接口:RoleService

@RequestMapping("/role")
public interface RoleService {
/**
* 新建角色
* @param request
*/
@PostMapping
Long create(@requestbody @Valid CreateRoleRequest request);

/**
 * 修改角色
 * @param request
 */
@PutMapping
void update(@RequestBody @Valid UpdateRoleRequest request);

/**
 * 删除角色
 * @param id
 */
@DeleteMapping("/{id}")
void delete(@PathVariable(value = "id") Long id);

/**
 * 根据id查询角色
 * @param id
 * @return
 */
@GetMapping("/{id}")
RoleResponse byId(@PathVariable(value = "id") Long id);

/**
 * 角色所有数据查询
 */
@GetMapping
List<RoleResponse> list();

/**
 * 角色分页数据查询
 * @param pageIndex
 * @param pageSize
 * @return
 */
@GetMapping("/page")
PageResult<RoleResponse> pageList(
        @RequestParam(value = "page", defaultValue = "1") Long pageIndex,
        @RequestParam(value = "size", defaultValue = "10") Long pageSize);

/**
 * 角色分页数据查询
 * @param request
 */
@PostMapping("/query")
PageResult<RoleResponse> pageList(@RequestBody @Valid RolePageRequest request);

}

实现类RoleServiceImpl

@slf4j
@service
@DubboService(interfaceClass = RoleService.class)
public class RoleServiceImpl implements RoleService {
@Autowired
private RoleCommandServiceImpl roleCommandService;

@Autowired
private RoleQueryServiceImpl roleQueryService;

@Override
public Long create(CreateRoleRequest request) {
    return roleCommandService.create(request);
}

@Override
public void update(UpdateRoleRequest request) {
    roleCommandService.update(request);
}

@Override
public void delete(Long id) {
    roleCommandService.delete(id);
}

@Override
public RoleResponse byId(Long id) {
    return roleQueryService.byId(id);
}

@Override
public List<RoleResponse> list() {
    return roleQueryService.list();
}

@Override
public PageResult<RoleResponse> pageList(Long pageIndex, Long pageSize) {
    return roleQueryService.pageList(pageIndex, pageSize);
}

@Override
public PageResult<RoleResponse> pageList(RolePageRequest request) {
    return roleQueryService.pageList(request);
}

}

配置Dubbo

dubbo:
protocol:
name: tri
serialization: fastjson2

provider:

delay: -1

application:
name: dubbo-provider-${spring.application.name}

qos-enable: true

manual-register: true

registry:

register: false

check: false

use-as-config-center: false
use-as-metadata-center: false
address: nacos://${spring.cloud.nacos.discovery.server-addr}
parameters:
  accessKey: ${spring.cloud.nacos.discovery.accessKey}
  secretKey: ${spring.cloud.nacos.discovery.secretKey}
  namespace: ${spring.cloud.nacos.discovery.namespace}

shutdown:
timeout: 60
step-timeout: 3
consumer-update-wait-time: 3
internal-signal: true
offline-request-window-timeout: 0
#关闭dubbo默认检查提供者是否可用(解决必须先启动提供者后启动消费者)
consumer:
check: false
timeout: 10000
retries: 2

What you expected to happen

2024-06-22 22:28:26,087 [ERROR] [[main]] [TRACEID:] [{}] [o.a.d.c.d.DefaultModuleDeployer:126]: [DUBBO] Model start failed: Dubbo Module[1.1.1] start failed: org.apache.dubbo.rpc.protocol.tri.rest.RestInitializeException: Duplicate mapping for '/role/{id}': current=RequestMapping{name='RoleServiceImpl#delete', pathCondition=PathCondition{paths=[/role/{id}]}, methodsCondition=MethodsCondition{methods=[DELETE]}, customCondition=ServiceVersionCondition{group='null', version='null'}}, exists=RequestMapping{name='RoleServiceImpl#byId', pathCondition=PathCondition{paths=[/role/{id}]}, methodsCondition=MethodsCondition{methods=[GET]}, customCondition=ServiceVersionCondition{group='null', version='null'}}, dubbo version: 3.3.0-beta.2, current host: 192.168.8.22, error code: 5-14. This may be caused by , go to https://dubbo.apache.org/faq/5/14 to find instructions.
org.apache.dubbo.rpc.protocol.tri.rest.RestInitializeException: Duplicate mapping for '/role/{id}': current=RequestMapping{name='RoleServiceImpl#delete', pathCondition=PathCondition{paths=[/role/{id}]}, methodsCondition=MethodsCondition{methods=[DELETE]}, customCondition=ServiceVersionCondition{group='null', version='null'}}, exists=RequestMapping{name='RoleServiceImpl#byId', pathCondition=PathCondition{paths=[/role/{id}]}, methodsCondition=MethodsCondition{methods=[GET]}, customCondition=ServiceVersionCondition{group='null', version='null'}}
at org.apache.dubbo.rpc.protocol.tri.rest.mapping.DefaultRequestMappingRegistry.register0(DefaultRequestMappingRegistry.java:96) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.tri.rest.mapping.DefaultRequestMappingRegistry.lambda$register$0(DefaultRequestMappingRegistry.java:81) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.tri.rest.util.MethodWalker.lambda$walk$0(MethodWalker.java:45) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.tri.rest.mapping.DefaultRequestMappingRegistry.lambda$register$1(DefaultRequestMappingRegistry.java:72) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.tri.rest.util.MethodWalker.walk(MethodWalker.java:43) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.tri.rest.mapping.DefaultRequestMappingRegistry.register(DefaultRequestMappingRegistry.java:63) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.tri.TripleProtocol.export(TripleProtocol.java:147) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:78) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:79) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:84) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:61) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:50) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.export(InvokerCountWrapper.java:42) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.doExportUrl(ServiceConfig.java:969) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.exportRemote(ServiceConfig.java:948) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.exportUrl(ServiceConfig.java:876) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:622) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:600) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:555) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:341) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServiceInternal(DefaultModuleDeployer.java:495) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServices(DefaultModuleDeployer.java:442) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:177) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:159) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:167) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:153) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:413) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:370) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:937) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:587) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.4.jar:3.0.4]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[spring-boot-3.0.4.jar:3.0.4]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-3.0.4.jar:3.0.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[spring-boot-3.0.4.jar:3.0.4]
at cn.itbox.uap.demo.org.application.OrgDemoApplication.main(OrgDemoApplication.java:37) ~[classes/:?]
2024-06-22 22:28:26,087 [ERROR] [[main]] [TRACEID:] [{}] [o.a.d.c.d.DefaultApplicationDeployer:126]: [DUBBO] Dubbo Application1.1 found failed module: Dubbo Module[1.1.1], dubbo version: 3.3.0-beta.2, current host: 192.168.8.22, error code: 5-14. This may be caused by , go to https://dubbo.apache.org/faq/5/14 to find instructions.
org.apache.dubbo.rpc.protocol.tri.rest.RestInitializeException: Duplicate mapping for '/role/{id}': current=RequestMapping{name='RoleServiceImpl#delete', pathCondition=PathCondition{paths=[/role/{id}]}, methodsCondition=MethodsCondition{methods=[DELETE]}, customCondition=ServiceVersionCondition{group='null', version='null'}}, exists=RequestMapping{name='RoleServiceImpl#byId', pathCondition=PathCondition{paths=[/role/{id}]}, methodsCondition=MethodsCondition{methods=[GET]}, customCondition=ServiceVersionCondition{group='null', version='null'}}
at org.apache.dubbo.rpc.protocol.tri.rest.mapping.DefaultRequestMappingRegistry.register0(DefaultRequestMappingRegistry.java:96) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.tri.rest.mapping.DefaultRequestMappingRegistry.lambda$register$0(DefaultRequestMappingRegistry.java:81) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.tri.rest.util.MethodWalker.lambda$walk$0(MethodWalker.java:45) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.tri.rest.mapping.DefaultRequestMappingRegistry.lambda$register$1(DefaultRequestMappingRegistry.java:72) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.tri.rest.util.MethodWalker.walk(MethodWalker.java:43) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.tri.rest.mapping.DefaultRequestMappingRegistry.register(DefaultRequestMappingRegistry.java:63) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.tri.TripleProtocol.export(TripleProtocol.java:147) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.ProtocolListenerWrapper.export(ProtocolListenerWrapper.java:78) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.qos.protocol.QosProtocolWrapper.export(QosProtocolWrapper.java:79) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.ProtocolSecurityWrapper.export(ProtocolSecurityWrapper.java:84) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.cluster.filter.ProtocolFilterWrapper.export(ProtocolFilterWrapper.java:61) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.ProtocolSerializationWrapper.export(ProtocolSerializationWrapper.java:50) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.protocol.InvokerCountWrapper.export(InvokerCountWrapper.java:42) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.rpc.Protocol$Adaptive.export(Protocol$Adaptive.java) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.doExportUrl(ServiceConfig.java:969) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.exportRemote(ServiceConfig.java:948) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.exportUrl(ServiceConfig.java:876) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.doExportUrlsFor1Protocol(ServiceConfig.java:622) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.doExportUrls(ServiceConfig.java:600) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.doExport(ServiceConfig.java:555) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.ServiceConfig.export(ServiceConfig.java:341) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServiceInternal(DefaultModuleDeployer.java:495) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.exportServices(DefaultModuleDeployer.java:442) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.startSync(DefaultModuleDeployer.java:177) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.deploy.DefaultModuleDeployer.start(DefaultModuleDeployer.java:159) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onContextRefreshedEvent(DubboDeployApplicationListener.java:167) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:153) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.apache.dubbo.config.spring.context.DubboDeployApplicationListener.onApplicationEvent(DubboDeployApplicationListener.java:52) ~[dubbo-3.3.0-beta.2.jar:3.3.0-beta.2]
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:176) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:169) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:143) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:413) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:370) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:937) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:587) ~[spring-context-6.0.6.jar:6.0.6]
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:146) ~[spring-boot-3.0.4.jar:3.0.4]
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:732) ~[spring-boot-3.0.4.jar:3.0.4]
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:434) ~[spring-boot-3.0.4.jar:3.0.4]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:310) ~[spring-boot-3.0.4.jar:3.0.4]
at cn.itbox.uap.demo.org.application.OrgDemoApplication.main(OrgDemoApplication.java:37) ~[classes/:?]
2024-06-22 22:28:26,089 [INFO ] [[main]] [TRACEID:] [{}] [o.a.c.h.Http11NioProtocol:173]: Pausing ProtocolHandler ["http-nio-8090"]
2024-06-22 22:28:26,089 [INFO ] [[main]] [TRACEID:] [{}] [o.a.c.c.StandardService:173]: Stopping service [Tomcat]
2024-06-22 22:28:26,092 [INFO ] [[main]] [TRACEID:] [{}] [o.a.c.h.Http11NioProtocol:173]: Stopping ProtocolHandler ["http-nio-8090"]
2024-06-22 22:28:26,093 [INFO ] [[main]] [TRACEID:] [{}] [o.a.c.h.Http11NioProtocol:173]: Destroying ProtocolHandler ["http-nio-8090"]
2024-06-22 22:28:26,094 [INFO ] [[main]] [TRACEID:] [{}] [o.s.b.a.l.ConditionEvaluationReportLogger:82]:

Anything else

No response

Are you willing to submit a pull request to fix on your own?

  • Yes I am willing to submit a pull request on my own!

Code of Conduct

@smalltalkhyb smalltalkhyb added component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage labels Jun 22, 2024
@AlbumenJ
Copy link
Member

Please re-submit the issue in English only :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component/need-triage Need maintainers to triage type/need-triage Need maintainers to triage
Projects
Archived in project
Development

No branches or pull requests

2 participants