{"record":{"id":"63f2634f3bcdf727","repo":"eclipse-vertx/vert.x","slug":"resource-not-found-sourcename","errorCode":null,"errorMessage":"Resource not found: ${sourceName}","messagePattern":"Resource not found: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/impl/verticle/CompilingClassLoader.java","lineNumber":47,"sourceCode":"import static io.vertx.core.internal.net.RFC3986.decodeURIComponent;\n\n/**\n *\n * Classloader for dynamic .java source file compilation and loading.\n *\n * @author Janne Hietam&auml;ki\n */\npublic class CompilingClassLoader extends ClassLoader {\n\n  private static final Logger log = LoggerFactory.getLogger(CompilingClassLoader.class);\n\n  private final JavaSourceContext javaSourceContext;\n  private final MemoryFileManager fileManager;\n  public CompilingClassLoader(ClassLoader loader, String sourceName) {\n    super(loader);\n    URL resource = getResource(sourceName);\n    if (resource == null) {\n      throw new RuntimeException(\"Resource not found: \" + sourceName);\n    }\n    //Need to urldecode it too, since bug in JDK URL class which does not url decode it, so if it contains spaces you are screwed\n    final File sourceFile = new File(decodeURIComponent(resource.getFile(), false));\n    if (!sourceFile.canRead()) {\n      throw new RuntimeException(\"File not found: \" + sourceFile.getAbsolutePath() + \" current dir is: \" + new File(\".\").getAbsolutePath());\n    }\n\n    this.javaSourceContext = new JavaSourceContext(sourceFile);\n\n    try {\n      DiagnosticCollector<JavaFileObject> diagnostics = new DiagnosticCollector<>();\n      JavaCompiler javaCompiler = ToolProvider.getSystemJavaCompiler();\n      if (javaCompiler == null) {\n        throw new RuntimeException(\"Unable to detect java compiler, make sure you're using a JDK not a JRE!\");\n      }\n      StandardJavaFileManager standardFileManager = javaCompiler.getStandardFileManager(null, null, null);\n\n      standardFileManager.setLocation(StandardLocation.SOURCE_PATH, Collections.singleton(javaSourceContext.getSourceRoot()));","sourceCodeStart":29,"sourceCodeEnd":65,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/impl/verticle/CompilingClassLoader.java#L29-L65","documentation":"Construction failure in CompilingClassLoader: the .java source resource named by sourceName cannot be found via getResource on the parent classloader. The resource name is included; the input at fault is the sourceName string used to locate the Java source for dynamic compilation.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/impl/verticle/CompilingClassLoader.java:47 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Correct the source name so it resolves on the classpath","Ensure the .java file is packaged as a resource in the verticle jar/bundle"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"fb308bd8c3f12c79f4ae89bef67fadf6c80d036e","analyzedAt":"2026-09-06T11:37:12.241Z","contentChangedAt":"2026-09-06T11:37:12.241Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}