Get Stack Traces
Returns the current stack trace for each thread in the JVM. Includes lock information for blocked threads. Requires admin password.
Request
GET /nxt?requestType=getStackTraces&adminPassword=<adminPassword>&depth=<number>
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
depth | integer | No | Maximum stack trace depth. Defaults to full trace. Must be >= 1. |
adminPassword | string | Conditional | Admin password required if nxt.adminPassword is set. |
Response
{
"threads": [
{
"id": 1,
"name": "main",
"state": "RUNNABLE",
"locks": [],
"trace": [
"java.lang.Thread.run(Thread.java:833)",
"nxt.Nxt.main(Nxt.java:123)"
]
}
],
"locks": [
{
"name": "java.util.concurrent.locks.ReentrantLock",
"hash": 123456789,
"thread": 2
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
threads | array | Array of thread objects. |
threads[].id | long | Thread ID. |
threads[].name | string | Thread name. |
threads[].state | string | Thread state (RUNNABLE, BLOCKED, WAITING, etc.). |
threads[].locks | array | Monitors held by this thread. |
threads[].blocked | object | Lock info if thread is blocked (only present for blocked threads). |
threads[].trace | array | Stack trace elements. |
locks | array | Array of locks with waiters. |
locks[].name | string | Lock class name. |
locks[].hash | integer | Lock identity hash code. |
locks[].thread | long | Thread ID holding the lock. |
Notes
- This endpoint does not require the blockchain to be running (
requireBlockchain = false). - Not chain-specific.
- Requires admin password authentication (
requirePassword = true). - Uses
ManagementFactory.getThreadMXBean().dumpAllThreads()for thread information.
Source: GetStackTraces.java.
Example
curl "http://localhost:22024/nxt?requestType=getStackTraces&depth=10"