{"record":{"id":"b6988db331378058","repo":"apache/shenyu","slug":"please-config-shenyu-client-http-props-port-in-xml-yml","errorCode":null,"errorMessage":"please config ${shenyu.client.http.props.port} in xml/yml !","messagePattern":"please config (.+?) in xml/yml !","errorType":"exception","errorClass":"ShenyuException","httpStatus":null,"severity":"critical","filePath":"shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/main/java/org/apache/shenyu/client/springmvc/init/SpringMvcClientEventListener.java","lineNumber":162,"sourceCode":"    }\n\n    @Override\n    protected URIRegisterDTO buildURIRegisterDTO(final ApplicationContext context,\n                                                 final Map<String, Object> beans,\n                                                 final String namespaceId) {\n        try {\n            return URIRegisterDTO.builder()\n                    .contextPath(getContextPath())\n                    .appName(getAppName())\n                    .protocol(protocol)\n                    .host(super.getHost())\n                    .port(Integer.valueOf(getPort()))\n                    .rpcType(RpcTypeEnum.HTTP.getName())\n                    .eventType(EventType.REGISTER)\n                    .namespaceId(namespaceId)\n                    .build();\n        } catch (ShenyuException e) {\n            throw new ShenyuException(e.getMessage() + \"please config ${shenyu.client.http.props.port} in xml/yml !\");\n        }\n    }\n    \n    @Override\n    protected String getClientName() {\n        return RpcTypeEnum.HTTP.getName();\n    }\n    \n    @Override\n    protected void handle(final String beanName, final Object bean) {\n        Class<?> clazz = getCorrectedClass(bean);\n        final ShenyuSpringMvcClient beanShenyuClient = AnnotatedElementUtils.findMergedAnnotation(clazz, getAnnotationType());\n        final List<String> superPaths = buildApiSuperPaths(clazz, beanShenyuClient);\n        final Method[] methods = ReflectionUtils.getUniqueDeclaredMethods(clazz);\n        for (String superPath : superPaths) {\n            if (Objects.nonNull(beanShenyuClient) && superPath.contains(\"*\")) {\n                handleClass(clazz, bean, beanShenyuClient, superPath);\n                continue;","sourceCodeStart":144,"sourceCodeEnd":180,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-client/shenyu-client-http/shenyu-client-springmvc/src/main/java/org/apache/shenyu/client/springmvc/init/SpringMvcClientEventListener.java#L144-L180","documentation":"SpringMvcClientEventListener.buildURIRegisterDTO resolves the client's port via getPort(), which reads the configured shenyu.client.http.props.port. When that resolution throws ShenyuException (port missing/unparseable), the catch rethrows with an appended hint telling the user to configure the port in xml/yml.","triggerScenarios":"Registering HTTP/SpringMVC API metadata at startup when shenyu.client.http.props.port is absent from application.yml/xml, so Integer.valueOf(getPort()) throws and the message gets the config hint appended.","commonSituations":"Missing props block in yml; port typo'd or non-numeric; copying http client config without the port key; yaml indentation making port null.","solutions":["Add port under shenyu.client.http.props in application.yml","Ensure the port value is a plain integer string (no quotes/spaces issues)","Check the nested exception message to see the original failure before the hint","Compare against shenyu-examples springmvc configuration"],"exampleFix":"// before\nshenyu:\n  client:\n    http:\n      props:\n        contextPath: /http\n// after\nshenyu:\n  client:\n    http:\n      props:\n        contextPath: /http\n        port: 8189","handlingStrategy":"validation","validationCode":"String port = shenyuClientConfig.getHttp().getProps().get(\"port\");\nif (port == null || !port.matches(\"\\\\d+\")) {\n    throw new IllegalStateException(\"shenyu.client.http.props.port must be set to a number\");\n}","typeGuard":null,"tryCatchPattern":"try { listener.buildURIRegisterDTO(bean); }\ncatch (ShenyuException e) {\n    log.error(\"client registration failed, check shenyu.client.http.props.port: {}\", e.getMessage());\n}","preventionTips":["Always set shenyu.client.http.props.port in yml","Validate client props at startup with a config checker","Copy config from shenyu-examples to avoid missing keys"],"tags":["springmvc","configuration","port","registration"],"backgroundTag":"missing-required-config-field","analyzedSha":"567142e07261b3e615ae8850b30f4421f455cc5d","analyzedAt":"2026-09-12T10:08:21.293Z","contentChangedAt":"2026-09-12T10:08:21.293Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}