{"record":{"id":"047bb817616c7384","repo":"eclipse-vertx/vert.x","slug":"invalid-identifier-identifer","errorCode":null,"errorMessage":"Invalid identifier: ${identifer}","messagePattern":"Invalid identifier: (.+?)","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/spi/VerticleFactory.java","lineNumber":38,"sourceCode":" * Has responsibility for creating verticle instances.\n * <p>\n * Implementations of this are responsible for creating verticle written in various different JVM languages and\n * for other purposes.\n *\n * @author <a href=\"http://tfox.org\">Tim Fox</a>\n */\npublic interface VerticleFactory {\n\n  /**\n   * Helper method to remove a prefix from an identifier string\n   * @param identifer the identifier\n   * @return  The identifier without the prefix (if it had any)\n   */\n  static String removePrefix(String identifer) {\n    int pos = identifer.indexOf(':');\n    if (pos != -1) {\n      if (pos == identifer.length() - 1) {\n        throw new IllegalArgumentException(\"Invalid identifier: \" + identifer);\n      }\n      return identifer.substring(pos + 1);\n    } else {\n      return identifer;\n    }\n  }\n\n  /**\n   * The order of the factory. If there is more than one matching verticle they will be tried in ascending order.\n   * @return  the order\n   */\n  default int order() {\n    return 0;\n  }\n\n  /**\n   * Initialise the factory\n   * @param vertx  The Vert.x instance","sourceCodeStart":20,"sourceCodeEnd":56,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/spi/VerticleFactory.java#L20-L56","documentation":"VerticleFactory.removePrefix strips the '<prefix>:' portion of a verticle deployment identifier. If the identifier ends with a colon there is nothing after the prefix, so it throws IllegalArgumentException reporting the full identifier.","triggerScenarios":"Deploying a verticle with an identifier like 'js:' or 'java:' — the prefix separator exists but the actual identifier part is empty.","commonSituations":"Config-driven deployment where the identifier came from a truncated property/env var; string concatenation built the prefix but forgot the verticle name (e.g. prefix + \":\" without appending the class file).","solutions":["Supply a full identifier including the part after the colon, e.g. 'js:my_verticle.js'.","Validate the deployment string in your config before calling deployVerticle (must contain non-empty text after ':').","If no prefix is needed, pass the bare identifier (no colon) — removePrefix then returns it unchanged."],"exampleFix":"// before\nString ident = \"js:\"; // from truncated config\nvertx.deployVerticle(ident); // IllegalArgumentException\n// after\nString ident = config.contains(\"verticle\") ? config.getString(\"verticle\") : \"js:app.js\";\nif (ident.endsWith(\":\")) throw new IllegalArgumentException(\"missing verticle name after prefix\");\nvertx.deployVerticle(ident);","handlingStrategy":"validation","validationCode":"static void validateVerticleIdentifier(String ident) {\n  int pos = ident.indexOf(':');\n  if (pos == ident.length() - 1) throw new IllegalArgumentException(\"empty verticle name after prefix: \" + ident);\n}","typeGuard":null,"tryCatchPattern":"try {\n  vertx.deployVerticle(identifier);\n} catch (IllegalArgumentException e) {\n  if (e.getMessage().startsWith(\"Invalid identifier\")) {\n    identifier = defaultPrefix + \":\" + defaultVerticle;\n  } else throw e;\n}","preventionTips":["Validate config-sourced verticle identifiers at startup.","Never build identifiers by concatenating prefix + \":\" without appending a name.","Cover deployment identifiers in config validation tests."],"tags":["verticle","deployment","identifier","illegal-argument"],"backgroundTag":"invalid-identifier","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"}