{"record":{"id":"fbe13fd3a04324cc","repo":"eclipse-vertx/vert.x","slug":"file-not-found-sourcefile-getabsolutepath-cu","errorCode":null,"errorMessage":"File not found: ${sourceFile.getAbsolutePath()} current dir is: ${new File(\".\").getAbsolutePath()}","messagePattern":"File not found: (.+?) current dir is: (.+?)","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"vertx-core/src/main/java/io/vertx/core/impl/verticle/CompilingClassLoader.java","lineNumber":52,"sourceCode":" *\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()));\n      fileManager = new MemoryFileManager(loader, standardFileManager);\n\n      // TODO - this needs to be fixed so it can compile classes from the classpath otherwise can't include\n      // other .java resources from other modules\n","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/eclipse-vertx/vert.x/blob/fb308bd8c3f12c79f4ae89bef67fadf6c80d036e/vertx-core/src/main/java/io/vertx/core/impl/verticle/CompilingClassLoader.java#L34-L70","documentation":"Construction failure in CompilingClassLoader: the source resource URL was found but the decoded source file is not readable (canRead() false). The message reports the source file's absolute path and the process's current directory; the input at fault is the file backing the located resource.","triggerScenarios":"Thrown at vertx-core/src/main/java/io/vertx/core/impl/verticle/CompilingClassLoader.java:52 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Check the reported path for typos, missing files, or permission issues","Run the process from a working directory where the source file is readable"],"exampleFix":null,"handlingStrategy":"try-catch","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"}