{"record":{"id":"57e5d6f90601d271","repo":"apache/shenyu","slug":"shenyutarsplugininitializeexception-can-t-init-prx-with","errorCode":null,"errorMessage":"ShenyuTarsPluginInitializeException: can't init prx with empty ext string","messagePattern":"ShenyuTarsPluginInitializeException: can't init prx with empty ext string","errorType":"exception","errorClass":"ShenyuTarsPluginException","httpStatus":null,"severity":"error","filePath":"shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-tars/src/main/java/org/apache/shenyu/plugin/tars/cache/ApplicationConfigCache.java","lineNumber":223,"sourceCode":"        }\n    }\n    \n    /**\n     * Try to load once, if it fails, it will give up.<br>\n     * add class cache to {@link #prxClassCache}.<br>\n     * add method params cache to {@link #prxParamCache}.<br>\n     * add paths cache to {@link #ctxPathCache}.<br>\n     *\n     * @param metaData metaData\n     * @throws ClassNotFoundException meta data class definition not found\n     * @see ReentrantLock\n     */\n    private void tryLockedLoadMetaData(final MetaData metaData) throws ClassNotFoundException {\n        Objects.requireNonNull(LOCK);\n        if (LOCK.tryLock()) {\n            try {\n                if (StringUtils.isEmpty(metaData.getRpcExt())) {\n                    throw new ShenyuTarsPluginException(\"ShenyuTarsPluginInitializeException: can't init prx with empty ext string\");\n                }\n                Class<?> prxClazz = buildClassDefinition(metaData);\n                prxClassCache.put(metaData.getPath(), prxClazz);\n                List<MetaData> paths = ctxPathCache.getOrDefault(metaData.getContextPath(), new ArrayList<>());\n                if (!IterableUtils.matchesAny(paths, p -> p.getPath().equals(metaData.getPath()))) {\n                    paths.add(metaData);\n                }\n                ctxPathCache.put(metaData.getContextPath(), paths);\n            } finally {\n                LOCK.unlock();\n            }\n        }\n    }\n    \n    /**\n     * build target class definition.\n     *\n     * @param metaData metadata","sourceCodeStart":205,"sourceCodeEnd":241,"githubUrl":"https://github.com/apache/shenyu/blob/567142e07261b3e615ae8850b30f4421f455cc5d/shenyu-plugin/shenyu-plugin-proxy/shenyu-plugin-rpc/shenyu-plugin-tars/src/main/java/org/apache/shenyu/plugin/tars/cache/ApplicationConfigCache.java#L205-L241","documentation":"ApplicationConfigCache.tryLockedLoadMetaData builds the TARS proxy class from MetaData. The rpcExt field (a JSON string describing the TARS servant methods) is mandatory — if it's empty, a ShenyuTarsPluginException is thrown because a proxy cannot be constructed without method information.","triggerScenarios":"A MetaData record for a tars service reaches tryLockedLoadMetaData (via initPrx on first invocation) with getRpcExt() returning null or empty string — i.e., the client registered metadata without the rpcExt payload.","commonSituations":"TARS backend client annotated/configured incorrectly so rpcExt wasn't populated during registration; metadata manually inserted into the admin DB without rpcExt; older client version not generating rpcExt; sync race where metadata arrives incomplete.","solutions":["Fix the TARS client configuration so it registers metadata with a non-empty rpcExt (method/parameter description JSON), then re-register the service.","Verify the shenyu-client version on the backend generates rpcExt for @ShenyuTarsClient endpoints.","Correct the MetaData row in shenyu-admin (rpc_ext column) for the affected path, or delete it so the client re-registers.","Check the registration/sync pipeline (admin logs) for metadata being truncated or dropped."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"MetaData md = metaDataService.findByPath(path);\nif (md == null || md.getRpcExt() == null || md.getRpcExt().isEmpty()) {\n    throw new IllegalStateException(\"tars metadata for \" + path + \" has empty rpcExt; re-register the client\");\n}","typeGuard":null,"tryCatchPattern":"try {\n    initPrx(metaData);\n} catch (ShenyuTarsPluginException e) {\n    LOG.error(\"tars proxy init failed for {}: {}\", metaData.getPath(), e.getMessage());\n}","preventionTips":["Ensure the backend TARS client registers rpcExt JSON with every @ShenyuTarsClient endpoint.","Validate rpc_ext is non-empty in admin before publishing metadata to the gateway.","After manual DB edits, re-register or re-sync metadata to restore rpcExt.","Monitor admin registration logs for metadata records missing rpcExt."],"tags":["tars","metadata","registration","empty-field"],"backgroundTag":"empty-required-field","analyzedSha":"567142e07261b3e615ae8850b30f4421f455cc5d","analyzedAt":"2026-09-12T10:08:21.293Z","contentChangedAt":"2026-09-12T10:08:21.293Z","schemaVersion":2},"datasetVersion":"2026-09-19T12:17:13.211Z"}