> ## Documentation Index
> Fetch the complete documentation index at: https://developers.drpn.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Local development troubleshooting

> Recover from common local Darpan setup failures: JDK 21, Spark flags, missing components, ports and database locks.

Local setup breaks in predictable ways — almost always a JDK version mismatch, missing JVM flags, a missing runtime clone, or a port that didn't release cleanly. The table below covers the problems that come up most often while following [Local development](https://developers.drpn.ai/engineering/local-development.md).

## Common fixes

| Problem | Fix |
| - | - |
| Backend fails to start with a `JVM version 21` or class-version error | Make JDK 21 the active Java: `export JAVA_HOME=$(/usr/libexec/java_home -v 21)`. The backend does not run on Java 17. |
| `java -version` still reports 17 after installing JDK 21 | A version-manager shim such as jenv or asdf is ahead of JDK 21 on your `PATH`. Point `JAVA_HOME` at the JDK 21 home, put `$JAVA_HOME/bin` first on `PATH`, and confirm with `java -version` before running Gradle. |
| Backend boots but reconciliation fails at the compare step, for example on `sun.nio.ch.DirectBuffer` or an `IllegalAccessError` | The Spark JVM flags were not set. Export `JAVA_TOOL_OPTIONS` with the full flag set from [Set the JDK 21 runtime flags](https://developers.drpn.ai/engineering/local-development.md#set-the-jdk-21-runtime-flags) in the same shell, then restart the backend. `./gradlew run` and `npm run dev:stack` do not set these flags themselves. |
| `Repository not found` while cloning a `drpn-ai` repo | Check the repository name and URL. If your organization uses SSH, switch to the SSH clone URL. |
| `runtime directory not found` | Run `./gradlew getRuntime` from `darpan-backend` before loading data. |
| Gradle cannot find `:runtime:component:moqui-sftp` | Clone `moqui-sftp` into `runtime/component`. |
| The backend fails at startup loading the `moqui-gql` component | Build its jar before loading or running: `./gradlew :runtime:component:moqui-gql:jar`. |
| Gradle cannot find `:runtime:component:moqui-rules` | Darpan 3.4.0 and later build against `moqui-rules`. Clone `drpn-ai/moqui-rules` into `runtime/component`, then build its jar: `./gradlew :runtime:component:moqui-rules:jar`. |
| Gradle cannot find `:runtime:component:moqui-jexl`, or the server stops at start because `darpan` depends on `moqui-jexl` | Darpan 3.4.0 and later run tenant queries on `moqui-jexl`. Clone `drpn-ai/moqui-jexl` into `runtime/component`, then build its jar: `./gradlew :runtime:component:moqui-jexl:jar`. |
| `Task 'loadDarpanSetup' not found` | Use `./gradlew load` for a fresh setup. `loadDarpanSetup` was removed. |
| `npm install` or Vite fails on Node version | Use Node.js 20 or newer. |
| Backend starts but UI API calls fail | Wait for Moqui boot to finish, then refresh the UI. |
| Login shows no active session | Sign in through the app at `http://localhost:5173/login` with the demo administrator that `./gradlew load` creates (see [Sign in locally](https://developers.drpn.ai/engineering/local-development.md#sign-in-locally)). |
| `http://localhost:8080/Login` answers 404 | Expected from Darpan 3.1.0: the backend's own sign-in screens are closed. Sign in through the app. |
| A new password is refused as too short | Passwords need at least 12 characters. |
| Data load fails with a database lock | The local database is H2, which allows one process at a time. Stop `npm run dev:stack` or any running backend process before rerunning the load. |
| Ports keep changing or Vite starts on a different port | Use `npm run dev:stack`; it targets `8080` and `5173` and clears old listeners. Export `JAVA_TOOL_OPTIONS` in the same shell first. |

For sign-in refusals from scripts and API clients, passkeys on a deployed instance, and failures after an upgrade, see [Troubleshooting](https://developers.drpn.ai/self-host/troubleshooting.md) under Self-host.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.