SAP Knowledge Base Article - Preview

3724264 - OpenRewrite rewriteDryRun fails with "too many open files" error

Symptom

  • Running the OpenRewrite rewriteDryRun recipe with the goal of scoping the run to a single custom extension results in:
    • "Too many open files" errors on macOS/Linux, for example:
      • "java.nio.file.FileSystemException: .../testsrc/.../XTest.java: Too many open files"
      • "Could not update ~/.gradle/caches/.../last-build.bin (Too many open files)"
    • Despite scoping, the dry run still parses files outside the target module.
  • On Windows, the same dry run completes successfully with the same init.gradle and recipe.
  • Attempts to mitigate with higher file descriptor limits and Gradle flags (e.g., -Dorg.gradle.workers.max=1, -Dorg.gradle.parallel=false, -Dorg.gradle.vfs.watch=false) do not resolve the issue.
  • When splitting work into batches and migrating some extensions, the rewritten code replaces javax.* with jakarta.*, causing compilation failures on the older Commerce Suite (JDK 17/Spring 5) due to missing Jakarta dependencies:
    • Errors such as "package jakarta.* does not exist" appear during compilation.


Read more...

Environment

SAP Commerce Cloud

Product

SAP Commerce Cloud all versions

Keywords

SAP Commerce Cloud, OpenRewrite, rewriteDryRun, rewriteRun, framework update, framework upgrade, JDK 21 migration, JDK21, Jakarta, javax to jakarta, Spring 6, file descriptor limit, Too many open files, java.nio.file.FileSystemException, FileSystemException, ulimit -n, macOS, Linux, Windows, Gradle, init.gradle, commerceUpdatePaths, commerceRewriteExclusion, generatePatterns, exclusions, Logical Source Tree, LST, batching, extensions, custom directory, compilation failure, missing jakarta packages, glob patterns, Using OpenRewrite recipes to support SAP Commerce Cloud JDK21 Framework Update adoption, 3618495 , KBA , CEC-SCC-PLA-PL , Platform , Problem

About this page

This is a preview of a SAP Knowledge Base Article. Click more to access the full version on SAP for Me (Login required).

Search for additional results

Visit SAP Support Portal's SAP Notes and KBA Search.