{"record":{"id":"ca6773a74962bea2","repo":"eclipse-vertx/vert.x","slug":"invalid-name-str","errorCode":null,"errorMessage":"Invalid name: ${str}","messagePattern":"Invalid name: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/impl/verticle/VerticleManager.java","lineNumber":145,"sourceCode":"      if (pos != -1) {\n        lookup = getSuffix(pos, identifier);\n      } else {\n        // No prefix, no extension - use defaults\n        factoryList = defaultFactories;\n      }\n    }\n    if (factoryList == null) {\n      factoryList = verticleFactories.get(lookup);\n      if (factoryList == null) {\n        factoryList = defaultFactories;\n      }\n    }\n    return factoryList;\n  }\n\n  private static String getSuffix(int pos, String str) {\n    if (pos + 1 >= str.length()) {\n      throw new IllegalArgumentException(\"Invalid name: \" + str);\n    }\n    return str.substring(pos + 1);\n  }\n\n  /**\n   * Deploy a verticle given a deployment {@code identifier} and its specific {@code options}.\n   *\n   * @param identifier the verticle identifier\n   * @param options the deployment options\n   * @return a furur result of the deployment context\n   */\n  public Future<DeploymentContext> deployVerticle(String identifier, DeploymentOptions options) {\n    ContextInternal callingContext = vertx.getOrCreateContext();\n    ClassLoader loader = options.getClassLoader();\n    if (loader == null) {\n      loader = getCurrentClassLoader();\n    }\n    return deployVerticle(identifier, options, callingContext, callingContext, loader);","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/impl/verticle/VerticleManager.java#L127-L163","documentation":"When resolving deployment identifiers, getSuffix extracts the part after the last ':' delimiter (the factory prefix is the part before it). If the identifier ends with ':' or has no suffix, the name is malformed and cannot be dispatched to any verticle factory.","triggerScenarios":"Deploying an identifier like \"service:\" or \"myorg-\" where a prefix is present but nothing follows it; calling deployVerticle(\"foo:\").","commonSituations":"String-concatenation bugs building deployment names dynamically; configuration values where the suffix portion was accidentally stripped or the separator typed twice at the end.","solutions":["Pass a complete identifier of the form \"prefix:name\", e.g. \"service:com.acme.MyService\"","Check the code/config that builds the deployment name for a trailing ':'","If deploying a plain class, omit the prefix entirely instead of leaving an empty suffix"],"exampleFix":"// before\nvertx.deployVerticle(\"service:\"); // throws\n// after\nvertx.deployVerticle(\"service:com.acme.MyService\");","handlingStrategy":"validation","validationCode":"String identifier = \"service:com.acme.MyService\";\nint i = identifier.lastIndexOf(':');\nif (i != -1 && i + 1 >= identifier.length()) {\n  throw new IllegalArgumentException(\"Deployment name needs a suffix after ':'\");\n}","typeGuard":null,"tryCatchPattern":"try {\n  vertx.deployVerticle(identifier);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage() != null && e.getMessage().startsWith(\"Invalid name\")) {\n    log.error(\"Malformed deployment identifier: \" + identifier);\n  }\n}","preventionTips":["Validate deployment identifiers from external config before deploying","Never build identifiers by concatenation without checking the result","Use full class names (no ':') for plain verticles"],"tags":["deployment-identifier","verticle-name","verticle-factory"],"backgroundTag":"invalid-identifier-format","analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}